From 8632d9dd1e69ecdaa6c16fdcb990ce9a85f3f67c Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Tue, 18 Jul 2017 12:42:15 -0700 Subject: [PATCH] Factor in CellLayout padding in cell size calculation. Bug: 63753505 Change-Id: I221dfb1d486110f8de3994085d917c12f82bcd0f --- src/com/android/launcher3/DeviceProfile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index ca5d8e7462..2d5f8d0164 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -436,7 +436,8 @@ public class DeviceProfile { // Since we are only concerned with the overall padding, layout direction does // not matter. Point padding = getTotalWorkspacePadding(); - result.x = calculateCellWidth(availableWidthPx - padding.x, inv.numColumns); + int cellPadding = cellLayoutPaddingLeftRightPx * 2; + result.x = calculateCellWidth(availableWidthPx - padding.x - cellPadding, inv.numColumns); result.y = calculateCellHeight(availableHeightPx - padding.y, inv.numRows); return result; }