From 59b60098b2b22239c8551bd5d12f5655654bc583 Mon Sep 17 00:00:00 2001 From: x-JOC Date: Wed, 21 Oct 2026 12:10:33 +0300 Subject: [PATCH] fix(grid): apply the icon size setting on responsive grids (#7407) Home screen > Icon size (homeIconSizeFactor) had no effect on responsive grids such as "practical": DeviceProfileOverrides scales the IDP's iconSize, but responsive grids take their icon size from their cell specs (mResponsiveWorkspaceCellSpec.getIconSize()) and never read inv.iconSize. getResponsiveIconSizePx() now applies the factor to the cell specs' icon size, for the workspace, the hotseat and folder content, the same three places the IDP-sized grids use inv.iconSize. The responsive code still shrinks an icon that doesn't fit its cell (getIconSmallerThan). The icon bitmap size already followed the factor, as the IDP computes it from the scaled iconSize. Visible change: on responsive grids the setting now works; at 100% (the default) nothing changes. (cherry picked from commit 6345b71df7dbd77be6c4da03ddcc76ebcadd2e90) Co-authored-by: Claude --- src/com/android/launcher3/DeviceProfile.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 71152538c9..4e22812b41 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -601,7 +601,7 @@ public class DeviceProfile { mHotseatQsbSpaceBase = hotseatQsbSpace; if (mIsResponsiveGrid) { - updateHotseatSizes(mResponsiveWorkspaceCellSpec.getIconSize()); + updateHotseatSizes(getResponsiveIconSizePx()); } else { updateHotseatSizes(pxFromDp(inv.iconSize[mTypeIndex], mMetrics)); } @@ -1138,7 +1138,7 @@ public class DeviceProfile { iconCenterVertically = (mIsScalableGrid || mIsResponsiveGrid) && isVerticalBarLayout(); if (mIsResponsiveGrid) { - iconSizePx = mResponsiveWorkspaceCellSpec.getIconSize(); + iconSizePx = getResponsiveIconSizePx(); iconTextSizePx = mResponsiveWorkspaceCellSpec.getIconTextSize(); mIconDrawablePaddingOriginalPx = mResponsiveWorkspaceCellSpec.getIconDrawablePadding(); maxIconTextLineCount = mResponsiveWorkspaceCellSpec.getIconTextMaxLineCount(); @@ -1183,6 +1183,16 @@ public class DeviceProfile { return Math.round(extraHeight); } + /** + * LC-Note: the responsive cell specs' icon size, scaled by Home screen > Icon size like the + * grids sized from the IDP (whose iconSize DeviceProfileOverrides scales). The specs never see + * that setting otherwise. + */ + private int getResponsiveIconSizePx() { + return Math.max(1, Math.round(mResponsiveWorkspaceCellSpec.getIconSize() + * PreferenceCacheExtensionsKt.firstCached(preferenceManager2.getHomeIconSizeFactor()))); + } + private int getCellLayoutHeightSpecification() { return (cellHeightPx * inv.numRows) + (cellLayoutBorderSpacePx.y * (inv.numRows - 1)) + cellLayoutPaddingPx.top + cellLayoutPaddingPx.bottom; @@ -1507,7 +1517,7 @@ public class DeviceProfile { private void updateFolderCellSize(float scale, Resources res) { int minLabelTextSize = pxFromSp(MIN_FOLDER_TEXT_SIZE_SP, mMetrics, scale); if (mIsResponsiveGrid) { - folderChildIconSizePx = mResponsiveWorkspaceCellSpec.getIconSize(); + folderChildIconSizePx = getResponsiveIconSizePx(); folderChildTextSizePx = mResponsiveWorkspaceCellSpec.getIconTextSize(); folderLabelTextSizePx = Math.max(minLabelTextSize, (int) (folderChildTextSizePx * folderLabelTextScale));