diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2015-08-17 21:08:37 +0200 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2015-08-17 21:10:11 +0200 |
commit | f9130671c0a3732aa8a06decbbb3f1dc33564365 (patch) | |
tree | d03cdf73d9cd2ba5ca10445f182556c27a479f5c | |
parent | fd2633e42fde048c385c09bc442c19a62038a63c (diff) | |
download | AntennaPod-f9130671c0a3732aa8a06decbbb3f1dc33564365.zip |
Read feed counter setting correctly
3 files changed, 9 insertions, 9 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index d56829c70..08328536d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -44,7 +44,7 @@ public class UserPreferences { public static final String PREF_THEME = "prefTheme"; public static final String PREF_HIDDEN_DRAWER_ITEMS = "prefHiddenDrawerItems"; public static final String PREF_DRAWER_FEED_ORDER = "prefDrawerFeedOrder"; - public static final String PREF_DRAWER_FEED_COUNTER = "prefDrawerFeedCounter"; + public static final String PREF_DRAWER_FEED_COUNTER = "prefDrawerFeedIndicator"; public static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; public static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify"; public static final String PREF_SHOW_DOWNLOAD_REPORT = "prefShowDownloadReport"; @@ -90,7 +90,7 @@ public class UserPreferences { // Constants private static int EPISODE_CACHE_SIZE_UNLIMITED = -1; - public static int FEED_ORDER_UNPLAYED_EPISODES = 0; + public static int FEED_ORDER_COUNTER = 0; public static int FEED_ORDER_ALPHABETICAL = 1; public static int FEED_COUNTER_SHOW_NEW_UNPLAYED_SUM = 0; public static int FEED_COUNTER_SHOW_NEW = 1; @@ -144,7 +144,7 @@ public class UserPreferences { return Integer.valueOf(value); } - public static int getFeedCounter() { + public static int getFeedCounterSetting() { String value = prefs.getString(PREF_DRAWER_FEED_COUNTER, "0"); return Integer.valueOf(value); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index 5ed0a6ee3..2ae88cc02 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -1141,7 +1141,7 @@ public final class DBReader { Comparator<Feed> comparator; int feedOrder = UserPreferences.getFeedOrder(); - if(feedOrder == UserPreferences.FEED_ORDER_UNPLAYED_EPISODES) { + if(feedOrder == UserPreferences.FEED_ORDER_COUNTER) { comparator = new Comparator<Feed>() { @Override public int compare(Feed lhs, Feed rhs) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index edb7598ab..3bfcaa539 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -1301,16 +1301,16 @@ public class PodDBAdapter { } public final LongIntMap getFeedCounters(long... feedIds) { - int counter = UserPreferences.getFeedCounter(); + int setting = UserPreferences.getFeedCounterSetting(); String whereRead; - if(counter == UserPreferences.FEED_COUNTER_SHOW_NEW_UNPLAYED_SUM) { + if(setting == UserPreferences.FEED_COUNTER_SHOW_NEW_UNPLAYED_SUM) { whereRead = "(" + KEY_READ + "=" + FeedItem.NEW + " OR " + KEY_READ + "=" + FeedItem.UNPLAYED + ")"; - } else if(counter == UserPreferences.FEED_COUNTER_SHOW_NEW) { + } else if(setting == UserPreferences.FEED_COUNTER_SHOW_NEW) { whereRead = KEY_READ + "=" + FeedItem.NEW; - } else if(counter == UserPreferences.FEED_COUNTER_SHOW_UNPLAYED) { + } else if(setting == UserPreferences.FEED_COUNTER_SHOW_UNPLAYED) { whereRead = KEY_READ + "=" + FeedItem.UNPLAYED; - } else { + } else { // NONE return new LongIntMap(0); } |