From 863f07cbe4458e96098430d7ebad99dcd6a16569 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Sat, 17 Oct 2020 16:50:43 +0200 Subject: [PATCH] Fix changing inactive theme Bug introduced in commit 65716c0ee8838744cee86c87f1080071125297e0. Fixes: - Change inactive theme - Switch to inactive theme -> still the old theme setting Change-Id: I1b56144ffdb5e0f33efa67702e8aa05065285488 --- .../features/settings/VectorSettingsPreferencesFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt index 2ead087ace..5f86626df4 100644 --- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt @@ -56,8 +56,8 @@ class VectorSettingsPreferencesFragment @Inject constructor( val darkThemePref = findPreference(ThemeUtils.APPLICATION_DARK_THEME_KEY)!! lightThemePref.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue -> if (newValue is String) { + ThemeUtils.setApplicationLightTheme(requireContext().applicationContext, newValue) if (!ThemeUtils.shouldUseDarkTheme(requireContext())) { - ThemeUtils.setApplicationLightTheme(requireContext().applicationContext, newValue) // Restart the Activity activity?.restart() } @@ -70,8 +70,8 @@ class VectorSettingsPreferencesFragment @Inject constructor( lightThemePref.title = getString(R.string.settings_light_theme) darkThemePref.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue -> if (newValue is String) { + ThemeUtils.setApplicationDarkTheme(requireContext().applicationContext, newValue) if (ThemeUtils.shouldUseDarkTheme(requireContext())) { - ThemeUtils.setApplicationDarkTheme(requireContext().applicationContext, newValue) // Restart the Activity activity?.restart() }