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 6d8eb90a35..dc2ab12919 100644 --- a/android/app/src/main/java/app/organicmaps/util/Config.java +++ b/android/app/src/main/java/app/organicmaps/util/Config.java @@ -276,12 +276,13 @@ public final class Config @NonNull public static String getUiThemeSettings(@NonNull Context context) { - String followSystemTheme = MwmApplication.from(context).getString(R.string.theme_follow_system); - String res = getString(KEY_MISC_UI_THEME_SETTINGS, followSystemTheme); + // 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 followSystemTheme; + return fallbackTheme; } public static boolean setUiThemeSettings(@NonNull Context context, String theme) diff --git a/android/app/src/main/java/app/organicmaps/util/ThemeSwitcher.java b/android/app/src/main/java/app/organicmaps/util/ThemeSwitcher.java index 997134beb7..fb6d2fe968 100644 --- a/android/app/src/main/java/app/organicmaps/util/ThemeSwitcher.java +++ b/android/app/src/main/java/app/organicmaps/util/ThemeSwitcher.java @@ -84,6 +84,10 @@ public enum ThemeSwitcher { if (ThemeUtils.isFollowSystemTheme(mContext, theme)) AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); + else if (ThemeUtils.isAutoTheme(mContext, theme)) //TODO: Proper behaviour + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + else if (ThemeUtils.isNavAutoTheme(mContext, theme)) //TODO: Proper behaviour + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); else if (ThemeUtils.isNightTheme(mContext, theme)) AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); else if (ThemeUtils.isDefaultTheme(mContext, theme)) @@ -103,7 +107,7 @@ public enum ThemeSwitcher else style = Framework.MAP_STYLE_DARK; } - else + else//TODO: and here? { if (RoutingController.get().isVehicleNavigation()) style = Framework.MAP_STYLE_VEHICLE_CLEAR;