From 031fbcc5640f64143e798ee361e18bd3ff2fe371 Mon Sep 17 00:00:00 2001 From: Johannes Gallmann Date: Wed, 4 Jan 2023 14:16:47 +0100 Subject: [PATCH] Prevent workspace enter animation for predictive back Bug: 263913711 Test: Manual, i.e. testing predictive back for four scenarios: Back to all apps, Back to home. Both with the closed app icon visible or not. Change-Id: Id87686098e6ad413819dc75545071da00291db65 --- .../launcher3/QuickstepTransitionManager.java | 16 +++++++++------- .../LauncherBackAnimationController.java | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index 2aa0af4113..71d1296aa8 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -1560,7 +1560,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener RemoteAnimationTarget[] wallpaperTargets, boolean fromUnlock, RectF startRect, - float startWindowCornerRadius) { + float startWindowCornerRadius, + boolean fromPredictiveBack) { AnimatorSet anim = null; RectFSpringAnim rectFSpringAnim = null; @@ -1594,7 +1595,11 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener rectFSpringAnim = getClosingWindowAnimators( anim, appTargets, launcherView, velocity, startRect, startWindowCornerRadius); - if (!mLauncher.isInState(LauncherState.ALL_APPS)) { + if (mLauncher.isInState(LauncherState.ALL_APPS)) { + // Skip scaling all apps, otherwise FloatingIconView will get wrong + // layout bounds. + skipAllAppsScale = true; + } else if (!fromPredictiveBack) { anim.play(new StaggeredWorkspaceAnim(mLauncher, velocity.y, true /* animateOverviewScrim */, launcherView).getAnimators()); @@ -1606,10 +1611,6 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener // We play StaggeredWorkspaceAnim as a part of the closing window animation. playWorkspaceReveal = false; - } else { - // Skip scaling all apps, otherwise FloatingIconView will get wrong - // layout bounds. - skipAllAppsScale = true; } } else { anim.play(getFallbackClosingWindowAnimators(appTargets)); @@ -1686,7 +1687,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener new RectF(getWindowTargetBounds(appTargets, getRotationChange(appTargets))); Pair pair = createWallpaperOpenAnimations( appTargets, wallpaperTargets, mFromUnlock, windowTargetBounds, - QuickStepContract.getWindowCornerRadius(mLauncher)); + QuickStepContract.getWindowCornerRadius(mLauncher), + false /* fromPredictiveBack */); mLauncher.clearForceInvisibleFlag(INVISIBLE_ALL); result.setAnimation(pair.second, mLauncher); diff --git a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java index 27417516a4..b3e1878ca4 100644 --- a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java +++ b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java @@ -289,7 +289,8 @@ public class LauncherBackAnimationController { new RemoteAnimationTarget[0], false /* fromUnlock */, mCurrentRect, - cornerRadius); + cornerRadius, + mBackInProgress /* fromPredictiveBack */); startTransitionAnimations(pair.first, pair.second); mLauncher.clearForceInvisibleFlag(INVISIBLE_ALL); }