Remove search result order preference
This commit is contained in:
@@ -89,7 +89,6 @@ data class LauncherSettingsData internal constructor(
|
||||
val searchBarFixed: Boolean = false,
|
||||
|
||||
val searchResultsReversed: Boolean = false,
|
||||
val searchResultOrder: SearchResultOrder = SearchResultOrder.Weighted,
|
||||
val separateWorkProfile: Boolean = true,
|
||||
|
||||
val rankingWeightFactor: WeightFactor = WeightFactor.Default,
|
||||
@@ -374,12 +373,6 @@ sealed interface GestureAction {
|
||||
data class Launch(val key: String?) : GestureAction
|
||||
}
|
||||
|
||||
@Serializable
|
||||
enum class SearchResultOrder {
|
||||
Weighted,
|
||||
Alphabetical,
|
||||
LaunchCount,
|
||||
}
|
||||
|
||||
@Serializable
|
||||
enum class WeightFactor {
|
||||
|
||||
+1
-11
@@ -1,13 +1,12 @@
|
||||
package de.mm20.launcher2.preferences.ui
|
||||
|
||||
import de.mm20.launcher2.preferences.LauncherDataStore
|
||||
import de.mm20.launcher2.preferences.SearchResultOrder
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.map
|
||||
|
||||
class SearchUiSettings internal constructor(
|
||||
private val launcherDataStore: LauncherDataStore,
|
||||
){
|
||||
) {
|
||||
val launchOnEnter
|
||||
get() = launcherDataStore.data.map { it.searchLaunchOnEnter }.distinctUntilChanged()
|
||||
|
||||
@@ -35,15 +34,6 @@ class SearchUiSettings internal constructor(
|
||||
}
|
||||
}
|
||||
|
||||
val resultOrder
|
||||
get() = launcherDataStore.data.map { it.searchResultOrder }.distinctUntilChanged()
|
||||
|
||||
fun setResultOrder(resultOrder: SearchResultOrder) {
|
||||
launcherDataStore.update {
|
||||
it.copy(searchResultOrder = resultOrder)
|
||||
}
|
||||
}
|
||||
|
||||
val openKeyboard
|
||||
get() = launcherDataStore.data.map { it.searchBarKeyboard }.distinctUntilChanged()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user