Tweaking widget grid to show more items

Change-Id: Ied035f6c01f062ac1b4b16ee0a5b9029c6da72a0
This commit is contained in:
Winson Chung
2011-08-11 15:57:35 -07:00
parent 981b8a3708
commit 35d4a257cf
10 changed files with 120 additions and 12 deletions
@@ -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);
@@ -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,