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)
|
val materialYou: ATESwitchPreference? = findPreference(MATERIAL_YOU)
|
||||||
materialYou?.setOnPreferenceChangeListener { _, _ ->
|
materialYou?.setOnPreferenceChangeListener { _, newValue ->
|
||||||
DynamicColors.applyToActivitiesIfAvailable(App.getContext())
|
if (newValue as Boolean) {
|
||||||
|
DynamicColors.applyToActivitiesIfAvailable(App.getContext())
|
||||||
|
}
|
||||||
restartActivity()
|
restartActivity()
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue