diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index cbb2a66214..1db587285e 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -500,23 +500,25 @@ public final class TaskViewUtils { windowAnimEndListener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - recentsView.post(() -> { - stateManager.moveToRestState(); - stateManager.reapplyState(); + recentsView.finishRecentsAnimation(false /* toRecents */, () -> { + recentsView.post(() -> { + stateManager.moveToRestState(); + stateManager.reapplyState(); + }); }); } }; } else { AnimatorPlaybackController controller = - stateManager.createAnimationToNewWorkspace(NORMAL, - RECENTS_LAUNCH_DURATION); + stateManager.createAnimationToNewWorkspace(NORMAL, RECENTS_LAUNCH_DURATION); controller.dispatchOnStart(); childStateAnimation = controller.getTarget(); launcherAnim = controller.getAnimationPlayer().setDuration(RECENTS_LAUNCH_DURATION); windowAnimEndListener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - stateManager.goToState(NORMAL, false); + recentsView.finishRecentsAnimation(false /* toRecents */, + () -> stateManager.goToState(NORMAL, false)); } }; } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 4918036abc..150ae02cf0 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -137,7 +137,6 @@ import com.android.quickstep.TaskOverlayFactory; import com.android.quickstep.TaskThumbnailCache; import com.android.quickstep.TaskViewUtils; import com.android.quickstep.ViewUtils; -import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.util.MultiValueUpdateListener; import com.android.quickstep.util.RecentsOrientedState; @@ -760,6 +759,12 @@ public abstract class RecentsView { + mRecentsAnimationController = null; if (onFinishComplete != null) { onFinishComplete.run(); } diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 8f22622058..2bb14d2a0b 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -484,7 +484,6 @@ public class TaskView extends FrameLayout implements Reusable { mIsClickableAsLiveTile = false; RecentsView recentsView = getRecentsView(); RemoteAnimationTargets targets = recentsView.getLiveTileParams().getTargetSet(); - recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(false); AnimatorSet anim = new AnimatorSet(); TaskViewUtils.composeRecentsLaunchAnimator( @@ -493,10 +492,13 @@ public class TaskView extends FrameLayout implements Reusable { mActivity.getStateManager(), recentsView, recentsView.getDepthController()); anim.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationStart(Animator animator) { + recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(false); + } + @Override public void onAnimationEnd(Animator animator) { - recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(true); - recentsView.finishRecentsAnimation(false, null); mIsClickableAsLiveTile = true; } });