summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AppsCustomizePagedView.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-06-30 14:39:35 -0700
committerWinson Chung <winsonc@google.com>2011-06-30 14:45:03 -0700
commitdb1138b4efae89a3b5833547958a3606e5408a71 (patch)
treedb3455a620afffd9abd153064b4bec44b9ffa275 /src/com/android/launcher2/AppsCustomizePagedView.java
parent6a0f57dfafced837a2a282d8feec28d5418be3b9 (diff)
downloadandroid_packages_apps_Trebuchet-db1138b4efae89a3b5833547958a3606e5408a71.tar.gz
android_packages_apps_Trebuchet-db1138b4efae89a3b5833547958a3606e5408a71.tar.bz2
android_packages_apps_Trebuchet-db1138b4efae89a3b5833547958a3606e5408a71.zip
Tweaking AppsCustomize spacing to match CellLayout.
Change-Id: I5c3fa215659b51c7fc8dcda19dd1fd753d192f5e
Diffstat (limited to 'src/com/android/launcher2/AppsCustomizePagedView.java')
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 54a2e42ff..35ca3e9a1 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -283,6 +283,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mShortcutCountX = Math.max(1, (int) Math.round(mCellCountX / 2f));
mShortcutCountY = Math.max(1, (int) Math.round(mCellCountY / 2f));
+ // Force a measure to update recalculate the gaps
+ int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.AT_MOST);
+ int heightSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST);
+ mWidgetSpacingLayout.measure(widthSpec, heightSpec);
mContentWidth = mWidgetSpacingLayout.getContentWidth();
invalidatePageData();
@@ -537,7 +541,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// expected page width, so we can actually optimize by hiding all the TextView-based
// children that are expensive to measure, and let that happen naturally later.
setVisibilityOnChildren(layout, View.GONE);
- int widthSpec = MeasureSpec.makeMeasureSpec(getPageContentWidth(), MeasureSpec.AT_MOST);
+ int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.AT_MOST);
int heightSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST);
layout.setMinimumWidth(getPageContentWidth());
layout.measure(widthSpec, heightSpec);