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

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

Merge "Skipping resetting transition if the same transition is running" into ub-launcher3-master

parents 2c3eafcb f58e0df0
Loading
Loading
Loading
Loading
+19 −6
Original line number Diff line number Diff line
@@ -162,13 +162,26 @@ public class LauncherStateManager {
    }

    public void goToState(LauncherState state, boolean animated, long delay, long overrideDuration,
            Runnable onCompleteRunnable) {
        if (mLauncher.isInState(state) && mConfig.mCurrentAnimation == null) {
            final Runnable onCompleteRunnable) {
        if (mLauncher.isInState(state)) {
            if (mConfig.mCurrentAnimation == null) {
                // Run any queued runnable
                if (onCompleteRunnable != null) {
                    onCompleteRunnable.run();
                }
                return;
            } else if (!mConfig.userControlled && animated) {
                // We are running the same animation as requested
                if (onCompleteRunnable != null) {
                    mConfig.mCurrentAnimation.addListener(new AnimationSuccessListener() {
                        @Override
                        public void onAnimationSuccess(Animator animator) {
                            onCompleteRunnable.run();
                        }
                    });
                }
                return;
            }
        }

        // Cancel the current animation