Added flag to use Material You Compat on Android 12+

Signed-off-by: Guillermo Villafuerte <gvillafu@comunidad.unam.mx>
This commit is contained in:
Guillermo Villafuerte
2023-12-28 19:23:09 -06:00
parent f984f68b34
commit 706bd38731
8 changed files with 54 additions and 3 deletions
@@ -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, if available</string>
<string name="preference_font">Font</string>
<string name="preference_font_system">System default</string>
<string name="preference_screen_about">About</string>
@@ -22,7 +22,7 @@ internal val Context.dataStore: LauncherDataStore by dataStore(
}
)
internal const val SchemaVersion = 18
internal const val SchemaVersion = 19
internal fun getMigrations(context: Context): List<DataMigration<Settings>> {
return listOf(
@@ -44,5 +44,6 @@ internal fun getMigrations(context: Context): List<DataMigration<Settings>> {
Migration_15_16(),
Migration_16_17(),
Migration_17_18(),
Migration_18_19(),
)
}
@@ -18,6 +18,7 @@ fun createFactorySettings(context: Context): Settings {
.setBlurWallpaperRadius(32)
.setThemeId(UUID(0L, 0L).toString())
.setFont(Settings.AppearanceSettings.Font.Outfit)
.setForceCompatModeSystemColors(false)
.build()
)
.setWeather(
@@ -0,0 +1,12 @@
package de.mm20.launcher2.preferences.migrations
import de.mm20.launcher2.preferences.Settings
class Migration_18_19 : VersionedMigration(18, 19) {
override suspend fun applyMigrations(builder: Settings.Builder): Settings.Builder {
return builder
.setAppearance(builder.appearance.toBuilder()
.setForceCompatModeSystemColors(false)
)
}
}
@@ -90,6 +90,8 @@ message Settings {
// UUID of the selected theme
string theme_id = 12;
uint32 blur_wallpaper_radius = 13;
bool force_compat_mode_system_colors = 14;
}
AppearanceSettings appearance = 2;