Applying Dynamic colors immediately on MD3 preference changed
This commit is contained in:
parent
03b9e36014
commit
9cf787bc04
1 changed files with 2 additions and 0 deletions
|
@ -30,6 +30,7 @@ import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
import com.afollestad.materialdialogs.color.colorChooser
|
import com.afollestad.materialdialogs.color.colorChooser
|
||||||
|
import com.google.android.material.color.DynamicColors
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Hemanth S (h4h13).
|
* @author Hemanth S (h4h13).
|
||||||
|
@ -114,6 +115,7 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
|
||||||
|
|
||||||
val materialYou: ATESwitchPreference? = findPreference(MATERIAL_YOU)
|
val materialYou: ATESwitchPreference? = findPreference(MATERIAL_YOU)
|
||||||
materialYou?.setOnPreferenceChangeListener { _, _ ->
|
materialYou?.setOnPreferenceChangeListener { _, _ ->
|
||||||
|
DynamicColors.applyToActivitiesIfAvailable(App.getContext())
|
||||||
restartActivity()
|
restartActivity()
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue