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

Commit c3629c8e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Cleanup state properly when interacting during gesture nav transition"...

Merge "Cleanup state properly when interacting during gesture nav transition" into sc-dev am: b13200c6

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14735875

Change-Id: Icea54a23541cdd1791d9adc1c5dde67bbd6583c9
parents d46e3b03 b13200c6
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1398,6 +1398,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
            mLauncherTransitionController.getNormalController().getAnimationPlayer().end();
            mLauncherTransitionController = null;
        }

        if (mRecentsView != null) {
            mRecentsView.abortScrollerAnimation();
        }
    }

    /**
@@ -1416,7 +1420,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,

    private void resetStateForAnimationCancel() {
        boolean wasVisible = mWasLauncherAlreadyVisible || mGestureStarted;
        mActivityInterface.onTransitionCancelled(wasVisible);
        mActivityInterface.onTransitionCancelled(wasVisible, mGestureState.getEndTarget());

        // Leave the pending invisible flag, as it may be used by wallpaper open animation.
        if (mActivity != null) {
+11 −1
Original line number Diff line number Diff line
@@ -86,12 +86,22 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
        mBackgroundState = backgroundState;
    }

    public void onTransitionCancelled(boolean activityVisible) {
    /**
     * Called when the current gesture transition is cancelled.
     * @param activityVisible Whether the user can see the changes we make here, so try to animate.
     * @param endTarget If the gesture ended before we got cancelled, where we were headed.
     */
    public void onTransitionCancelled(boolean activityVisible,
            @Nullable GestureState.GestureEndTarget endTarget) {
        ACTIVITY_TYPE activity = getCreatedActivity();
        if (activity == null) {
            return;
        }
        STATE_TYPE startState = activity.getStateManager().getRestState();
        if (endTarget != null) {
            // We were on our way to this state when we got canceled, end there instead.
            startState = stateFromGestureEndTarget(endTarget);
        }
        activity.getStateManager().goToState(startState, activityVisible);
    }

+9 −0
Original line number Diff line number Diff line
@@ -253,6 +253,15 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
        forceFinishScroller(true);
    }

    /**
     *  Immediately finishes any overscroll effect and jumps to the end of the scroller animation.
     */
    public void abortScrollerAnimation() {
        mEdgeGlowLeft.finish();
        mEdgeGlowRight.finish();
        abortScrollerAnimation(true);
    }

    private void abortScrollerAnimation(boolean resetNextPage) {
        mScroller.abortAnimation();
        // We need to clean up the next page here to avoid computeScrollHelper from