From 9ea62e4d133226be66bdd783be4639d753ff460b Mon Sep 17 00:00:00 2001 From: Suphon Thanakornpakapong Date: Sat, 4 Sep 2021 23:21:07 +0700 Subject: [PATCH] Calculate icon bitmap size after preference override --- src/com/android/launcher3/InvariantDeviceProfile.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index 76fe4e2d94..c088d5e14a 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -264,9 +264,7 @@ public class InvariantDeviceProfile { iconSize = displayOption.iconSize; iconShapePath = getIconShapePath(context); landscapeIconSize = displayOption.landscapeIconSize; - iconBitmapSize = ResourceUtils.pxFromDp(iconSize, displayInfo.metrics); iconTextSize = displayOption.iconTextSize; - fillResIconDpi = getLauncherIconDensity(iconBitmapSize); if (Utilities.isGridOptionsEnabled(context)) { allAppsIconSize = displayOption.allAppsIconSize; @@ -281,6 +279,9 @@ public class InvariantDeviceProfile { applyPartnerDeviceProfileOverrides(context, displayInfo.metrics); DeviceProfileOverrides.getINSTANCE().get(context).apply(this, closestProfile); + iconBitmapSize = ResourceUtils.pxFromDp(Math.max(iconSize, allAppsIconSize), displayInfo.metrics); + fillResIconDpi = getLauncherIconDensity(iconBitmapSize); + Point realSize = new Point(displayInfo.realSize); // The real size never changes. smallSide and largeSide will remain the // same in any orientation.