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

Commit 379e8e0f authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Preventing state change duing the swipe up animation when the previous app

transition is not complete

> This state change causes the RecentsView to get reset making the first
task visible

Bug: 111404703
Change-Id: I8ff2577bf965fb4cdf736fb18683ded63ade1872
parent 32f91ab9
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);
        }