Add show grid labels and fill clock widget height preferences to proto schema

This commit is contained in:
MM20 2022-09-03 15:07:37 +02:00
parent 694b0e1382
commit bdbbc3760e
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
3 changed files with 22 additions and 1 deletions

View File

@ -22,7 +22,7 @@ internal val Context.dataStore: LauncherDataStore by dataStore(
}
)
internal const val SchemaVersion = 8
internal const val SchemaVersion = 9
internal fun getMigrations(context: Context): List<DataMigration<Settings>> {
return listOf(
@ -34,5 +34,6 @@ internal fun getMigrations(context: Context): List<DataMigration<Settings>> {
Migration_5_6(),
Migration_6_7(),
Migration_7_8(),
Migration_8_9(),
)
}

View File

@ -0,0 +1,18 @@
package de.mm20.launcher2.preferences.migrations
import de.mm20.launcher2.preferences.Settings
class Migration_8_9: VersionedMigration(8, 9) {
override suspend fun applyMigrations(builder: Settings.Builder): Settings.Builder {
return builder
.setClockWidget(
builder.clockWidget.toBuilder()
.setFillHeight(true)
)
.setGrid(
builder.grid.toBuilder()
.setShowLabels(true)
)
}
}

View File

@ -120,6 +120,7 @@ message Settings {
bool battery_part = 5;
bool alarm_part = 6;
bool favorites_part = 7;
bool fill_height = 8;
}
ClockWidgetSettings clock_widget = 7;
@ -192,6 +193,7 @@ message Settings {
message GridSettings {
uint32 column_count = 1;
uint32 icon_size = 2;
bool show_labels = 3;
}
GridSettings grid = 19;