From f33f5b3fc563c505c9d8476c831b6baa01b96a67 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Thu, 22 Jul 2021 17:15:31 -0700 Subject: [PATCH] Folder polish: unbold folder title, ensure icons not cropped in folder. - Ensure folder items are scaled to fit within the height/width in 4x5 mode. - This bug surfaced now since we increased the icon size. Bug: 194356039 Test: set display to large, set font to large Change-Id: Ie360ca67c3c91649a471bce920b2fc6a82fb9661 --- res/layout/user_folder_icon_normalized.xml | 1 - src/com/android/launcher3/DeviceProfile.java | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/res/layout/user_folder_icon_normalized.xml b/res/layout/user_folder_icon_normalized.xml index 15131f11d7..11eea6072c 100644 --- a/res/layout/user_folder_icon_normalized.xml +++ b/res/layout/user_folder_icon_normalized.xml @@ -44,7 +44,6 @@ style="@style/TextHeadline" android:layout_weight="1" android:background="@android:color/transparent" - android:textStyle="bold" android:gravity="center_horizontal" android:hint="@string/folder_hint_text" android:imeOptions="flagNoExtractUi" diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 88e817111e..dff1c31c48 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -649,8 +649,11 @@ public class DeviceProfile { int textHeight = Utilities.calculateTextHeight(folderChildTextSizePx); if (isScalableGrid) { - folderCellWidthPx = (int) (cellWidthPx * scale); - folderCellHeightPx = (int) (cellHeightPx * scale); + int minWidth = folderChildIconSizePx + iconDrawablePaddingPx * 2; + int minHeight = folderChildIconSizePx + iconDrawablePaddingPx * 2 + textHeight; + + folderCellWidthPx = (int) Math.max(minWidth, cellWidthPx * scale); + folderCellHeightPx = (int) Math.max(minHeight, cellHeightPx * scale); int borderSpacing = (int) (cellLayoutBorderSpacingOriginalPx * scale); folderCellLayoutBorderSpacingPx = borderSpacing;