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
This commit is contained in:
1 parent
644aad280b
commit
3469b1f6be
1 file changed
+3
-15
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user