From 0d4f1ac30e68d26037a1d98bf3cc324b5fddfba2 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 20 Dec 2022 12:31:14 +0000 Subject: [PATCH] folderChild icon and text size should follow the respective configuration - Use mTypeIndex instead of always INDEX_LANDSCAPE or INDEX_DEFAULT to make sure they follow the workspcae icon/text size Fix: 262446829 Test: DeviceProfileDumpTest Change-Id: I9fc37b41114a34e35108330a8d599556bff77eef --- src/com/android/launcher3/DeviceProfile.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index b95b0af5b0..dba461b1e5 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -1050,12 +1050,9 @@ public class DeviceProfile { } private void updateFolderCellSize(float scale, Resources res) { - float invIconSizeDp = isVerticalBarLayout() - ? inv.iconSize[INDEX_LANDSCAPE] - : inv.iconSize[INDEX_DEFAULT]; + float invIconSizeDp = inv.iconSize[mTypeIndex]; folderChildIconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics, scale)); - folderChildTextSizePx = - pxFromSp(inv.iconTextSize[INDEX_DEFAULT], mMetrics, scale); + folderChildTextSizePx = pxFromSp(inv.iconTextSize[mTypeIndex], mMetrics, scale); folderLabelTextSizePx = Math.max(pxFromSp(MIN_FOLDER_TEXT_SIZE_SP, mMetrics), (int) (folderChildTextSizePx * folderLabelTextScale));