diff options
author | Martin Fietz <marf@hadiko-99-4.hadiko.uni-karlsruhe.de> | 2015-05-08 16:02:02 +0200 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2015-05-19 11:58:37 +0200 |
commit | 6f5d23c55743bd98800148c943880ce00d04441a (patch) | |
tree | 8ef9f5115d47bfba8173b9834475bdf61c7efc10 /app/src/main/java/de/danoeh/antennapod/adapter | |
parent | 406dab0a24543f4332b338f64689948cdc96c3bc (diff) | |
download | AntennaPod-6f5d23c55743bd98800148c943880ce00d04441a.zip |
Order feeds by number of unread items (descending)
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/adapter')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java index 6cde97148..818f662cd 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -27,7 +27,6 @@ import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.fragment.AddFeedFragment; import de.danoeh.antennapod.fragment.AllEpisodesFragment; import de.danoeh.antennapod.fragment.DownloadsFragment; @@ -266,12 +265,13 @@ public class NavListAdapter extends BaseAdapter holder.title.setText(feed.getTitle()); - int feedUnreadItems = DBReader.getNumberOfUnreadItems(context, feed.getId()); + if(feed.hasLastUpdateFailed()) { holder.failure.setVisibility(View.VISIBLE); } else { holder.failure.setVisibility(View.GONE); } + int feedUnreadItems = itemAccess.getNumberOfUnreadFeedItems(feed.getId()); if(feedUnreadItems > 0) { holder.count.setVisibility(View.VISIBLE); holder.count.setText(String.valueOf(feedUnreadItems)); @@ -301,6 +301,7 @@ public class NavListAdapter extends BaseAdapter int getSelectedItemIndex(); int getQueueSize(); int getNumberOfUnreadItems(); + int getNumberOfUnreadFeedItems(long feedId); } } |