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

Commit 72dc60c5 authored by Hyunyoung Song's avatar Hyunyoung Song Committed by Android (Google) Code Review
Browse files

Merge "Cancel exit spring loaded runnable when launcher state is set to APPS...

Merge "Cancel exit spring loaded runnable when launcher state is set to APPS or WIDGETS b/29645452" into ub-launcher3-calgary
parents c42087e5 06ca7568
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -348,6 +348,11 @@ public class Launcher extends Activity
        }
    }

    // Exiting spring loaded mode happens with a delay. This runnable object triggers the
    // state transition. If another state transition happened during this delay,
    // simply unregister this runnable.
    private Runnable mExitSpringLoadedModeRunnable;

    @Thunk Runnable mBuildLayersRunnable = new Runnable() {
        public void run() {
            if (mWorkspace != null) {
@@ -3416,6 +3421,12 @@ public class Launcher extends Activity
            return false;
        }

        // This is a safe and supported transition to bypass spring_loaded mode.
        if (mExitSpringLoadedModeRunnable != null) {
            mHandler.removeCallbacks(mExitSpringLoadedModeRunnable);
            mExitSpringLoadedModeRunnable = null;
        }

        if (toState == State.APPS) {
            mStateTransitionAnimation.startAnimationToAllApps(mWorkspace.getState(), animated,
                    focusSearchBar);
@@ -3475,7 +3486,10 @@ public class Launcher extends Activity
            final Runnable onCompleteRunnable) {
        if (!isStateSpringLoaded()) return;

        mHandler.postDelayed(new Runnable() {
        if (mExitSpringLoadedModeRunnable != null) {
            mHandler.removeCallbacks(mExitSpringLoadedModeRunnable);
        }
        mExitSpringLoadedModeRunnable = new Runnable() {
            @Override
            public void run() {
                if (successfulDrop) {
@@ -3489,8 +3503,10 @@ public class Launcher extends Activity
                } else {
                    exitSpringLoadedDragMode();
                }
                mExitSpringLoadedModeRunnable = null;
            }
        }, delay);
        };
        mHandler.postDelayed(mExitSpringLoadedModeRunnable, delay);
    }

    boolean isStateSpringLoaded() {