summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2017-07-18 12:42:15 -0700
committerJon Miranda <jonmiranda@google.com>2017-07-18 12:42:15 -0700
commit8632d9dd1e69ecdaa6c16fdcb990ce9a85f3f67c (patch)
treebbc0d13d7b5b58d6486aefed5ffd0a699728e4e6
parent751ea1c10e8e2348a9c0d0a22f8b9df3c9416c1f (diff)
downloadandroid_packages_apps_Trebuchet-8632d9dd1e69ecdaa6c16fdcb990ce9a85f3f67c.tar.gz
android_packages_apps_Trebuchet-8632d9dd1e69ecdaa6c16fdcb990ce9a85f3f67c.tar.bz2
android_packages_apps_Trebuchet-8632d9dd1e69ecdaa6c16fdcb990ce9a85f3f67c.zip
Factor in CellLayout padding in cell size calculation.
Bug: 63753505 Change-Id: I221dfb1d486110f8de3994085d917c12f82bcd0f
-rw-r--r--src/com/android/launcher3/DeviceProfile.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index ca5d8e746..2d5f8d016 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;
}