Recompute cell size when inputs change.
Bug:10691425
Change-Id: I0bb8904bbae2c6d0939b15ff06d584b96ef6f8b2
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 0a0452d..682c2ed 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -947,9 +947,11 @@
int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
- if (mCellWidth < 0 || mCellHeight < 0) {
- mCellWidth = grid.calculateCellWidth(widthSize, mCountX);
- mCellHeight = grid.calculateCellHeight(heightSize, mCountY);
+ int cw = grid.calculateCellWidth(widthSize, mCountX);
+ int ch = grid.calculateCellHeight(heightSize, mCountY);
+ if (cw != mCellWidth || ch != mCellHeight) {
+ mCellWidth = cw;
+ mCellHeight = ch;
mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap,
mHeightGap, mCountX, mCountY);
}