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

Commit 0b74a7fe authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Preventing state change duing the swipe up animation when the previous...

Merge "Preventing state change duing the swipe up animation when the previous app transition is not complete" into ub-launcher3-master
parents 26fbcb39 379e8e0f
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -256,6 +256,11 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
            }
        };

        // Re-setup the recents UI when gesture starts, as the state could have been changed during
        // that time by a previous window transition.
        mStateCallback.addCallback(STATE_LAUNCHER_STARTED | STATE_GESTURE_STARTED_QUICKSTEP,
                this::setupRecentsViewUi);

        mStateCallback.addCallback(STATE_LAUNCHER_DRAWN | STATE_GESTURE_STARTED_QUICKSCRUB,
                this::initializeLauncherAnimationController);
        mStateCallback.addCallback(STATE_LAUNCHER_DRAWN | STATE_GESTURE_STARTED_QUICKSTEP,
@@ -429,11 +434,15 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
            });
        }

        setupRecentsViewUi();
        mLayoutListener.open();
        mStateCallback.setState(STATE_LAUNCHER_STARTED);
    }

    private void setupRecentsViewUi() {
        mRecentsView.showTask(mRunningTaskId);
        mRecentsView.setRunningTaskHidden(true);
        mRecentsView.setRunningTaskIconScaledDown(true);
        mLayoutListener.open();
        mStateCallback.setState(STATE_LAUNCHER_STARTED);
    }

    public void setLauncherOnDrawCallback(Runnable callback) {
+6 −0
Original line number Diff line number Diff line
@@ -306,7 +306,13 @@ public class LauncherStateManager {
     */
    public AnimatorPlaybackController createAnimationToNewWorkspace(
            LauncherState fromState, LauncherState state, long duration) {
        // Since we are creating a state animation to a different state, temporarily prevent state
        // change as part of config reset.
        LauncherState originalRestState = mRestState;
        mRestState = state;
        mConfig.reset();
        mRestState = originalRestState;

        for (StateHandler handler : getStateHandlers()) {
            handler.setState(fromState);
        }