Calculate all apps cell height based on actual sizes.

This ensures that the cell contents always fit.

Bug: 160716074
Change-Id: I3d85adec3e7e3652fe4a258bd659382a3e696211
Merged-In: I3d85adec3e7e3652fe4a258bd659382a3e696211
(cherry picked from commit 3535944395)
This commit is contained in:
Jon Miranda
2020-07-09 14:54:23 -07:00
committed by Jonathan Miranda
parent f130c29882
commit f06e1b8b93

View File

@@ -369,8 +369,10 @@ public class DeviceProfile {
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;