summaryrefslogtreecommitdiff
path: root/storage/preferences
diff options
context:
space:
mode:
authorGitStart <1501599+gitstart@users.noreply.github.com>2023-02-28 23:41:15 +0300
committerGitHub <noreply@github.com>2023-02-28 21:41:15 +0100
commit581e71b306bbc28dc504bde1d1bba6d6121e26e1 (patch)
tree9c559a79a01cf8345719af7e9848ff2ff8c564fa /storage/preferences
parentccea00e4056b85d5be0ebfa898a1ac961c2e3c56 (diff)
downloadAntennaPod-581e71b306bbc28dc504bde1d1bba6d6121e26e1.zip
Add option to switch a- & descending sort order for Inbox (#6266)
Diffstat (limited to 'storage/preferences')
-rw-r--r--storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java13
1 files changed, 10 insertions, 3 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 93792121b..92acb6319 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
@@ -70,6 +70,7 @@ public class UserPreferences {
public static final String PREF_QUEUE_KEEP_SORTED_ORDER = "prefQueueKeepSortedOrder";
public static final String PREF_NEW_EPISODES_ACTION = "prefNewEpisodesAction";
private static final String PREF_DOWNLOADS_SORTED_ORDER = "prefDownloadSortedOrder";
+ private static final String PREF_INBOX_SORTED_ORDER = "prefInboxSortedOrder";
// Playback
public static final String PREF_PAUSE_ON_HEADSET_DISCONNECT = "prefPauseOnHeadsetDisconnect";
@@ -942,12 +943,18 @@ public class UserPreferences {
* Sets the sort order for the downloads.
*/
public static void setDownloadsSortedOrder(SortOrder sortOrder) {
- if (sortOrder == null) {
- return;
- }
prefs.edit().putString(PREF_DOWNLOADS_SORTED_ORDER, "" + sortOrder.code).apply();
}
+ public static SortOrder getInboxSortedOrder() {
+ String sortOrderStr = prefs.getString(PREF_INBOX_SORTED_ORDER, "" + SortOrder.DATE_NEW_OLD.code);
+ return SortOrder.fromCodeString(sortOrderStr);
+ }
+
+ public static void setInboxSortedOrder(SortOrder sortOrder) {
+ prefs.edit().putString(PREF_INBOX_SORTED_ORDER, "" + sortOrder.code).apply();
+ }
+
public static SubscriptionsFilter getSubscriptionsFilter() {
String value = prefs.getString(PREF_FILTER_FEED, "");
return new SubscriptionsFilter(value);