summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java2
-rw-r--r--src/com/android/launcher2/PagedViewWidget.java6
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,