diff options
author | John Spurlock <jspurlock@google.com> | 2013-09-12 21:41:27 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-12 21:41:27 +0000 |
commit | d5066bebd896d4d060fa9d76d9d214b9e130c12d (patch) | |
tree | ceed9981045c074414a2eb4b72c32a16c85a989a /src/com | |
parent | 369c978c739ac4b4249416486e4879405812afd7 (diff) | |
parent | e5d43a421fd411c6e0e8b3c6c28917cfd952328a (diff) | |
download | android_packages_apps_Trebuchet-d5066bebd896d4d060fa9d76d9d214b9e130c12d.tar.gz android_packages_apps_Trebuchet-d5066bebd896d4d060fa9d76d9d214b9e130c12d.tar.bz2 android_packages_apps_Trebuchet-d5066bebd896d4d060fa9d76d9d214b9e130c12d.zip |
Merge "Recompute cell size when inputs change." into jb-ub-now-indigo-rose
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/CellLayout.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 0a0452daf..682c2ed2e 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); } |