@@ -138,6 +138,7 @@ data class LauncherSettingsData internal constructor(
|
||||
val gesturesSwipeUp: GestureAction = GestureAction.Widgets,
|
||||
val gesturesDoubleTap: GestureAction = GestureAction.ScreenLock,
|
||||
val gesturesLongPress: GestureAction = GestureAction.NoAction,
|
||||
val gesturesHomeButton: GestureAction = GestureAction.NoAction,
|
||||
|
||||
val animationsCharging: Boolean = true,
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ data class GestureSettingsData(
|
||||
val swipeUp: GestureAction,
|
||||
val doubleTap: GestureAction,
|
||||
val longPress: GestureAction,
|
||||
val homeButton: GestureAction,
|
||||
)
|
||||
|
||||
class GestureSettings internal constructor(
|
||||
@@ -26,6 +27,7 @@ class GestureSettings internal constructor(
|
||||
swipeUp = it.gesturesSwipeUp,
|
||||
doubleTap = it.gesturesDoubleTap,
|
||||
longPress = it.gesturesLongPress,
|
||||
homeButton = it.gesturesHomeButton,
|
||||
)
|
||||
}.distinctUntilChanged()
|
||||
) {
|
||||
@@ -47,6 +49,9 @@ class GestureSettings internal constructor(
|
||||
val longPress: Flow<GestureAction> = dataStore.data.map { it.gesturesLongPress }
|
||||
.distinctUntilChanged()
|
||||
|
||||
val homeButton: Flow<GestureAction> = dataStore.data.map { it.gesturesHomeButton }
|
||||
.distinctUntilChanged()
|
||||
|
||||
fun setSwipeDown(action: GestureAction) {
|
||||
dataStore.update {
|
||||
it.copy(gesturesSwipeDown = action)
|
||||
@@ -82,4 +87,12 @@ class GestureSettings internal constructor(
|
||||
it.copy(gesturesLongPress = action)
|
||||
}
|
||||
}
|
||||
|
||||
fun setHomeButton(action: GestureAction) {
|
||||
dataStore.update {
|
||||
it.copy(gesturesHomeButton = action)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user