diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index 339144ff5..6117e1e31 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -152,12 +152,14 @@ open class FenixApplication : Application() { AppCompatDelegate.MODE_NIGHT_YES ) } - Settings.getInstance(this).shouldUseAutoBatteryTheme -> { + android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.P && + Settings.getInstance(this).shouldUseAutoBatteryTheme -> { AppCompatDelegate.setDefaultNightMode( AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY ) } - Settings.getInstance(this).shouldFollowDeviceTheme -> { + android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P && + Settings.getInstance(this).shouldFollowDeviceTheme -> { AppCompatDelegate.setDefaultNightMode( AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM ) diff --git a/app/src/main/java/org/mozilla/fenix/settings/ThemeFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/ThemeFragment.kt index 805e3ebdc..9bee3a158 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/ThemeFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/ThemeFragment.kt @@ -42,22 +42,21 @@ class ThemeFragment : PreferenceFragmentCompat() { private fun setupRadioGroups() { radioLightTheme.addToRadioGroup(radioDarkTheme) - radioLightTheme.addToRadioGroup(radioAutoBatteryTheme) radioDarkTheme.addToRadioGroup(radioLightTheme) - radioDarkTheme.addToRadioGroup(radioAutoBatteryTheme) - - radioAutoBatteryTheme.addToRadioGroup(radioLightTheme) - radioAutoBatteryTheme.addToRadioGroup(radioDarkTheme) if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) { radioLightTheme.addToRadioGroup(radioFollowDeviceTheme) radioDarkTheme.addToRadioGroup(radioFollowDeviceTheme) - radioAutoBatteryTheme.addToRadioGroup(radioFollowDeviceTheme) radioFollowDeviceTheme.addToRadioGroup(radioDarkTheme) radioFollowDeviceTheme.addToRadioGroup(radioLightTheme) - radioFollowDeviceTheme.addToRadioGroup(radioAutoBatteryTheme) + } else { + radioLightTheme.addToRadioGroup(radioAutoBatteryTheme) + radioDarkTheme.addToRadioGroup(radioAutoBatteryTheme) + + radioAutoBatteryTheme.addToRadioGroup(radioLightTheme) + radioAutoBatteryTheme.addToRadioGroup(radioDarkTheme) } } diff --git a/app/src/main/res/values-v28/bools.xml b/app/src/main/res/values-v28/bools.xml index abc07ff3d..ab7ce423d 100644 --- a/app/src/main/res/values-v28/bools.xml +++ b/app/src/main/res/values-v28/bools.xml @@ -4,4 +4,5 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> true + false diff --git a/app/src/main/res/values/bools.xml b/app/src/main/res/values/bools.xml index 8aaae0c77..91d4bf572 100644 --- a/app/src/main/res/values/bools.xml +++ b/app/src/main/res/values/bools.xml @@ -5,4 +5,5 @@ true false + true diff --git a/app/src/main/res/xml/theme_preferences.xml b/app/src/main/res/xml/theme_preferences.xml index 404e4d8aa..f73850359 100644 --- a/app/src/main/res/xml/theme_preferences.xml +++ b/app/src/main/res/xml/theme_preferences.xml @@ -18,7 +18,8 @@ + android:title="@string/preference_auto_battery_theme" + app:isPreferenceVisible="@bool/underAPI28" />