From 15cacd54c6a1f8ac08cd13efe84bee7230a03659 Mon Sep 17 00:00:00 2001 From: Jordan Silva Date: Tue, 28 Nov 2023 14:32:05 +0000 Subject: [PATCH] Update where responsive grid cell icon size is defined This CL changes where the cell icon size, text size and drawable padding is defined to prevent an issue with taskbar. The transient taskbar updates the DeviceProfile icon size with a different value than used for responsive grids, and this update wasn't working anymore because responsive grid implementation wasn't reading the value from iconSize inside the updateIconSize function, but from the responsive grid spec. Bug: 313463280 Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD Test: manual Test: NexusLauncherImageTests Change-Id: I835a90d724c2d1b2d32f483b758b789be7cbdcfe --- src/com/android/launcher3/DeviceProfile.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index badd1c456d..f277926580 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -1002,6 +1002,9 @@ public class DeviceProfile { iconCenterVertically = mIsScalableGrid || mIsResponsiveGrid; if (mIsResponsiveGrid) { + iconSizePx = mResponsiveWorkspaceCellSpec.getIconSize(); + iconTextSizePx = mResponsiveWorkspaceCellSpec.getIconTextSize(); + mIconDrawablePaddingOriginalPx = mResponsiveWorkspaceCellSpec.getIconDrawablePadding(); updateIconSize(1f, res); updateWorkspacePadding(); return 0; @@ -1096,10 +1099,6 @@ public class DeviceProfile { cellLayoutBorderSpacePx = getCellLayoutBorderSpace(inv, scale); if (mIsResponsiveGrid) { - iconSizePx = mResponsiveWorkspaceCellSpec.getIconSize(); - iconTextSizePx = mResponsiveWorkspaceCellSpec.getIconTextSize(); - mIconDrawablePaddingOriginalPx = mResponsiveWorkspaceCellSpec.getIconDrawablePadding(); - cellWidthPx = mResponsiveWorkspaceWidthSpec.getCellSizePx(); cellHeightPx = mResponsiveWorkspaceHeightSpec.getCellSizePx();