Do not animate icon alignment in phone mode
With the existing code, there is a rare case that mIconAlignControllerLazy is
set from unfolded state, and then go to small screen, and we will reuse mIconAlignControllerLazy to animate, only to find out that scaleX for the icon view is infinity. Instead, we should unset mIconAlignControllerLazy in phone mode.
Fixes: 274517647
Test: manual
Change-Id: I3200761e5f4c6df0d89744f22e38bfe7fc7846cc
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 8a8c3bc..fc4cc25 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -435,6 +435,11 @@
* 1 => fully aligned
*/
public void setLauncherIconAlignment(float alignmentRatio, DeviceProfile launcherDp) {
+ if (isPhoneMode(launcherDp)) {
+ mIconAlignControllerLazy = null;
+ return;
+ }
+
boolean isHotseatIconOnTopWhenAligned =
mControllers.uiController.isHotseatIconOnTopWhenAligned();
boolean isStashed = mControllers.taskbarStashController.isStashed();
@@ -463,11 +468,6 @@
*/
private AnimatorPlaybackController createIconAlignmentController(DeviceProfile launcherDp) {
PendingAnimation setter = new PendingAnimation(100);
- if (TaskbarManager.isPhoneMode(launcherDp)) {
- // No animation for icons in small-screen
- return setter.createPlaybackController();
- }
-
mOnControllerPreCreateCallback.run();
DeviceProfile taskbarDp = mActivity.getDeviceProfile();
Rect hotseatPadding = launcherDp.getHotseatLayoutPadding(mActivity);