From 3469b1f6be7b7914f3246b182e5564d80d4d0de2 Mon Sep 17 00:00:00 2001 From: mpodolian Date: Mon, 7 Oct 2024 15:20:06 -0700 Subject: [PATCH] Update stashing hotseat logic. Before this change we only aligned the taskbar with the hotseat if the hotseat position is changed. But it does not work if hoseat icons have reduced space in between each other to accommodate the bubble bar. This change aligns the task bar with the hotseat icons before any hotseat animation. Fixes: 372075963 Flag: com.android.wm.shell.enable_bubble_bar Test: Manual. Have the hotseat with the reduced icons space. Expand / collapse the bubble bar. Change-Id: I72156cfc78f4db93b5bba11f1bfdda83c20b9a02 --- .../TaskbarLauncherStateController.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index 8a1d71ac4b..9f6e0bda1f 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -781,6 +781,9 @@ public class TaskbarLauncherStateController { } protected void stashHotseat(boolean stash) { + // align taskbar with the hotseat icons before performing any animation + mControllers.taskbarViewController.setLauncherIconAlignment(/* alignmentRatio = */ 1, + mLauncher.getDeviceProfile()); TaskbarStashController stashController = mControllers.taskbarStashController; stashController.updateStateForFlag(FLAG_STASHED_FOR_BUBBLES, stash); Runnable swapHotseatWithTaskbar = new Runnable() { @@ -892,19 +895,6 @@ public class TaskbarLauncherStateController { mHotseatTranslationXAnimation.cancel(); mHotseatTranslationXAnimation = null; } - Runnable postAnimationAction = new Runnable() { - @Override - public void run() { - mHotseatTranslationXAnimation = null; - // We only need to align the task bar when on launcher home screen - if (mControllers.taskbarStashController.isOnHome()) { - mControllers.taskbarViewController.setLauncherIconAlignment( - /* alignmentRatio = */ 1, - mLauncher.getDeviceProfile() - ); - } - } - }; Hotseat hotseat = mLauncher.getHotseat(); AnimatorSet translationXAnimation = new AnimatorSet(); MultiProperty iconsTranslationX = mLauncher.getHotseat() @@ -927,14 +917,12 @@ public class TaskbarLauncherStateController { } } if (!animate) { - postAnimationAction.run(); return; } mHotseatTranslationXAnimation = translationXAnimation; translationXAnimation.setStartDelay(FADE_OUT_ANIM_POSITION_DURATION_MS); translationXAnimation.setDuration(FADE_IN_ANIM_ALPHA_DURATION_MS); translationXAnimation.setInterpolator(Interpolators.EMPHASIZED); - translationXAnimation.addListener(AnimatorListeners.forEndCallback(postAnimationAction)); translationXAnimation.start(); }