From d313ee0c3597d7ee4e3e773c491d57047bdf7e93 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Tue, 24 Oct 2023 21:50:22 -0700 Subject: [PATCH] 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 --- .../launcher3/taskbar/TaskbarViewController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index 8a8c3bca00..fc4cc2591a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -435,6 +435,11 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar * 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 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar */ 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);