From 96fa31a774b55f323fecc7d0bcf3131334f65369 Mon Sep 17 00:00:00 2001 From: Suphon Thanakornpakapong Date: Wed, 20 Oct 2021 16:26:24 +0700 Subject: [PATCH] Make drawer cells square when labels are hidden --- src/com/android/launcher3/DeviceProfile.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 69fbb242fc..b7fe20689d 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -540,6 +540,12 @@ public class DeviceProfile { int topBottomPadding = textHeight; allAppsCellHeightPx = allAppsIconSizePx + allAppsIconDrawablePaddingPx + textHeight + (topBottomPadding * 2); + if (allAppsIconTextSizePx == 0) { + int leftRightPadding = desiredWorkspaceLeftRightMarginPx + cellLayoutPaddingLeftRightPx; + int drawerWidth = availableWidthPx - leftRightPadding * 2; + allAppsCellHeightPx = drawerWidth / inv.numAllAppsColumns; + allAppsIconDrawablePaddingPx = 0; + } } /**