Change MDY compat preference
This commit is contained in:
parent
f037a72379
commit
faf6567c83
@ -28,6 +28,7 @@ fun AppearanceSettingsScreen() {
|
|||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val navController = LocalNavController.current
|
val navController = LocalNavController.current
|
||||||
val themeName by viewModel.themeName.collectAsStateWithLifecycle(null)
|
val themeName by viewModel.themeName.collectAsStateWithLifecycle(null)
|
||||||
|
val compatModeColors by viewModel.compatModeColors.collectAsState()
|
||||||
PreferenceScreen(title = stringResource(id = R.string.preference_screen_appearance)) {
|
PreferenceScreen(title = stringResource(id = R.string.preference_screen_appearance)) {
|
||||||
item {
|
item {
|
||||||
PreferenceCategory {
|
PreferenceCategory {
|
||||||
@ -52,17 +53,6 @@ fun AppearanceSettingsScreen() {
|
|||||||
navController?.navigate("settings/appearance/themes")
|
navController?.navigate("settings/appearance/themes")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (isAtLeastApiLevel(31)) {
|
|
||||||
val compatModeColors by viewModel.compatModeColors.collectAsState()
|
|
||||||
SwitchPreference(
|
|
||||||
title = stringResource(id = R.string.preference_force_compat_system_colors),
|
|
||||||
summary = stringResource(id = R.string.preference_force_compat_system_colors_summary),
|
|
||||||
value = compatModeColors,
|
|
||||||
onValueChanged = {
|
|
||||||
viewModel.setCompatModeColors(it)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
val font by viewModel.font.collectAsState()
|
val font by viewModel.font.collectAsState()
|
||||||
ListPreference(
|
ListPreference(
|
||||||
title = stringResource(R.string.preference_font),
|
title = stringResource(R.string.preference_font),
|
||||||
@ -91,5 +81,23 @@ fun AppearanceSettingsScreen() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isAtLeastApiLevel(31)) {
|
||||||
|
item {
|
||||||
|
PreferenceCategory(stringResource(R.string.preference_category_advanced)) {
|
||||||
|
ListPreference(
|
||||||
|
title = stringResource(R.string.preference_mdy_color_sorce),
|
||||||
|
items = listOf(
|
||||||
|
stringResource(R.string.preference_mdy_color_sorce_system) to false,
|
||||||
|
stringResource(R.string.preference_mdy_color_sorce_wallpaper) to true,
|
||||||
|
),
|
||||||
|
value = compatModeColors,
|
||||||
|
onValueChanged = {
|
||||||
|
viewModel.setCompatModeColors(it)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -447,14 +447,16 @@
|
|||||||
<string name="preference_colors_auto_generate">Generate from primary color</string>
|
<string name="preference_colors_auto_generate">Generate from primary color</string>
|
||||||
<string name="preference_category_custom_colors_light">Light color scheme</string>
|
<string name="preference_category_custom_colors_light">Light color scheme</string>
|
||||||
<string name="preference_category_custom_colors_dark">Dark color scheme</string>
|
<string name="preference_category_custom_colors_dark">Dark color scheme</string>
|
||||||
<string name="preference_force_compat_system_colors">Ignore system colors</string>
|
<string name="preference_mdy_color_sorce">Source for dynamic colors</string>
|
||||||
<string name="preference_force_compat_system_colors_summary">Request color scheme via Material You Compat</string>
|
<string name="preference_mdy_color_sorce_system">System</string>
|
||||||
|
<string name="preference_mdy_color_sorce_wallpaper">Wallpaper</string>
|
||||||
<string name="preference_font">Font</string>
|
<string name="preference_font">Font</string>
|
||||||
<string name="preference_font_system">System default</string>
|
<string name="preference_font_system">System default</string>
|
||||||
<string name="preference_screen_about">About</string>
|
<string name="preference_screen_about">About</string>
|
||||||
<string name="preference_version">Version</string>
|
<string name="preference_version">Version</string>
|
||||||
<string name="preference_category_links">Links</string>
|
<string name="preference_category_links">Links</string>
|
||||||
<string name="preference_category_licenses">Open source licenses</string>
|
<string name="preference_category_licenses">Open source licenses</string>
|
||||||
|
<string name="preference_category_advanced">Advanced</string>
|
||||||
<!-- Open website of an open source library -->
|
<!-- Open website of an open source library -->
|
||||||
<string name="open_webpage">Open website</string>
|
<string name="open_webpage">Open website</string>
|
||||||
<string name="preference_screen_about_summary">App and license information</string>
|
<string name="preference_screen_about_summary">App and license information</string>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user