commit | e8e680005ded182b01baa52042503c067d79b2c3 | [log] [tgz] |
---|---|---|
author | TreeHugger Robot <treehugger-gerrit@google.com> | Wed Jul 15 23:47:29 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jul 15 23:47:29 2020 +0000 |
tree | 4bd62b87eadddf1cf52907826ee918ea6df2588e | |
parent | c3771e64d964b73c435aab73a4b14afab3810246 [diff] | |
parent | 8127f132310b9850379bf3856b8c8c3ac032ab45 [diff] |
Merge "Calculate all apps cell height based on actual sizes." into rvc-dev am: 8127f13231 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12152234 Change-Id: I88f54d5cf388aeacbf1da48e3e5f1e89f37ba836
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index e3cd0bd..49caa93 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java
@@ -369,8 +369,10 @@ if (allAppsHasDifferentNumColumns()) { allAppsIconSizePx = ResourceUtils.pxFromDp(inv.allAppsIconSize, mInfo.metrics); allAppsIconTextSizePx = Utilities.pxFromSp(inv.allAppsIconTextSize, mInfo.metrics); - allAppsCellHeightPx = getCellSize(inv.numAllAppsColumns, inv.numAllAppsColumns).y; allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx; + // We use 4 below to ensure labels are closer to their corresponding icon. + allAppsCellHeightPx = Math.round(allAppsIconSizePx + allAppsIconTextSizePx + + (4 * allAppsIconDrawablePaddingPx)); } else { allAppsIconSizePx = iconSizePx; allAppsIconTextSizePx = iconTextSizePx;