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

Commit f58e0df0 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Skipping resetting transition if the same transition is running

Bug: 73838765
Change-Id: I1a428f1b5d5b04397a317e0f35f3effb53c24405
parent 43936eb0
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