Merge pull request #652 from strongville/feat/materialYouCompat
Use Material You Compat on Android 12+ if flag is enabled
This commit is contained in:
@@ -447,6 +447,8 @@
|
||||
<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_dark">Dark color scheme</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</string>
|
||||
<string name="preference_font">Font</string>
|
||||
<string name="preference_font_system">System default</string>
|
||||
<string name="preference_screen_about">About</string>
|
||||
|
||||
@@ -11,6 +11,7 @@ data class LauncherSettingsData(
|
||||
|
||||
val uiColorScheme: ColorScheme = ColorScheme.System,
|
||||
val uiTheme: ThemeDescriptor = ThemeDescriptor.Default,
|
||||
val uiCompatModeColors: Boolean = false,
|
||||
val uiFont: Font = Font.Outfit,
|
||||
val uiBaseLayout: BaseLayout = BaseLayout.PullDown,
|
||||
val uiOrientation: ScreenOrientation = ScreenOrientation.Auto,
|
||||
|
||||
@@ -144,6 +144,17 @@ class UiSettings internal constructor(
|
||||
it.uiColorScheme
|
||||
}.distinctUntilChanged()
|
||||
|
||||
val compatModeColors
|
||||
get() = launcherDataStore.data.map {
|
||||
it.uiCompatModeColors
|
||||
}.distinctUntilChanged()
|
||||
|
||||
fun setCompatModeColors(enabled: Boolean) {
|
||||
launcherDataStore.update {
|
||||
it.copy(uiCompatModeColors = enabled)
|
||||
}
|
||||
}
|
||||
|
||||
val statusBarColor
|
||||
get() = launcherDataStore.data.map {
|
||||
it.systemBarsStatusColors
|
||||
|
||||
Reference in New Issue
Block a user