From adb3bf5a8d9cdd96c240f2c6d741fd54822f47fe Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Mon, 24 Mar 2025 10:52:05 +0000 Subject: [PATCH] Notify StateManager of workspace reveal animations. This way any subsequent state changes during the animation will cancel it. Previously swiping up to All Apps immediately after going home would cause the 2 depth animations to interleave, ending with a depth of 0, for example. Now the workspace depth is cancelled and the All Apps depth is correctly applied. Demo: https://drive.google.com/file/d/1R1BwYAsxj31FDgAeIZqZdJbuSz7s9PZy/view?usp=sharing&resourcekey=0-4UyZfAMxecSHWAyqyeNZmg Fix: 405836159 Test: Manual (swipe home and immediately to all apps) Flag: EXEMPT bugfix Change-Id: Iac32f2a03a5cbbb297c71ebd9cfedc8ee6e8cae7 --- .../android/quickstep/util/ScalingWorkspaceRevealAnim.kt | 7 ++++++- .../com/android/quickstep/util/WorkspaceRevealAnim.java | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt b/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt index 63eae921b0..97d7ed1a63 100644 --- a/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt +++ b/quickstep/src/com/android/quickstep/util/ScalingWorkspaceRevealAnim.kt @@ -25,6 +25,7 @@ import android.graphics.RectF import android.util.Log import android.view.View import android.view.animation.PathInterpolator +import androidx.core.animation.doOnStart import androidx.core.graphics.transform import com.android.app.animation.Animations import com.android.app.animation.Interpolators @@ -241,7 +242,11 @@ class ScalingWorkspaceRevealAnim( } fun getAnimators(): AnimatorSet { - return animation.buildAnim() + val animatorSet = animation.buildAnim() + animatorSet.doOnStart { + launcher.stateManager.setCurrentAnimation(animatorSet, LauncherState.NORMAL) + } + return animatorSet } fun start() { diff --git a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java index 32e0e132e0..e86adb81fb 100644 --- a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java +++ b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java @@ -91,7 +91,9 @@ public class WorkspaceRevealAnim { PendingAnimation depthBuilder = new PendingAnimation(DURATION_MS); DepthController depth = ((QuickstepLauncher) launcher).getDepthController(); depth.setStateWithAnimation(NORMAL, new StateAnimationConfig(), depthBuilder); - mAnimators.play(depthBuilder.buildAnim()); + AnimatorSet animatorSet = depthBuilder.buildAnim(); + launcher.getStateManager().setCurrentAnimation(animatorSet, NORMAL); + mAnimators.play(animatorSet); } // Add sysui scrim animation.