summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/trebuchet/CellLayout.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/CellLayout.java')
-rw-r--r--src/com/cyanogenmod/trebuchet/CellLayout.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/trebuchet/CellLayout.java b/src/com/cyanogenmod/trebuchet/CellLayout.java
index 8bb5b567f..0586d296d 100644
--- a/src/com/cyanogenmod/trebuchet/CellLayout.java
+++ b/src/com/cyanogenmod/trebuchet/CellLayout.java
@@ -255,7 +255,6 @@ public class CellLayout extends ViewGroup {
mForegroundRect = new Rect();
mChildren = new CellLayoutChildren(context);
- mChildren.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
addView(mChildren);
}
@@ -835,6 +834,11 @@ public class CellLayout extends ViewGroup {
int numWidthGaps = mCountX - 1;
int numHeightGaps = mCountY - 1;
+ if (!LauncherApplication.isScreenLarge()){
+ mCellWidth = mOriginalCellWidth = (widthSpecSize - mPaddingLeft - mPaddingRight) / mCountX;
+ mCellHeight = mOriginalCellHeight = (heightSpecSize - mPaddingTop - mPaddingBottom) / mCountY;
+ }
+
if (mOriginalWidthGap < 0 || mOriginalHeightGap < 0) {
int hSpace = widthSpecSize - mPaddingLeft - mPaddingRight;
int vSpace = heightSpecSize - mPaddingTop - mPaddingBottom;
@@ -848,6 +852,8 @@ public class CellLayout extends ViewGroup {
mHeightGap = mOriginalHeightGap;
}
+ mChildren.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
+
// Initial values correspond to widthSpecMode == MeasureSpec.EXACTLY
int newWidth = widthSpecSize;
int newHeight = heightSpecSize;