From a2545ee91e9802029f09800f81b692d8958e4a09 Mon Sep 17 00:00:00 2001 From: Himanshu Garg <33326079+garghimanshu0786@users.noreply.github.com> Date: Wed, 8 Oct 2025 12:00:56 +0530 Subject: [PATCH] Fix app drawer icon scaling when home screen icons are resized (#5932) * Fix foldable device layout issue on Pixel 9 Pro Fold - Enable two-panel layout for all multi-display devices (foldables) - Previously required both isTablet && isMultiDisplay conditions - Foldable devices may not meet 600dp tablet width threshold when unfolded - This ensures proper layout utilization of available screen space Fixes #5920 * Fix app drawer icon scaling when home screen icons are resized - Prevent home screen icon scale from affecting app drawer layout - When mIsScalableGrid is true, use separate scaling for app drawer elements - This fixes the 'zoomed out' appearance in app drawer when home screen icons are scaled to 120% or higher - App drawer now maintains independent sizing from home screen Fixes #5912 * Remove code comments from fixes - Clean up code by removing explanatory comments - Keep changes minimal and focused --- src/com/android/launcher3/DeviceProfile.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 41273c9f46..fbb4fd9ce2 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -378,7 +378,7 @@ public class DeviceProfile { mInfo = info; isTablet = info.isTablet(windowBounds); isPhone = !isTablet; - isTwoPanels = isTablet && isMultiDisplay; + isTwoPanels = isMultiDisplay; boolean isTaskBarEnabled = PreferenceExtensionsKt.firstBlocking(preferenceManager2.getEnableTaskbarOnPhone()); isTaskbarPresent = isTaskBarEnabled && (isTablet || (enableTinyTaskbar() && isGestureMode)) && WindowManagerProxy.INSTANCE.get(context).isTaskbarDrawnInProcess(); @@ -1410,9 +1410,10 @@ public class DeviceProfile { * Updates the iconSize for allApps* variants. */ private void updateAllAppsIconSize(float scale, Resources res) { + float borderScale = mIsScalableGrid ? 1.0f : scale; allAppsBorderSpacePx = new Point( - pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].x, mMetrics, scale), - pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].y, mMetrics, scale)); + pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].x, mMetrics, borderScale), + pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].y, mMetrics, borderScale)); // AllApps cells don't have real space between cells, // so we add the border space to the cell height allAppsCellHeightPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].y, mMetrics, allAppsCellHeightMultiplier) @@ -1424,7 +1425,7 @@ public class DeviceProfile { allAppsIconTextSizePx = pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics); allAppsIconTextSizePx *= mTextFactors.getAllAppsIconTextSizeFactor(); allAppsIconDrawablePaddingPx = getNormalizedIconDrawablePadding(); - allAppsCellWidthPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].x, mMetrics, scale); + allAppsCellWidthPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].x, mMetrics); if (allAppsCellWidthPx < allAppsIconSizePx) { // If allAppsCellWidth no longer fit allAppsIconSize, reduce allAppsBorderSpace