From 3940470beddea035f5a198456682417077ce8f41 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Fri, 24 Sep 2021 16:00:25 -0700 Subject: [PATCH] Avoids animating the background when launching app targets are translucent. Bug: 200052247 Test: Pause an app, click on paused app and ensure background does not animate Change-Id: Ib0a7cac0ab866441dd8fb27831a8333d0c931723 --- .../launcher3/QuickstepTransitionManager.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index 25371348af..f210e3ab79 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -856,7 +856,13 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener // Since we added a start delay, call update here to init the FloatingIconView properly. listener.onUpdate(0, true /* initOnly */); - animatorSet.playTogether(appAnimator, getBackgroundAnimator(appTargets)); + // If app targets are translucent, do not animate the background as it causes a visible + // flicker when it resets itself at the end of its animation. + if (appTargetsAreTranslucent) { + animatorSet.play(appAnimator); + } else { + animatorSet.playTogether(appAnimator, getBackgroundAnimator()); + } return animatorSet; } @@ -993,11 +999,20 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener } }); - animatorSet.playTogether(appAnimator, getBackgroundAnimator(appTargets)); + // If app targets are translucent, do not animate the background as it causes a visible + // flicker when it resets itself at the end of its animation. + if (appTargetsAreTranslucent) { + animatorSet.play(appAnimator); + } else { + animatorSet.playTogether(appAnimator, getBackgroundAnimator()); + } return animatorSet; } - private ObjectAnimator getBackgroundAnimator(RemoteAnimationTargetCompat[] appTargets) { + /** + * Returns animator that controls depth/blur of the background. + */ + private ObjectAnimator getBackgroundAnimator() { // When launching an app from overview that doesn't map to a task, we still want to just // blur the wallpaper instead of the launcher surface as well boolean allowBlurringLauncher = mLauncher.getStateManager().getState() != OVERVIEW;