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
This commit is contained in:
Andy Wickham
2025-03-24 10:52:05 +00:00
parent e58dac962c
commit adb3bf5a8d
2 changed files with 9 additions and 2 deletions
@@ -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() {
@@ -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.