summaryrefslogtreecommitdiff
path: root/storage/preferences
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-03-25 21:45:43 +0100
committerGitHub <noreply@github.com>2024-03-25 21:45:43 +0100
commit69b24699a36bc9c4ffc6200fbcf8069f7a94c1ab (patch)
tree5bfb94e00ff3d296412bc2624fbb43fc455d1471 /storage/preferences
parent15eab50223e7789c15e40f956ee1ba166209b11d (diff)
downloadAntennaPod-69b24699a36bc9c4ffc6200fbcf8069f7a94c1ab.zip
Move DBReader to :storage:database (#7027)
Diffstat (limited to 'storage/preferences')
-rw-r--r--storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java b/storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java
index 42bdd5cf0..7714337a3 100644
--- a/storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java
+++ b/storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java
@@ -13,6 +13,7 @@ import androidx.annotation.VisibleForTesting;
import androidx.core.app.NotificationCompat;
import androidx.preference.PreferenceManager;
+import de.danoeh.antennapod.model.feed.FeedOrder;
import org.json.JSONArray;
import org.json.JSONException;
@@ -134,9 +135,6 @@ public class UserPreferences {
public static final int NOTIFICATION_BUTTON_PLAYBACK_SPEED = 4;
public static final int NOTIFICATION_BUTTON_SLEEP_TIMER = 5;
public static final int EPISODE_CACHE_SIZE_UNLIMITED = -1;
- public static final int FEED_ORDER_COUNTER = 0;
- public static final int FEED_ORDER_ALPHABETICAL = 1;
- public static final int FEED_ORDER_MOST_PLAYED = 3;
public static final String DEFAULT_PAGE_REMEMBER = "remember";
private static Context context;
@@ -239,15 +237,13 @@ public class UserPreferences {
return showButtonOnFullNotification(NOTIFICATION_BUTTON_SLEEP_TIMER);
}
- public static int getFeedOrder() {
- String value = prefs.getString(PREF_DRAWER_FEED_ORDER, "" + FEED_ORDER_COUNTER);
- return Integer.parseInt(value);
+ public static FeedOrder getFeedOrder() {
+ String value = prefs.getString(PREF_DRAWER_FEED_ORDER, "" + FeedOrder.COUNTER.id);
+ return FeedOrder.fromOrdinal(Integer.parseInt(value));
}
- public static void setFeedOrder(String selected) {
- prefs.edit()
- .putString(PREF_DRAWER_FEED_ORDER, selected)
- .apply();
+ public static void setFeedOrder(FeedOrder feedOrder) {
+ prefs.edit().putString(PREF_DRAWER_FEED_ORDER, "" + feedOrder.id).apply();
}
public static FeedCounter getFeedCounterSetting() {