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
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index 8a1d71a..9f6e0bd 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -781,6 +781,9 @@
}
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 @@
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 @@
}
}
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();
}