commit | d5b15bb08125c9bcd9407d36221814cc999f387a | [log] [tgz] |
---|---|---|
author | TreeHugger Robot <treehugger-gerrit@google.com> | Wed Jul 15 23:47:12 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jul 15 23:47:12 2020 +0000 |
tree | be0354e75c179a35333a09c359958de4b3467605 | |
parent | 8d7fdfdd472e3d6aeecd6c4aa2d23f0aa5f9470f [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: Ice2867481c5d761ef955e74671e950f89f48ea6f
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;