Add search quick actions

This commit is contained in:
MM20
2022-11-03 20:01:24 +01:00
parent 9a514dff31
commit f862a578a1
58 changed files with 1617 additions and 465 deletions
@@ -22,7 +22,7 @@ internal val Context.dataStore: LauncherDataStore by dataStore(
}
)
internal const val SchemaVersion = 11
internal const val SchemaVersion = 12
internal fun getMigrations(context: Context): List<DataMigration<Settings>> {
return listOf(
@@ -37,5 +37,6 @@ internal fun getMigrations(context: Context): List<DataMigration<Settings>> {
Migration_8_9(),
Migration_9_10(),
Migration_10_11(),
Migration_11_12(),
)
}
@@ -162,6 +162,17 @@ fun createFactorySettings(context: Context): Settings {
Settings.WidgetSettings.newBuilder()
.setEditButton(true)
)
.setSearchActions(
Settings.SearchActionSettings.newBuilder()
.setCall(true)
.setContact(true)
.setEmail(true)
.setMessage(true)
.setOpenUrl(true)
.setScheduleEvent(true)
.setSetAlarm(true)
.setStartTimer(true)
)
.build()
}
@@ -0,0 +1,20 @@
package de.mm20.launcher2.preferences.migrations
import de.mm20.launcher2.preferences.Settings
class Migration_11_12: VersionedMigration(11, 12) {
override suspend fun applyMigrations(builder: Settings.Builder): Settings.Builder {
return builder
.setSearchActions(
Settings.SearchActionSettings.newBuilder()
.setCall(true)
.setContact(true)
.setEmail(true)
.setMessage(true)
.setOpenUrl(true)
.setScheduleEvent(true)
.setSetAlarm(true)
.setStartTimer(true)
)
}
}
+12
View File
@@ -288,4 +288,16 @@ message Settings {
bool edit_button = 1;
}
WidgetSettings widgets = 26;
message SearchActionSettings {
bool call = 1;
bool message = 2;
bool email = 3;
bool contact = 4;
bool open_url = 5;
bool schedule_event = 6;
bool set_alarm = 7;
bool start_timer = 8;
}
SearchActionSettings search_actions = 27;
}