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

Commit 8cba1bc4 authored by Winson Chung's avatar Winson Chung
Browse files

Skip setting end target if the recents animation was canceled or ended

Bug: 147249069
Change-Id: Ie13db509466776873df383eef599c11c5cd32ab2
parent c7f39fc6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -917,6 +917,12 @@ public class LauncherSwipeHandler<T extends BaseDraggingActivity>
            windowAnim.addAnimatorListener(new AnimationSuccessListener() {
                @Override
                public void onAnimationSuccess(Animator animator) {
                    if (mRecentsAnimationController == null) {
                        // If the recents animation is interrupted, we still end the running
                        // animation (not canceled) so this is still called. In that case, we can
                        // skip doing any future work here for the current gesture.
                        return;
                    }
                    // Finalize the state and notify of the change
                    mGestureState.setState(STATE_END_TARGET_ANIMATION_FINISHED);
                }
@@ -938,6 +944,12 @@ public class LauncherSwipeHandler<T extends BaseDraggingActivity>
            windowAnim.addListener(new AnimationSuccessListener() {
                @Override
                public void onAnimationSuccess(Animator animator) {
                    if (mRecentsAnimationController == null) {
                        // If the recents animation is interrupted, we still end the running
                        // animation (not canceled) so this is still called. In that case, we can
                        // skip doing any future work here for the current gesture.
                        return;
                    }
                    if (target == NEW_TASK && mRecentsView != null
                            && mRecentsView.getNextPage() == mRecentsView.getRunningTaskIndex()) {
                        // We are about to launch the current running task, so use LAST_TASK state