aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-05-16 19:41:36 -0700
committerScott Jackson <daneren2005@gmail.com>2013-05-16 19:41:36 -0700
commit4a7abadebc1ab8da1702ae58670ca1196e1dcf2c (patch)
tree615385179a490da1911d44ebac6e365694393d65
parentb8bdb7de3c027990a06fcad6440045dcac565aab (diff)
downloaddsub-4a7abadebc1ab8da1702ae58670ca1196e1dcf2c.tar.gz
dsub-4a7abadebc1ab8da1702ae58670ca1196e1dcf2c.tar.bz2
dsub-4a7abadebc1ab8da1702ae58670ca1196e1dcf2c.zip
Added support for release date to changelog
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/view/ChangeLog.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/view/ChangeLog.java b/subsonic-android/src/github/daneren2005/dsub/view/ChangeLog.java
index 630fb021..b847733e 100644
--- a/subsonic-android/src/github/daneren2005/dsub/view/ChangeLog.java
+++ b/subsonic-android/src/github/daneren2005/dsub/view/ChangeLog.java
@@ -80,7 +80,8 @@ public class ChangeLog {
* Default CSS styles used to format the change log.
*/
private static final String DEFAULT_CSS =
- "h1 { margin-left: 0px; font-size: 1.2em;}" +
+ "div.title { margin-left: 0px; font-size: 1.2em; text-align: center;}" +
+ "div.subtitle {margin-left: 0px; font-size: .8em; text-align: center;}" +
"li { margin-left: 0px;}" +
"ul { padding-left: 2em;}";
@@ -125,6 +126,7 @@ public class ChangeLog {
static final String NAME = "release";
static final String ATTRIBUTE_VERSION = "version";
static final String ATTRIBUTE_VERSION_CODE = "versioncode";
+ static final String ATTRIBUTE_RELEASE_DATE = "releasedate";
}
/**
@@ -406,9 +408,15 @@ public class ChangeLog {
// if necessary.
ReleaseItem release = changelog.get(key, defaultChangelog.get(key));
- sb.append("<h1>");
+ sb.append("<div class='title'>");
sb.append(String.format(versionFormat, release.versionName));
- sb.append("</h1><ul>");
+ sb.append("</div>");
+ if(release.releaseDate != null) {
+ sb.append("<div class='subtitle'>");
+ sb.append(release.releaseDate);
+ sb.append("</div>");
+ }
+ sb.append("<ul>");
for (String change : release.changes) {
sb.append("<li>");
sb.append(change);
@@ -489,6 +497,8 @@ public class ChangeLog {
} catch (NumberFormatException e) {
versionCode = NO_VERSION;
}
+
+ String releaseDate = xml.getAttributeValue(null, ReleaseTag.ATTRIBUTE_RELEASE_DATE);
if (!full && versionCode <= mLastVersionCode) {
return true;
@@ -505,7 +515,7 @@ public class ChangeLog {
eventType = xml.next();
}
- ReleaseItem release = new ReleaseItem(versionCode, version, changes);
+ ReleaseItem release = new ReleaseItem(versionCode, version, releaseDate, changes);
changelog.put(versionCode, release);
return false;
@@ -524,15 +534,18 @@ public class ChangeLog {
* Version name of the release.
*/
public final String versionName;
+
+ public final String releaseDate;
/**
* List of changes introduced with that release.
*/
public final List<String> changes;
- ReleaseItem(int versionCode, String versionName, List<String> changes) {
+ ReleaseItem(int versionCode, String versionName, String releaseDate, List<String> changes) {
this.versionCode = versionCode;
this.versionName = versionName;
+ this.releaseDate = releaseDate;
this.changes = changes;
}
}