Play workspace reveal animation for predictive back-to-home

Bug: 382453424
Test: Manual, i.e. tested back-to-home and back-to-allapps animation on phones, tablets and foldables, including interruptions.
Flag: EXEMPT bugfix
Change-Id: Iece001b6b9edd9ca7a909e3ccbe8ebdff2e71d9f
This commit is contained in:
Johannes Gallmann
2024-12-05 13:56:08 +00:00
parent 3be4c7d458
commit 09603bfb39
7 changed files with 69 additions and 55 deletions

View File

@@ -1670,7 +1670,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|| mLauncher.getWorkspace().isOverlayShown()
|| shouldPlayFallbackClosingAnimation(appTargets);
boolean playWorkspaceReveal = !fromPredictiveBack;
boolean playWorkspaceReveal = true;
boolean skipAllAppsScale = false;
if (!playFallBackAnimation) {
PointF velocity;
@@ -1689,12 +1689,12 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
// Skip scaling all apps, otherwise FloatingIconView will get wrong
// layout bounds.
skipAllAppsScale = true;
} else if (!fromPredictiveBack) {
} else {
if (enableScalingRevealHomeAnimation()) {
anim.play(
new ScalingWorkspaceRevealAnim(
mLauncher, rectFSpringAnim,
rectFSpringAnim.getTargetRect()).getAnimators());
new ScalingWorkspaceRevealAnim(mLauncher, rectFSpringAnim,
rectFSpringAnim.getTargetRect(),
!fromPredictiveBack /* playAlphaReveal */).getAnimators());
} else {
anim.play(new StaggeredWorkspaceAnim(mLauncher, velocity.y,
true /* animateOverviewScrim */, launcherView).getAnimators());
@@ -1713,6 +1713,20 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
anim.play(getFallbackClosingWindowAnimators(appTargets));
}
AnimatorListenerAdapter endListener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
AccessibilityManagerCompat.sendTestProtocolEventToTest(
mLauncher, WALLPAPER_OPEN_ANIMATION_FINISHED_MESSAGE);
}
};
if (rectFSpringAnim != null) {
rectFSpringAnim.addAnimatorListener(endListener);
} else {
anim.addListener(endListener);
}
// Normally, we run the launcher content animation when we are transitioning
// home, but if home is already visible, then we don't want to animate the
// contents of launcher unless we know that we are animating home as a result
@@ -1721,16 +1735,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
// targets list because it is already visible). In that case, we force
// invisibility on touch down, and only reset it after the animation to home
// is initialized.
if (launcherIsForceInvisibleOrOpening || fromPredictiveBack) {
AnimatorListenerAdapter endListener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
AccessibilityManagerCompat.sendTestProtocolEventToTest(
mLauncher, WALLPAPER_OPEN_ANIMATION_FINISHED_MESSAGE);
}
};
if (launcherIsForceInvisibleOrOpening) {
if (rectFSpringAnim != null && anim.getChildAnimations().isEmpty()) {
addCujInstrumentation(rectFSpringAnim, Cuj.CUJ_LAUNCHER_APP_CLOSE_TO_HOME);
} else {
@@ -1739,16 +1744,10 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
: Cuj.CUJ_LAUNCHER_APP_CLOSE_TO_HOME);
}
if (fromPredictiveBack && rectFSpringAnim != null) {
rectFSpringAnim.addAnimatorListener(endListener);
} else {
anim.addListener(endListener);
}
// Only register the content animation for cancellation when state changes
mLauncher.getStateManager().setCurrentAnimation(anim);
if (mLauncher.isInState(LauncherState.ALL_APPS) && !fromPredictiveBack) {
if (mLauncher.isInState(LauncherState.ALL_APPS)) {
Pair<AnimatorSet, Runnable> contentAnimator =
getLauncherContentAnimator(false, LAUNCHER_RESUME_START_DELAY,
skipAllAppsScale);