From bfad3195adc858c71d8e80e1286404dbe901f9d9 Mon Sep 17 00:00:00 2001 From: Harry Bond Date: Mon, 16 Dec 2024 22:15:21 +0000 Subject: [PATCH] dfdfg --- .../java/app/organicmaps/util/Config.java | 31 +++---------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/android/app/src/main/java/app/organicmaps/util/Config.java b/android/app/src/main/java/app/organicmaps/util/Config.java index b2c021fc03..23ac69d341 100644 --- a/android/app/src/main/java/app/organicmaps/util/Config.java +++ b/android/app/src/main/java/app/organicmaps/util/Config.java @@ -255,13 +255,13 @@ public final class Config @NonNull public static String getUiThemeSettings(@NonNull Context context) { - String defaultTheme = MwmApplication.from(context).getString(R.string.theme_default); - String res = getString(KEY_MISC_UI_THEME, defaultTheme); - - if (ThemeUtils.isValidTheme(context, res)) + // Fallback & default theme + String fallbackTheme = MwmApplication.from(context).getString(R.string.theme_follow_system); + String res = getString(KEY_MISC_UI_THEME, fallbackTheme); + if (ThemeUtils.isValidTheme(context, res) || ThemeUtils.isValidThemeMode(context, res)) return res; - return defaultTheme; + return fallbackTheme; } public static boolean setUiThemeSettings(@NonNull Context context, @NonNull String theme) @@ -273,27 +273,6 @@ public final class Config return true; } -// @NonNull -// public static String getUiThemeSettings(@NonNull Context context) -// { -// // Fallback & default theme -// String fallbackTheme = MwmApplication.from(context).getString(R.string.theme_follow_system); -// String res = getString(KEY_MISC_UI_THEME_SETTINGS, fallbackTheme); -// if (ThemeUtils.isValidTheme(context, res) || ThemeUtils.isValidThemeMode(context, res)) -// return res; -// -// return fallbackTheme; -// } -// -// public static boolean setUiThemeSettings(@NonNull Context context, String theme) -// { -// if (getUiThemeSettings(context).equals(theme)) -// return false; -// -// setString(KEY_MISC_UI_THEME_SETTINGS, theme); -// return true; -// } - public static boolean isLargeFontsSize() { return nativeGetLargeFontsSize();