summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-08-15 17:01:55 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-08-15 17:01:55 +0200
commit336beae40951338cc310fd3813e1fb02937fc1d4 (patch)
tree42808362e0fcb39d52f656810e22d2dc45ee37d6
parent22bcb2463ce21d37c2117f7a0356f2bd1abcbff3 (diff)
downloadAntennaPod-336beae40951338cc310fd3813e1fb02937fc1d4.zip
Download list entries should now be more informative
-rw-r--r--res/values/strings.xml1
-rw-r--r--src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java2
-rw-r--r--src/de/danoeh/antennapod/adapter/DownloadlistAdapter.java11
-rw-r--r--src/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java3
-rw-r--r--src/de/danoeh/antennapod/feed/Feed.java13
-rw-r--r--src/de/danoeh/antennapod/feed/FeedManager.java2
6 files changed, 25 insertions, 7 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d64cd6469..9586fa5d6 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -175,6 +175,7 @@
<string name="pref_display_only_episodes_sum">Display only items which also have an episode.</string>
<string name="user_interface_label">User Interface</string>
<string name="feed_delete_confirmation_msg">Please confirm that you want to delete this feed and ALL episodes of this feed that you have downloaded.</string>
+ <string name="image_of_prefix">Image of:\u0020</string>
</resources> \ No newline at end of file
diff --git a/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java b/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java
index afc79c725..6383a4993 100644
--- a/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java
+++ b/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java
@@ -155,7 +155,7 @@ public class MiroGuideChannelViewActivity extends SherlockActivity {
return true;
case R.id.add_feed:
DownloadRequester.getInstance().downloadFeed(this,
- new Feed(channel.getDownloadUrl(), new Date()));
+ new Feed(channel.getDownloadUrl(), new Date(), channel.getName()));
Toast toast = Toast.makeText(this, R.string.miro_feed_added,
Toast.LENGTH_LONG);
toast.show();
diff --git a/src/de/danoeh/antennapod/adapter/DownloadlistAdapter.java b/src/de/danoeh/antennapod/adapter/DownloadlistAdapter.java
index 380ba32be..d103787f5 100644
--- a/src/de/danoeh/antennapod/adapter/DownloadlistAdapter.java
+++ b/src/de/danoeh/antennapod/adapter/DownloadlistAdapter.java
@@ -28,8 +28,6 @@ public class DownloadlistAdapter extends ArrayAdapter<DownloadStatus> {
this.selectedItemIndex = SELECTION_NONE;
}
-
-
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Holder holder;
@@ -69,7 +67,14 @@ public class DownloadlistAdapter extends ArrayAdapter<DownloadStatus> {
} else if (feedFile.getClass() == Feed.class) {
titleText = ((Feed) feedFile).getTitle();
} else if (feedFile.getClass() == FeedImage.class) {
- titleText = "[Image] " + ((FeedImage) feedFile).getTitle();
+ FeedImage image = (FeedImage) feedFile;
+ if (image.getFeed() != null) {
+ titleText = convertView.getResources().getString(
+ R.string.image_of_prefix)
+ + image.getFeed().getTitle();
+ } else {
+ titleText = "[Image] " + ((FeedImage) feedFile).getTitle();
+ }
}
holder.title.setText(titleText);
holder.message.setText(status.getStatusMsg());
diff --git a/src/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java b/src/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java
index 3d44e429c..761a4c804 100644
--- a/src/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java
+++ b/src/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java
@@ -51,8 +51,7 @@ public class OpmlFeedQueuer extends AsyncTask<Void, Void, Void> {
DownloadRequester requester = DownloadRequester.getInstance();
for (int idx = 0; idx < selection.length; idx++) {
OpmlElement element = OpmlImportActivity.getReadElements().get(selection[idx]);
- Feed feed = new Feed(element.getXmlUrl(), new Date());
- feed.setTitle(element.getText());
+ Feed feed = new Feed(element.getXmlUrl(), new Date(), element.getText());
requester.downloadFeed(context.getApplicationContext(), feed);
}
return null;
diff --git a/src/de/danoeh/antennapod/feed/Feed.java b/src/de/danoeh/antennapod/feed/Feed.java
index 0208d8390..4b74a62d1 100644
--- a/src/de/danoeh/antennapod/feed/Feed.java
+++ b/src/de/danoeh/antennapod/feed/Feed.java
@@ -40,12 +40,25 @@ public class Feed extends FeedFile {
this.lastUpdate = lastUpdate;
}
+ /**
+ * This constructor is used for requesting a feed download. It should NOT be
+ * used if the title of the feed is already known.
+ * */
public Feed(String url, Date lastUpdate) {
this(lastUpdate);
this.download_url = url;
}
/**
+ * This constructor is used for requesting a feed download. It should be
+ * used if the title of the feed is already known.
+ * */
+ public Feed(String url, Date lastUpdate, String title) {
+ this(url, lastUpdate);
+ this.title = title;
+ }
+
+ /**
* Returns the number of FeedItems where 'read' is false. If the 'display
* only episodes' - preference is set to true, this method will only count
* items with episodes.
diff --git a/src/de/danoeh/antennapod/feed/FeedManager.java b/src/de/danoeh/antennapod/feed/FeedManager.java
index 40774e592..2aab5c5de 100644
--- a/src/de/danoeh/antennapod/feed/FeedManager.java
+++ b/src/de/danoeh/antennapod/feed/FeedManager.java
@@ -329,7 +329,7 @@ public class FeedManager {
public void refreshFeed(Context context, Feed feed) {
requester.downloadFeed(context, new Feed(feed.getDownload_url(),
- new Date()));
+ new Date(), feed.getTitle()));
}
public void addDownloadStatus(final Context context,