newline-character wasn't appended correctly

This commit is contained in:
daniel oeh 2013-02-12 01:01:20 +01:00
parent 235c073938
commit 71502d74cc
1 changed files with 11 additions and 8 deletions

View File

@ -261,27 +261,30 @@ public class DownloadService extends Service {
if (notificationBuilder != null) { if (notificationBuilder != null) {
StringBuilder bigText = null; StringBuilder bigText = new StringBuilder("");
for (Downloader downloader : downloads) { for (int i = 0; i < downloads.size(); i++) {
Downloader downloader = downloads.get(i);
if (downloader.getStatus() != null) { if (downloader.getStatus() != null) {
if (bigText == null) {
bigText = new StringBuilder("");
}
FeedFile f = downloader.getStatus().getFeedFile(); FeedFile f = downloader.getStatus().getFeedFile();
if (f.getClass() == Feed.class) { if (f.getClass() == Feed.class) {
Feed feed = (Feed) f; Feed feed = (Feed) f;
if (feed.getTitle() != null) { if (feed.getTitle() != null) {
bigText.append("\u2022 " + feed.getTitle() if (i > 0) {
+ "\n"); bigText.append("\n");
}
bigText.append("\u2022 " + feed.getTitle());
} }
} else if (f.getClass() == FeedMedia.class) { } else if (f.getClass() == FeedMedia.class) {
FeedMedia media = (FeedMedia) f; FeedMedia media = (FeedMedia) f;
if (media.getItem().getTitle() != null) { if (media.getItem().getTitle() != null) {
if (i > 0) {
bigText.append("\n");
}
bigText.append("\u2022 " bigText.append("\u2022 "
+ media.getItem().getTitle() + media.getItem().getTitle()
+ " (" + " ("
+ downloader.getStatus() + downloader.getStatus()
.getProgressPercent() + "%)\n"); .getProgressPercent() + "%)");
} }
} }
} }