From 3e91646d123abbe58ccc0544746145ce5024b923 Mon Sep 17 00:00:00 2001 From: Luca Zuccarini Date: Wed, 26 Jul 2023 15:24:43 +0000 Subject: [PATCH] Animate depth from the right value on Taskbar All Apps launches. `MyDepthController` in `QuickstepTransitionLauncher` assumes that we want the background to always animate the same way, matching the rest state of the workspace (depth == 0). However, in Taskbar All Apps the background is visible, and depth != 0. We now initialize the one-off `DepthController` for launches to take into account the latest depth set by the top level `DepthController`, so there is no jumpcut at the beginning of the animation. Note that in my opinion we should use the same `DepthController` for all cases, rather than having this one-off. I'm looking into the feasibility of that change, but for now this fixes the issue at hand. Fix: 292959100 Flag: N/A Test: manual, see videos in the bug Change-Id: Id90e8e728cc3e2ccf7d92148fbb0d6ff3e6fd6ca (cherry picked from commit 627d67549f73c4c456537f814e450fa8a1318937) --- .../android/launcher3/QuickstepTransitionManager.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index ca9c5771b1..75f25ac7c2 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -1046,7 +1046,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener boolean allowBlurringLauncher = mLauncher.getStateManager().getState() != OVERVIEW && BlurUtils.supportsBlursOnWindows(); - MyDepthController depthController = new MyDepthController(mLauncher); + LaunchDepthController depthController = new LaunchDepthController(mLauncher); ObjectAnimator backgroundRadiusAnim = ObjectAnimator.ofFloat(depthController.stateDepth, MULTI_PROPERTY_VALUE, BACKGROUND_APP.getDepth(mLauncher)) .setDuration(APP_LAUNCH_DURATION); @@ -2047,11 +2047,14 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener } } - private static class MyDepthController extends DepthController { - MyDepthController(Launcher l) { - super(l); + private static class LaunchDepthController extends DepthController { + LaunchDepthController(QuickstepLauncher launcher) { + super(launcher); setCrossWindowBlursEnabled( CrossWindowBlurListeners.getInstance().isCrossWindowBlurEnabled()); + // Make sure that the starting value matches the current depth set by the main + // controller. + stateDepth.setValue(launcher.getDepthController().stateDepth.getValue()); } } }