FIX: The flag for ignore system colors appeared on API versions below 31
Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx>
This commit is contained in:
parent
706bd38731
commit
01fe899c0c
@ -9,6 +9,7 @@ import androidx.compose.ui.platform.LocalContext
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
|
import de.mm20.launcher2.ktx.isAtLeastApiLevel
|
||||||
import de.mm20.launcher2.preferences.Settings.AppearanceSettings
|
import de.mm20.launcher2.preferences.Settings.AppearanceSettings
|
||||||
import de.mm20.launcher2.preferences.Settings.AppearanceSettings.ColorScheme
|
import de.mm20.launcher2.preferences.Settings.AppearanceSettings.ColorScheme
|
||||||
import de.mm20.launcher2.preferences.Settings.AppearanceSettings.Theme
|
import de.mm20.launcher2.preferences.Settings.AppearanceSettings.Theme
|
||||||
@ -52,15 +53,17 @@ fun AppearanceSettingsScreen() {
|
|||||||
navController?.navigate("settings/appearance/themes")
|
navController?.navigate("settings/appearance/themes")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
val compatMode by viewModel.compatMode.collectAsState()
|
if (isAtLeastApiLevel(31)) {
|
||||||
SwitchPreference(
|
val compatMode by viewModel.compatMode.collectAsState()
|
||||||
title = stringResource(id = R.string.preference_force_compat_system_colors),
|
SwitchPreference(
|
||||||
summary = stringResource(id = R.string.preference_force_compat_system_colors_summary),
|
title = stringResource(id = R.string.preference_force_compat_system_colors),
|
||||||
value = compatMode,
|
summary = stringResource(id = R.string.preference_force_compat_system_colors_summary),
|
||||||
onValueChanged = {
|
value = compatMode,
|
||||||
viewModel.setCompatMode(it)
|
onValueChanged = {
|
||||||
}
|
viewModel.setCompatMode(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),
|
||||||
|
|||||||
@ -448,7 +448,7 @@
|
|||||||
<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_force_compat_system_colors">Ignore system colors</string>
|
||||||
<string name="preference_force_compat_system_colors_summary">Request color scheme via Material You Compat, if available</string>
|
<string name="preference_force_compat_system_colors_summary">Request color scheme via Material You Compat</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>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user