diff options
-rw-r--r-- | res/values/colors.xml | 4 | ||||
-rw-r--r-- | res/values/strings.xml | 8 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java | 30 |
3 files changed, 28 insertions, 14 deletions
diff --git a/res/values/colors.xml b/res/values/colors.xml index 0ea65feb3..e7463852f 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -21,5 +21,7 @@ <color name="ics_gray">#858585</color> <color name="selection_background">#FEBB20</color> <color name="actionbar_gray">#DDDDDD</color> - + <color name="download_success_green">#669900</color> + <color name="download_failed_red">#CC0000</color> + </resources>
\ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 73c298e69..fac3bec5b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -78,6 +78,10 @@ <string name="downloads_left">\u0020Downloads left</string> <string name="download_notification_title">Downloading podcast data</string> <string name="download_report_content">%1$d downloads succeeded, %2$d failed</string> + <string name="download_log_title_unknown">Unknown title</string> + <string name="download_type_feed">Feed</string> + <string name="download_type_media">Media file</string> + <string name="download_type_image">Image</string> <!-- Mediaplayer messages --> <string name="player_error_msg">Error!</string> @@ -90,8 +94,8 @@ <string name="no_media_playing_label">No media playing</string> <string name="position_default_label">00:00:00</string> <string name="player_buffering_msg">Buffering</string> - <string name="playbackservice_notification_title">Playing podcast</string> - <string name="playbackservice_notification_content">Tap here for more info</string> + <string name="playbackservice_notification_title">Playing podcast</string> + <string name="playbackservice_notification_content">Tap here for more info</string> <!-- Navigation --> <string name="show_download_log">Show Log</string> <string name="show_player_label">Show player</string> diff --git a/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java b/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java index adf522290..eae163231 100644 --- a/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java +++ b/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java @@ -44,29 +44,37 @@ public class DownloadLogAdapter extends ArrayAdapter<DownloadStatus> { .findViewById(R.id.txtvStatus); holder.reason = (TextView) convertView .findViewById(R.id.txtvReason); + if (feedfile.getClass() == Feed.class) { - holder.title.setText(((Feed) feedfile).getTitle()); - holder.type.setText("Feed"); + holder.type.setText(R.string.download_type_feed); } else if (feedfile.getClass() == FeedMedia.class) { - holder.title.setText(((FeedMedia) feedfile).getItem() - .getTitle()); - holder.type.setText(((FeedMedia) feedfile).getMime_type()); + holder.type.setText(R.string.download_type_media); } else if (feedfile.getClass() == FeedImage.class) { - holder.title.setText(((FeedImage) feedfile).getTitle()); - holder.type.setText("Image"); + holder.type.setText(R.string.download_type_image); + } + if (status.getTitle() != null) { + holder.title.setText(status.getTitle()); + } else { + holder.title.setText(R.string.download_log_title_unknown); } holder.date.setText(DateUtils.formatSameDayTime(status .getCompletionDate().getTime(), System.currentTimeMillis(), DateFormat.SHORT, DateFormat.SHORT)); if (status.isSuccessful()) { - holder.successful.setTextColor(Color.parseColor("green")); + holder.successful.setTextColor(convertView.getResources() + .getColor(R.color.download_success_green)); holder.successful.setText(R.string.download_successful); holder.reason.setVisibility(View.GONE); } else { - holder.successful.setTextColor(Color.parseColor("red")); + holder.successful.setTextColor(convertView.getResources() + .getColor(R.color.download_failed_red)); holder.successful.setText(R.string.download_failed); - holder.reason.setText(DownloadError.getErrorString( - getContext(), status.getReason())); + String reasonText = DownloadError.getErrorString( + getContext(), status.getReason()); + if (status.getReasonDetailed() != null) { + reasonText += ": " + status.getReasonDetailed(); + } + holder.reason.setText(reasonText); } } else { holder = (Holder) convertView.getTag(); |