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

Commit 58ca5c87 authored by Sreyas Rangaraju's avatar Sreyas Rangaraju Committed by Android (Google) Code Review
Browse files

Merge "Introducing a new gesture scope" into ub-launcher3-rvc-qpr-dev

parents 0cfcdc21 00ad8ee7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
                final LauncherInstrumentation.GestureScope gestureScope =
                        zeroButtonToOverviewGestureStartsInLauncher()
                                ? LauncherInstrumentation.GestureScope.INSIDE_TO_OUTSIDE
                                : LauncherInstrumentation.GestureScope.OUTSIDE;
                                : LauncherInstrumentation.GestureScope.OUTSIDE_WITH_PILFER;

                // b/156044202
                mLauncher.log("Hierarchy before swiping up to overview:");
@@ -130,7 +130,7 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
                }

                mLauncher.swipeToState(startX, startY, endX, endY, 10, OVERVIEW_STATE_ORDINAL,
                        LauncherInstrumentation.GestureScope.OUTSIDE);
                        LauncherInstrumentation.GestureScope.OUTSIDE_WITH_PILFER);
                break;
            }

@@ -194,7 +194,7 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
                mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState,
                        launcherWasVisible && isZeroButton
                                ? LauncherInstrumentation.GestureScope.INSIDE_TO_OUTSIDE
                                : LauncherInstrumentation.GestureScope.OUTSIDE);
                                : LauncherInstrumentation.GestureScope.OUTSIDE_WITH_PILFER);
                break;
            }

+15 −8
Original line number Diff line number Diff line
@@ -112,9 +112,10 @@ public final class LauncherInstrumentation {

    public enum NavigationModel {ZERO_BUTTON, TWO_BUTTON, THREE_BUTTON}

    // Where the gesture happens: outside of Launcher, inside or from inside to outside.
    // Where the gesture happens: outside of Launcher, inside or from inside to outside and
    // whether the gesture recognition triggers pilfer.
    public enum GestureScope {
        OUTSIDE, INSIDE, INSIDE_TO_OUTSIDE
        OUTSIDE_WITHOUT_PILFER, OUTSIDE_WITH_PILFER, INSIDE, INSIDE_TO_OUTSIDE
    }

    ;
@@ -693,7 +694,7 @@ public final class LauncherInstrumentation {
                                ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME, NORMAL_STATE_ORDINAL,
                                launcherWasVisible
                                        ? GestureScope.INSIDE_TO_OUTSIDE
                                        : GestureScope.OUTSIDE);
                                        : GestureScope.OUTSIDE_WITH_PILFER);
                    }
                }
            } else {
@@ -1159,7 +1160,8 @@ public final class LauncherInstrumentation {
        final boolean notLauncher3 = !isLauncher3();
        switch (action) {
            case MotionEvent.ACTION_DOWN:
                if (gestureScope != GestureScope.OUTSIDE) {
                if (gestureScope != GestureScope.OUTSIDE_WITH_PILFER
                        && gestureScope != GestureScope.OUTSIDE_WITHOUT_PILFER) {
                    expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_TOUCH_DOWN);
                }
                if (notLauncher3 && getNavigationModel() != NavigationModel.THREE_BUTTON) {
@@ -1167,11 +1169,16 @@ public final class LauncherInstrumentation {
                }
                break;
            case MotionEvent.ACTION_UP:
                if (notLauncher3 && gestureScope != GestureScope.INSIDE) {
                if (notLauncher3 && gestureScope != GestureScope.INSIDE
                        && (gestureScope == GestureScope.OUTSIDE_WITH_PILFER
                        || gestureScope == GestureScope.INSIDE_TO_OUTSIDE)) {
                    expectEvent(TestProtocol.SEQUENCE_PILFER, EVENT_PILFER_POINTERS);
                }
                if (gestureScope != GestureScope.OUTSIDE) {
                    expectEvent(TestProtocol.SEQUENCE_MAIN, gestureScope == GestureScope.INSIDE
                if (gestureScope != GestureScope.OUTSIDE_WITH_PILFER
                        && gestureScope != GestureScope.OUTSIDE_WITHOUT_PILFER) {
                    expectEvent(TestProtocol.SEQUENCE_MAIN,
                            gestureScope == GestureScope.INSIDE
                                    || gestureScope == GestureScope.OUTSIDE_WITHOUT_PILFER
                                    ? EVENT_TOUCH_UP : EVENT_TOUCH_CANCEL);
                }
                if (notLauncher3 && getNavigationModel() != NavigationModel.THREE_BUTTON) {