diff options
author | Winson Chung <winsonc@google.com> | 2011-11-08 15:47:17 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-11-08 15:54:45 -0800 |
commit | 6032e7ed8e6208348a6b3f8bc1a7ecafc7951af8 (patch) | |
tree | 8965bff597a779f7f742b9bb23f96094983b8073 /src/com/android/launcher2/PagedViewCellLayout.java | |
parent | acec6719208a59ccf32bfd4f46e383c9400945d9 (diff) | |
download | android_packages_apps_Trebuchet-6032e7ed8e6208348a6b3f8bc1a7ecafc7951af8.tar.gz android_packages_apps_Trebuchet-6032e7ed8e6208348a6b3f8bc1a7ecafc7951af8.tar.bz2 android_packages_apps_Trebuchet-6032e7ed8e6208348a6b3f8bc1a7ecafc7951af8.zip |
Fixing issue where AllApps labels were getting clipped (Bug: 5490118)
- Tweaking the AllApps grid spacing
Change-Id: I7eb79edfd170500c1fecd6841e6f022bd40ac250
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayout.java')
-rw-r--r-- | src/com/android/launcher2/PagedViewCellLayout.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java index 2ef7e296a..6266ca26f 100644 --- a/src/com/android/launcher2/PagedViewCellLayout.java +++ b/src/com/android/launcher2/PagedViewCellLayout.java @@ -69,7 +69,7 @@ public class PagedViewCellLayout extends ViewGroup implements Page { resources.getDimensionPixelSize(R.dimen.apps_customize_cell_height); mCellCountX = LauncherModel.getCellCountX(); mCellCountY = LauncherModel.getCellCountY(); - mOriginalHeightGap = mOriginalHeightGap = mWidthGap = mHeightGap = -1; + mOriginalWidthGap = mOriginalHeightGap = mWidthGap = mHeightGap = -1; mMaxGap = resources.getDimensionPixelSize(R.dimen.apps_customize_max_gap); mChildren = new PagedViewCellLayoutChildren(context); @@ -294,8 +294,8 @@ public class PagedViewCellLayout extends ViewGroup implements Page { } public void setGap(int widthGap, int heightGap) { - mWidthGap = widthGap; - mHeightGap = heightGap; + mOriginalWidthGap = mWidthGap = widthGap; + mOriginalHeightGap = mHeightGap = heightGap; mChildren.setGap(widthGap, heightGap); } @@ -325,10 +325,9 @@ public class PagedViewCellLayout extends ViewGroup implements Page { * Estimates the number of cells that the specified width would take up. */ public int estimateCellHSpan(int width) { - // The space for a page assuming that we want to show half of a column of the previous and - // next pages is the width - left padding (current & next page) - right padding (previous & - // current page) - half cell width (for previous and next pages) - int availWidth = (int) (width - (2 * mPaddingLeft + 2 * mPaddingRight)); + // We don't show the next/previous pages any more, so we use the full width, minus the + // padding + int availWidth = width - (mPaddingLeft + mPaddingRight); // We know that we have to fit N cells with N-1 width gaps, so we just juggle to solve for N int n = Math.max(1, (availWidth + mWidthGap) / (mCellWidth + mWidthGap)); |