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
This commit is contained in:
Tracy Zhou
2023-10-24 21:50:22 -07:00
parent fbc8b715c3
commit d313ee0c35

View File

@@ -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);