From e59a723af38eb30b16115e7c4d9c9870745e8141 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 1 Dec 2021 15:08:23 -0800 Subject: [PATCH] Fix taskbar jumping when going home - Set resumed state immediately when finishing recents controller to launcher, otherwise there's a race where we start animating gesture state to 0 before animating resumed state to 1, which causes the jump in the bug Test: Swipe from app to home 10 times, no jump Fixes: 203725820 Change-Id: Ie8a1add29902a9961ba4d7861ba5424ab656f1c8 --- .../taskbar/TaskbarLauncherStateController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index f3c8cf3480..b2c29b2d90 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -195,7 +195,7 @@ import java.util.function.Supplier; if (hasAnyFlag(changedFlags, FLAG_RESUMED)) { boolean isResumed = isResumed(); ObjectAnimator anim = mIconAlignmentForResumedState - .animateToValue(getCurrentIconAlignmentRatio(), isResumed ? 1 : 0) + .animateToValue(isResumed ? 1 : 0) .setDuration(duration); anim.addListener(new AnimatorListenerAdapter() { @@ -351,9 +351,16 @@ import java.util.function.Supplier; private void endGestureStateOverride(boolean finishedToApp) { mCallbacks.removeListener(this); + + // Update the resumed state immediately to ensure a seamless handoff + boolean launcherResumed = !finishedToApp; + mIconAlignmentForResumedState.updateValue(launcherResumed ? 1 : 0); + updateStateForFlag(FLAG_RECENTS_ANIMATION_RUNNING, false); + updateStateForFlag(FLAG_RESUMED, launcherResumed); applyState(); + TaskbarStashController controller = mControllers.taskbarStashController; controller.updateStateForFlag(FLAG_IN_APP, finishedToApp); controller.applyState();