summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/CellLayout.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-07-17 21:03:04 -0700
committerAdam Cohen <adamcohen@google.com>2011-07-17 22:00:50 -0700
commit234c4cd54406e363a2ebc213f6ae5be284414988 (patch)
treea46c8e54b79e9036127127a2859d194b69d4000c /src/com/android/launcher2/CellLayout.java
parent95383fe41dacc45c2aa97e7f47bafebb5b7655d8 (diff)
downloadandroid_packages_apps_Trebuchet-234c4cd54406e363a2ebc213f6ae5be284414988.tar.gz
android_packages_apps_Trebuchet-234c4cd54406e363a2ebc213f6ae5be284414988.tar.bz2
android_packages_apps_Trebuchet-234c4cd54406e363a2ebc213f6ae5be284414988.zip
Fix text clipping in Launcher (bug 4980315)
Change-Id: I20c9b98b606d317ed32d49a3437f24a4cd312759
Diffstat (limited to 'src/com/android/launcher2/CellLayout.java')
-rw-r--r--src/com/android/launcher2/CellLayout.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 22516cc33..ae2250773 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -64,6 +64,8 @@ public class CellLayout extends ViewGroup {
private int mCountX;
private int mCountY;
+ private int mOriginalWidthGap;
+ private int mOriginalHeightGap;
private int mWidthGap;
private int mHeightGap;
private int mMaxGap;
@@ -155,8 +157,8 @@ public class CellLayout extends ViewGroup {
mCellWidth = a.getDimensionPixelSize(R.styleable.CellLayout_cellWidth, 10);
mOriginalCellHeight =
mCellHeight = a.getDimensionPixelSize(R.styleable.CellLayout_cellHeight, 10);
- mWidthGap = a.getDimensionPixelSize(R.styleable.CellLayout_widthGap, 0);
- mHeightGap = a.getDimensionPixelSize(R.styleable.CellLayout_heightGap, 0);
+ mWidthGap = mOriginalWidthGap = a.getDimensionPixelSize(R.styleable.CellLayout_widthGap, 0);
+ mHeightGap = mOriginalHeightGap = a.getDimensionPixelSize(R.styleable.CellLayout_heightGap, 0);
mMaxGap = a.getDimensionPixelSize(R.styleable.CellLayout_maxGap, 0);
mCountX = LauncherModel.getCellCountX();
mCountY = LauncherModel.getCellCountY();
@@ -872,7 +874,7 @@ public class CellLayout extends ViewGroup {
int numWidthGaps = mCountX - 1;
int numHeightGaps = mCountY - 1;
- if (mWidthGap < 0 || mHeightGap < 0) {
+ if (mOriginalWidthGap < 0 || mOriginalHeightGap < 0) {
int hSpace = widthSpecSize - mPaddingLeft - mPaddingRight;
int vSpace = heightSpecSize - mPaddingTop - mPaddingBottom;
int hFreeSpace = hSpace - (mCountX * mOriginalCellWidth);
@@ -885,6 +887,9 @@ public class CellLayout extends ViewGroup {
mCellHeight = mOriginalCellHeight + remainingVSpace / mCountY;
mChildren.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
+ } else {
+ mWidthGap = mOriginalWidthGap;
+ mHeightGap = mOriginalHeightGap;
}
// Initial values correspond to widthSpecMode == MeasureSpec.EXACTLY