diff options
author | Winson Chung <winsonc@google.com> | 2011-08-11 15:12:11 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-08-11 15:57:35 -0700 |
commit | 35d4a257cff6ff69232f10c8dc405df8044eab1f (patch) | |
tree | 6182d7e65555e444e3d323b86c1b524d33ddc059 /src | |
parent | 981b8a3708f7c8de5ab8f896c4ea8110379c012a (diff) | |
download | android_packages_apps_Trebuchet-35d4a257cff6ff69232f10c8dc405df8044eab1f.tar.gz android_packages_apps_Trebuchet-35d4a257cff6ff69232f10c8dc405df8044eab1f.tar.bz2 android_packages_apps_Trebuchet-35d4a257cff6ff69232f10c8dc405df8044eab1f.zip |
Tweaking widget grid to show more items
Change-Id: Ied035f6c01f062ac1b4b16ee0a5b9029c6da72a0
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/AppsCustomizePagedView.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher2/PagedViewWidget.java | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 16dad1be9..9d0399544 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -282,8 +282,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen mWidgetSpacingLayout.calculateCellCount(width, height, maxCellCountX, maxCellCountY); mCellCountX = mWidgetSpacingLayout.getCellCountX(); mCellCountY = mWidgetSpacingLayout.getCellCountY(); - mWidgetCountX = Math.max(1, (int) Math.round(mCellCountX / 2f)); - mWidgetCountY = Math.max(1, (int) Math.round(mCellCountY / 3f)); // Force a measure to update recalculate the gaps int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.AT_MOST); diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java index d9c2a84a1..053c2ea1a 100644 --- a/src/com/android/launcher2/PagedViewWidget.java +++ b/src/com/android/launcher2/PagedViewWidget.java @@ -111,8 +111,10 @@ public class PagedViewWidget extends LinearLayout implements Checkable { name.setText(info.label); name.setLayerType(View.LAYER_TYPE_SOFTWARE, null); final TextView dims = (TextView) findViewById(R.id.widget_dims); - dims.setText(String.format(mDimensionsFormatString, cellSpan[0], cellSpan[1])); - dims.setLayerType(View.LAYER_TYPE_SOFTWARE, null); + if (dims != null) { + dims.setText(String.format(mDimensionsFormatString, cellSpan[0], cellSpan[1])); + dims.setLayerType(View.LAYER_TYPE_SOFTWARE, null); + } } public void applyFromResolveInfo(PackageManager pm, ResolveInfo info, |