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
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index badd1c4..f277926 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -1002,6 +1002,9 @@
iconCenterVertically = mIsScalableGrid || mIsResponsiveGrid;
if (mIsResponsiveGrid) {
+ iconSizePx = mResponsiveWorkspaceCellSpec.getIconSize();
+ iconTextSizePx = mResponsiveWorkspaceCellSpec.getIconTextSize();
+ mIconDrawablePaddingOriginalPx = mResponsiveWorkspaceCellSpec.getIconDrawablePadding();
updateIconSize(1f, res);
updateWorkspacePadding();
return 0;
@@ -1096,10 +1099,6 @@
cellLayoutBorderSpacePx = getCellLayoutBorderSpace(inv, scale);
if (mIsResponsiveGrid) {
- iconSizePx = mResponsiveWorkspaceCellSpec.getIconSize();
- iconTextSizePx = mResponsiveWorkspaceCellSpec.getIconTextSize();
- mIconDrawablePaddingOriginalPx = mResponsiveWorkspaceCellSpec.getIconDrawablePadding();
-
cellWidthPx = mResponsiveWorkspaceWidthSpec.getCellSizePx();
cellHeightPx = mResponsiveWorkspaceHeightSpec.getCellSizePx();