diff options
author | Tony Tam <149837+tonytamsf@users.noreply.github.com> | 2023-11-17 13:33:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-17 22:33:16 +0100 |
commit | c7d6cd358cb9c7c14a92dc3b35eabf8695d35999 (patch) | |
tree | 6950d96092149334eb506705bfd7b86d25ac41fa /storage/preferences | |
parent | 0bb4870820cfe279e56f02d453c532ebb5074d6a (diff) | |
download | AntennaPod-c7d6cd358cb9c7c14a92dc3b35eabf8695d35999.zip |
Honor sort in episode list view in Android Auto (#6756)
Diffstat (limited to 'storage/preferences')
-rw-r--r-- | storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java | 21 |
1 files changed, 21 insertions, 0 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 80a58525d..7b15584ba 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 @@ -67,6 +67,10 @@ public class UserPreferences { private static final String PREF_DOWNLOADS_SORTED_ORDER = "prefDownloadSortedOrder"; private static final String PREF_INBOX_SORTED_ORDER = "prefInboxSortedOrder"; + // Episode + public static final String PREF_SORT_ALL_EPISODES = "prefEpisodesSort"; + public static final String PREF_FILTER_ALL_EPISODES = "prefEpisodesFilter"; + // Playback public static final String PREF_PAUSE_ON_HEADSET_DISCONNECT = "prefPauseOnHeadsetDisconnect"; public static final String PREF_UNPAUSE_ON_HEADSET_RECONNECT = "prefUnpauseOnHeadsetReconnect"; @@ -867,4 +871,21 @@ public class UserPreferences { public static boolean shouldShowSubscriptionTitle() { return prefs.getBoolean(PREF_SUBSCRIPTION_TITLE, false); } + + public static void setAllEpisodesSortOrder(SortOrder s) { + prefs.edit().putString(PREF_SORT_ALL_EPISODES, "" + s.code).apply(); + } + + public static SortOrder getAllEpisodesSortOrder() { + return SortOrder.fromCodeString(prefs.getString(PREF_SORT_ALL_EPISODES, + "" + SortOrder.DATE_NEW_OLD.code)); + } + + public static String getPrefFilterAllEpisodes() { + return prefs.getString(PREF_FILTER_ALL_EPISODES, ""); + } + + public static void setPrefFilterAllEpisodes(String filter) { + prefs.edit().putString(PREF_FILTER_ALL_EPISODES, filter).apply(); + } } |