summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/CellLayout.java
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2013-09-12 13:53:46 -0400
committerJohn Spurlock <jspurlock@google.com>2013-09-12 13:53:46 -0400
commite5d43a421fd411c6e0e8b3c6c28917cfd952328a (patch)
treef59026d8541d3b6efdb4e59869ec2d38f41af578 /src/com/android/launcher3/CellLayout.java
parent77e1f47520958edd7ec04e203db65b932537bd1c (diff)
downloadandroid_packages_apps_Trebuchet-e5d43a421fd411c6e0e8b3c6c28917cfd952328a.tar.gz
android_packages_apps_Trebuchet-e5d43a421fd411c6e0e8b3c6c28917cfd952328a.tar.bz2
android_packages_apps_Trebuchet-e5d43a421fd411c6e0e8b3c6c28917cfd952328a.zip
Recompute cell size when inputs change.
Bug:10691425 Change-Id: I0bb8904bbae2c6d0939b15ff06d584b96ef6f8b2
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r--src/com/android/launcher3/CellLayout.java8
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);
}