From e5d43a421fd411c6e0e8b3c6c28917cfd952328a Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Thu, 12 Sep 2013 13:53:46 -0400 Subject: [PATCH] Recompute cell size when inputs change. Bug:10691425 Change-Id: I0bb8904bbae2c6d0939b15ff06d584b96ef6f8b2 --- src/com/android/launcher3/CellLayout.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 0a0452daf9..682c2ed2e5 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -947,9 +947,11 @@ public class CellLayout extends ViewGroup { 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); }