diff options
author | mueller-ma <mueller-ma@users.noreply.github.com> | 2024-02-25 15:02:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 15:02:44 +0100 |
commit | 9cfbae183cd1b5e1bb1fed68125ab064d5be7c55 (patch) | |
tree | fe6dd49c414e8f8e7507a4a879ce8312f00a02fe /storage/preferences | |
parent | 82c93bf7ee3d91395533068fdfe640dfa53113fe (diff) | |
download | AntennaPod-9cfbae183cd1b5e1bb1fed68125ab064d5be7c55.zip |
Toggle sleep timer from notification (#6913)
Diffstat (limited to 'storage/preferences')
-rw-r--r-- | storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java | 21 |
1 files changed, 14 insertions, 7 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 b454ee5a1..2e38d55f1 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 @@ -6,17 +6,13 @@ import android.os.Build; import android.text.TextUtils; import android.util.Log; import android.view.KeyEvent; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.core.app.NotificationCompat; import androidx.preference.PreferenceManager; -import de.danoeh.antennapod.model.download.ProxyConfig; -import de.danoeh.antennapod.model.feed.FeedCounter; -import de.danoeh.antennapod.model.feed.FeedPreferences; -import de.danoeh.antennapod.model.feed.SortOrder; -import de.danoeh.antennapod.model.feed.SubscriptionsFilter; -import de.danoeh.antennapod.model.playback.MediaType; + import org.json.JSONArray; import org.json.JSONException; @@ -32,6 +28,13 @@ import java.util.List; import java.util.Locale; import java.util.Set; +import de.danoeh.antennapod.model.download.ProxyConfig; +import de.danoeh.antennapod.model.feed.FeedCounter; +import de.danoeh.antennapod.model.feed.FeedPreferences; +import de.danoeh.antennapod.model.feed.SortOrder; +import de.danoeh.antennapod.model.feed.SubscriptionsFilter; +import de.danoeh.antennapod.model.playback.MediaType; + /** * Provides access to preferences set by the user in the settings screen. A * private instance of this class must first be instantiated via @@ -130,9 +133,9 @@ public class UserPreferences { public static final int NOTIFICATION_BUTTON_REWIND = 0; public static final int NOTIFICATION_BUTTON_FAST_FORWARD = 1; public static final int NOTIFICATION_BUTTON_SKIP = 2; - public static final int NOTIFICATION_BUTTON_NEXT_CHAPTER = 3; 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; @@ -235,6 +238,10 @@ public class UserPreferences { return showButtonOnFullNotification(NOTIFICATION_BUTTON_PLAYBACK_SPEED); } + public static boolean showSleepTimerOnFullNotification() { + 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); |