diff options
author | Tony Tam <149837+tonytamsf@users.noreply.github.com> | 2021-02-14 03:18:27 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-14 12:18:27 +0100 |
commit | f57cf0c31788962300413a97eefdf746476e2177 (patch) | |
tree | f31175de54e92a709ae04e15f9ac54bf531febe5 /core | |
parent | cca5a8a624f0d3529c99975f2440321a3b8872f4 (diff) | |
download | AntennaPod-f57cf0c31788962300413a97eefdf746476e2177.zip |
New preference to show the remaining time in the 'queue' and podcast episode view (#4880)
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java | 18 | ||||
-rw-r--r-- | core/src/main/res/values/strings.xml | 2 |
2 files changed, 20 insertions, 0 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 807348896..cbfe28ded 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 @@ -62,6 +62,7 @@ public class UserPreferences { private static final String PREF_DRAWER_FEED_COUNTER = "prefDrawerFeedIndicator"; public static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; public static final String PREF_USE_EPISODE_COVER = "prefEpisodeCover"; + public static final String PREF_SHOW_TIME_LEFT = "showTimeLeft"; private static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify"; public static final String PREF_COMPACT_NOTIFICATION_BUTTONS = "prefCompactNotificationButtons"; public static final String PREF_LOCKSCREEN_BACKGROUND = "prefLockscreenBackground"; @@ -268,6 +269,23 @@ public class UserPreferences { } /** + * @return {@code true} if we should show remaining time or the duration + */ + public static boolean shouldShowRemainingTime() { + return prefs.getBoolean(PREF_SHOW_TIME_LEFT, false); + } + + /** + * Sets the preference for whether we show the remain time, if not show the duration. This will + * send out events so the current playing screen, queue and the episode list would refresh + * + * @return {@code true} if we should show remaining time or the duration + */ + public static void setShowRemainTimeSetting(Boolean showRemain) { + prefs.edit().putBoolean(PREF_SHOW_TIME_LEFT, showRemain).apply(); + } + + /** * Returns notification priority. * * @return NotificationCompat.PRIORITY_MAX or NotificationCompat.PRIORITY_DEFAULT diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 91ec75782..fc080d71f 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -458,6 +458,8 @@ <string name="pref_episode_cache_summary">Total number of downloaded episodes cached on the device. Automatic download will be suspended if this number is reached.</string> <string name="pref_episode_cover_title">Use Episode Cover</string> <string name="pref_episode_cover_summary">Use the episode specific cover whenever available. If unchecked, the app will always use the podcast cover image.</string> + <string name="pref_show_remain_time_title">Show Remaining Time</string> + <string name="pref_show_remain_time_summary">Display remaining time of episodes when checked. If unchecked, display total duration of episodes.</string> <string name="pref_theme_title_use_system">Use system theme</string> <string name="pref_theme_title_light">Light</string> <string name="pref_theme_title_dark">Dark</string> |