Add support for Just Black with Material You

This commit is contained in:
Prathamesh More 2022-05-02 18:24:44 +05:30
parent aa4c20bd8c
commit 02f076de57
5 changed files with 8 additions and 4 deletions

View file

@ -44,12 +44,10 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
generalTheme?.let {
setSummary(it)
it.setOnPreferenceChangeListener { _, newValue ->
val theme = newValue as String
setSummary(it, newValue)
ThemeStore.markChanged(requireContext())
if (VersionUtils.hasNougatMR()) {
requireActivity().setTheme(PreferenceUtil.themeResFromPrefValue(theme))
DynamicShortcutManager(requireContext()).updateDynamicShortcuts()
}
restartActivity()

View file

@ -11,7 +11,8 @@ import code.name.monkey.retromusic.util.theme.ThemeMode.*
@StyleRes
fun Context.getThemeResValue(): Int =
if (PreferenceUtil.materialYou) {
R.style.Theme_RetroMusic_MD3
if (generalThemeValue == BLACK) R.style.Theme_RetroMusic_MD3_Black
else R.style.Theme_RetroMusic_MD3
} else {
when (generalThemeValue) {
LIGHT -> R.style.Theme_RetroMusic_Light