diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2023-02-18 14:51:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-18 14:51:55 +0100 |
commit | 997860fe522e67dff087e4184a80fc9656de28d8 (patch) | |
tree | 75387ba9614686b8251950cdd375ed162fc5cbaf /storage/preferences | |
parent | caf49c5da8a2f541b099ff32c15a7e96e1c557e8 (diff) | |
download | AntennaPod-997860fe522e67dff087e4184a80fc9656de28d8.zip |
Extra toggle for full black theme (#6328)
Diffstat (limited to 'storage/preferences')
-rw-r--r-- | storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java | 21 |
1 files changed, 19 insertions, 2 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 8d9b099fc..c7758d40e 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 @@ -48,6 +48,7 @@ public class UserPreferences { // User Interface public static final String PREF_THEME = "prefTheme"; + public static final String PREF_THEME_BLACK = "prefThemeBlack"; public static final String PREF_TINTED_COLORS = "prefTintedColors"; public static final String PREF_HIDDEN_DRAWER_ITEMS = "prefHiddenDrawerItems"; public static final String PREF_DRAWER_FEED_ORDER = "prefDrawerFeedOrder"; @@ -159,19 +160,35 @@ public class UserPreferences { LIGHT, DARK, BLACK, SYSTEM } + public static void setTheme(ThemePreference theme) { + switch (theme) { + case LIGHT: + prefs.edit().putString(PREF_THEME, "0").apply(); + break; + case DARK: + prefs.edit().putString(PREF_THEME, "1").apply(); + break; + default: + prefs.edit().putString(PREF_THEME, "system").apply(); + break; + } + } + public static ThemePreference getTheme() { switch (prefs.getString(PREF_THEME, "system")) { case "0": return ThemePreference.LIGHT; case "1": return ThemePreference.DARK; - case "2": - return ThemePreference.BLACK; default: return ThemePreference.SYSTEM; } } + public static boolean getIsBlackTheme() { + return prefs.getBoolean(PREF_THEME_BLACK, false); + } + public static boolean getIsThemeColorTinted() { return Build.VERSION.SDK_INT >= 31 && prefs.getBoolean(PREF_TINTED_COLORS, false); } |