Add preference to adjust wallpaper blur radius

This commit is contained in:
MM20
2023-09-30 14:49:35 +02:00
parent 8fb83f9729
commit 5a821eaabe
12 changed files with 58 additions and 12 deletions
@@ -532,6 +532,7 @@
<string name="preference_blur_wallpaper">Blur wallpaper</string>
<string name="preference_blur_wallpaper_summary">Use a blur effect on the wallpaper</string>
<string name="preference_blur_wallpaper_unsupported">Not supported on this device</string>
<string name="preference_blur_wallpaper_radius">Blur radius</string>
<string name="preference_wallpaper_summary">Choose a wallpaper</string>
<string name="preference_category_badges">Badges</string>
<string name="preference_screen_badges_summary">Configure icon badges</string>
@@ -22,7 +22,7 @@ internal val Context.dataStore: LauncherDataStore by dataStore(
}
)
internal const val SchemaVersion = 17
internal const val SchemaVersion = 18
internal fun getMigrations(context: Context): List<DataMigration<Settings>> {
return listOf(
@@ -43,5 +43,6 @@ internal fun getMigrations(context: Context): List<DataMigration<Settings>> {
Migration_14_15(),
Migration_15_16(),
Migration_16_17(),
Migration_17_18(),
)
}
@@ -15,6 +15,7 @@ fun createFactorySettings(context: Context): Settings {
.setTheme(Settings.AppearanceSettings.Theme.System)
.setDimWallpaper(false)
.setBlurWallpaper(true)
.setBlurWallpaperRadius(32)
.setThemeId(UUID(0L, 0L).toString())
.setFont(Settings.AppearanceSettings.Font.Outfit)
.build()
@@ -0,0 +1,12 @@
package de.mm20.launcher2.preferences.migrations
import de.mm20.launcher2.preferences.Settings
class Migration_17_18 : VersionedMigration(17, 18) {
override suspend fun applyMigrations(builder: Settings.Builder): Settings.Builder {
return builder
.setAppearance(builder.appearance.toBuilder()
.setBlurWallpaperRadius(32)
)
}
}
@@ -89,6 +89,7 @@ message Settings {
bool blur_wallpaper = 11;
// UUID of the selected theme
string theme_id = 12;
uint32 blur_wallpaper_radius = 13;
}
AppearanceSettings appearance = 2;