Applying Dynamic colors immediately on MD3 preference changed
This commit is contained in:
parent
407cbb1020
commit
92b4a2fb57
1 changed files with 4 additions and 2 deletions
|
@ -114,8 +114,10 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
|
|||
}
|
||||
|
||||
val materialYou: ATESwitchPreference? = findPreference(MATERIAL_YOU)
|
||||
materialYou?.setOnPreferenceChangeListener { _, _ ->
|
||||
DynamicColors.applyToActivitiesIfAvailable(App.getContext())
|
||||
materialYou?.setOnPreferenceChangeListener { _, newValue ->
|
||||
if (newValue as Boolean) {
|
||||
DynamicColors.applyToActivitiesIfAvailable(App.getContext())
|
||||
}
|
||||
restartActivity()
|
||||
true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue