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

Commit 9ec6e785 authored by Johannes Gallmann's avatar Johannes Gallmann Committed by Android (Google) Code Review
Browse files

Merge "Update swipe edge of BackTouchTracker in onMove" into main

parents b4ce5172 74304dfa
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -135,6 +135,16 @@ public class BackTouchTracker {
        mShouldUpdateStartLocation = false;
    }

    /**
     * Updates the swipe edge. This is useful when it's not clear yet which swipe edge the gesture
     * is performed on from the start of the gesture (for example trackpad back gestures).
     *
     * @param swipeEdge the updated swipeEdge value
     */
    public void updateSwipeEdge(@BackEvent.SwipeEdge int swipeEdge) {
        mSwipeEdge = swipeEdge;
    }

    /** Resets the tracker. */
    public void reset() {
        mInitTouchX = 0;
+5 −2
Original line number Diff line number Diff line
@@ -524,7 +524,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
                onGestureStarted(touchX, touchY, swipeEdge);
                mShouldStartOnNextMoveEvent = false;
            }
            onMove();
            onMove(swipeEdge);
        } else if (keyAction == MotionEvent.ACTION_UP || keyAction == MotionEvent.ACTION_CANCEL) {
            ProtoLog.d(WM_SHELL_BACK_PREVIEW,
                    "Finishing gesture with event action: %d", keyAction);
@@ -620,7 +620,10 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
        }
    }

    private void onMove() {
    private void onMove(@BackEvent.SwipeEdge int swipeEdge) {
        if (predictiveBackDelayWmTransition() && mCurrentTracker.isActive()) {
            mCurrentTracker.updateSwipeEdge(swipeEdge);
        }
        if (!mBackGestureStarted
                || mBackNavigationInfo == null
                || mActiveCallback == null