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/AppsCustomizePagedView.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/AppsCustomizePagedView.java')
-rw-r--r-- | src/com/android/launcher2/AppsCustomizePagedView.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 9000049d1..6667f7cc1 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -207,6 +207,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen // Dimens private int mContentWidth; private int mAppIconSize; + private int mMaxAppCellCountX, mMaxAppCellCountY; private int mWidgetCountX, mWidgetCountY; private int mWidgetWidthGap, mWidgetHeightGap; private final int mWidgetPreviewIconPaddedDimension; @@ -247,12 +248,9 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen mAppIconSize = resources.getDimensionPixelSize(R.dimen.app_icon_size); mDragViewMultiplyColor = resources.getColor(R.color.drag_view_multiply_color); - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PagedView, 0, 0); - // TODO-APPS_CUSTOMIZE: remove these unnecessary attrs after - mCellCountX = a.getInt(R.styleable.PagedView_cellCountX, 6); - mCellCountY = a.getInt(R.styleable.PagedView_cellCountY, 4); - a.recycle(); - a = context.obtainStyledAttributes(attrs, R.styleable.AppsCustomizePagedView, 0, 0); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AppsCustomizePagedView, 0, 0); + mMaxAppCellCountX = a.getInt(R.styleable.AppsCustomizePagedView_maxAppCellCountX, -1); + mMaxAppCellCountY = a.getInt(R.styleable.AppsCustomizePagedView_maxAppCellCountY, -1); mWidgetWidthGap = a.getDimensionPixelSize(R.styleable.AppsCustomizePagedView_widgetCellWidthGap, 0); mWidgetHeightGap = @@ -373,6 +371,12 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen maxCellCountY = (isLandscape ? LauncherModel.getCellCountY() : LauncherModel.getCellCountX()); } + if (mMaxAppCellCountX > -1) { + maxCellCountX = Math.min(maxCellCountX, mMaxAppCellCountX); + } + if (mMaxAppCellCountY > -1) { + maxCellCountY = Math.min(maxCellCountY, mMaxAppCellCountY); + } // Now that the data is ready, we can calculate the content width, the number of cells to // use for each page |