Factor in CellLayout padding in cell size calculation.

Bug: 63753505
Change-Id: I221dfb1d486110f8de3994085d917c12f82bcd0f
This commit is contained in:
Jon Miranda
2017-07-18 12:42:15 -07:00
parent 751ea1c10e
commit 8632d9dd1e

View File

@@ -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;
}