Revert "Remove home button gesture"

This reverts commit 99fd69d5d9.
This commit is contained in:
MM20
2025-06-03 18:27:13 +02:00
parent d81936212d
commit c4ec894add
7 changed files with 102 additions and 1 deletions
@@ -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)
}
}
}