Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0917ba7c authored by Michal Brzezinski's avatar Michal Brzezinski
Browse files

Not depending on system gesture distance for touchpad tutorial

For tutorial it's fine to exaggerate gesture a bit so user has better idea of the correct execution.
And longer gesture works much better with live gesture tracking, otherwise animation plays very quickly.

Bug: 369817369
Test: manual + unit tests
Flag: com.android.systemui.shared.new_touchpad_gestures_tutorial
Change-Id: Ie7aa6595d26063f1629bb70a4487828a99f05970
parent 5dde51f0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1979,6 +1979,9 @@
        slowing down. Also for tutorial it should be fine to lean to the side of being more strict
        rather than not strict enough and not teaching user the proper gesture as a result.-->
    <dimen name="touchpad_recent_apps_gesture_velocity_threshold">0.05dp</dimen>
    <!-- Normal gesture threshold is system_gestures_distance_threshold but for tutorial we can
         exaggerate gesture, which also works much better with live tracking -->
    <dimen name="touchpad_tutorial_gestures_distance_threshold">48dp</dimen>

    <!-- Broadcast dialog -->
    <dimen name="broadcast_dialog_title_img_margin_top">18dp</dimen>
+1 −3
Original line number Diff line number Diff line
@@ -63,9 +63,7 @@ fun BackGestureTutorialScreen(onDoneButtonClicked: () -> Unit, onBack: () -> Uni
@Composable
private fun rememberBackGestureRecognizer(resources: Resources): GestureRecognizer {
    val distance =
        resources.getDimensionPixelSize(
            com.android.internal.R.dimen.system_gestures_distance_threshold
        )
        resources.getDimensionPixelSize(R.dimen.touchpad_tutorial_gestures_distance_threshold)
    return remember(distance) { BackGestureRecognizer(distance) }
}

+1 −3
Original line number Diff line number Diff line
@@ -62,9 +62,7 @@ fun HomeGestureTutorialScreen(onDoneButtonClicked: () -> Unit, onBack: () -> Uni
@Composable
private fun rememberHomeGestureRecognizer(resources: Resources): GestureRecognizer {
    val distance =
        resources.getDimensionPixelSize(
            com.android.internal.R.dimen.system_gestures_distance_threshold
        )
        resources.getDimensionPixelSize(R.dimen.touchpad_tutorial_gestures_distance_threshold)
    return remember(distance) { HomeGestureRecognizer(distance) }
}

+1 −3
Original line number Diff line number Diff line
@@ -63,9 +63,7 @@ fun RecentAppsGestureTutorialScreen(onDoneButtonClicked: () -> Unit, onBack: ()
@Composable
private fun rememberRecentAppsGestureRecognizer(resources: Resources): GestureRecognizer {
    val distance =
        resources.getDimensionPixelSize(
            com.android.internal.R.dimen.system_gestures_distance_threshold
        )
        resources.getDimensionPixelSize(R.dimen.touchpad_tutorial_gestures_distance_threshold)
    val velocity = resources.getDimension(R.dimen.touchpad_recent_apps_gesture_velocity_threshold)
    return remember(distance, velocity) { RecentAppsGestureRecognizer(distance, velocity) }
}