diff --git a/res/layout/apps_customize_pane.xml b/res/layout/apps_customize_pane.xml
index 8b1bd39..b455153 100644
--- a/res/layout/apps_customize_pane.xml
+++ b/res/layout/apps_customize_pane.xml
@@ -73,7 +73,8 @@
                 launcher:widgetCellWidthGap="@dimen/apps_customize_widget_cell_width_gap"
                 launcher:widgetCellHeightGap="@dimen/apps_customize_widget_cell_height_gap"
                 launcher:widgetCountX="@integer/apps_customize_widget_cell_count_x"
-                launcher:widgetCountY="@integer/apps_customize_widget_cell_count_y" />
+                launcher:widgetCountY="@integer/apps_customize_widget_cell_count_y"
+                launcher:maxGap="@dimen/workspace_max_gap" />
             <ImageView
                 android:id="@+id/paged_view_indicator"
                 android:layout_width="wrap_content"
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index 4540c15..278da54 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -31,12 +31,12 @@
 
     <integer name="all_apps_view_cellCountX">6</integer>
     <integer name="all_apps_view_cellCountY">3</integer>
-    <dimen name="all_apps_view_pageLayoutWidthGap">10dp</dimen>
-    <dimen name="all_apps_view_pageLayoutHeightGap">5dp</dimen>
-    <dimen name="all_apps_view_pageLayoutPaddingTop">4dp</dimen>
-    <dimen name="all_apps_view_pageLayoutPaddingBottom">4dp</dimen>
-    <dimen name="all_apps_view_pageLayoutPaddingLeft">2dp</dimen>
-    <dimen name="all_apps_view_pageLayoutPaddingRight">2dp</dimen>
+    <dimen name="all_apps_view_pageLayoutWidthGap">-1dp</dimen>
+    <dimen name="all_apps_view_pageLayoutHeightGap">-1dp</dimen>
+    <dimen name="all_apps_view_pageLayoutPaddingTop">5dp</dimen>
+    <dimen name="all_apps_view_pageLayoutPaddingBottom">5dp</dimen>
+    <dimen name="all_apps_view_pageLayoutPaddingLeft">5dp</dimen>
+    <dimen name="all_apps_view_pageLayoutPaddingRight">5dp</dimen>
 
 <!-- AppsCustomize -->
     <dimen name="apps_customize_widget_cell_width_gap">30dp</dimen>
diff --git a/res/values-port/dimens.xml b/res/values-port/dimens.xml
index 8b423dd..945699b 100644
--- a/res/values-port/dimens.xml
+++ b/res/values-port/dimens.xml
@@ -29,12 +29,12 @@
 
     <integer name="all_apps_view_cellCountX">4</integer>
     <integer name="all_apps_view_cellCountY">5</integer>
-    <dimen name="all_apps_view_pageLayoutWidthGap">0dp</dimen>
-    <dimen name="all_apps_view_pageLayoutHeightGap">8dp</dimen>
+    <dimen name="all_apps_view_pageLayoutWidthGap">-1dp</dimen>
+    <dimen name="all_apps_view_pageLayoutHeightGap">-1dp</dimen>
     <dimen name="all_apps_view_pageLayoutPaddingTop">15dp</dimen>
     <dimen name="all_apps_view_pageLayoutPaddingBottom">15dp</dimen>
-    <dimen name="all_apps_view_pageLayoutPaddingLeft">0dp</dimen>
-    <dimen name="all_apps_view_pageLayoutPaddingRight">0dp</dimen>
+    <dimen name="all_apps_view_pageLayoutPaddingLeft">5dp</dimen>
+    <dimen name="all_apps_view_pageLayoutPaddingRight">5dp</dimen>
 
     <dimen name="apps_customize_widget_cell_width_gap">20dp</dimen>
     <dimen name="apps_customize_widget_cell_height_gap">10dp</dimen>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 52110bd..2a54981 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -32,8 +32,8 @@
     <dimen name="app_icon_size">56dp</dimen>
     <dimen name="apps_customize_cell_width">72dp</dimen>
     <dimen name="apps_customize_cell_height">72dp</dimen>
-    <!-- In portrat/normal, we peek only 1/8th the app cell width -->
-    <dimen name="apps_customize_peek_width">9dp</dimen>
+    <dimen name="apps_customize_peek_width">0dp</dimen>
+    <dimen name="apps_customize_max_gap">18dp</dimen>
     <dimen name="apps_customize_widget_cell_width_gap">10dp</dimen>
     <dimen name="apps_customize_widget_cell_height_gap">10dp</dimen>
     <dimen name="title_texture_width">120px</dimen>
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 54a2e42..35ca3e9 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -283,6 +283,10 @@
         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 @@
         // 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);
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index 9c37c01..fc1b012 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -19,6 +19,7 @@
 import android.content.Context;
 import android.content.res.Resources;
 import android.util.AttributeSet;
+import android.util.Log;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewDebug;
@@ -36,10 +37,13 @@
 
     private int mCellCountX;
     private int mCellCountY;
+    private int mOriginalCellWidth;
+    private int mOriginalCellHeight;
     private int mCellWidth;
     private int mCellHeight;
     private int mWidthGap;
     private int mHeightGap;
+    private int mMaxGap;
     private float mPeekWidth;
     protected PagedViewCellLayoutChildren mChildren;
     private PagedViewCellLayoutChildren mHolographicChildren;
@@ -61,12 +65,15 @@
 
         // setup default cell parameters
         Resources resources = context.getResources();
-        mCellWidth = resources.getDimensionPixelSize(R.dimen.apps_customize_cell_width);
-        mCellHeight = resources.getDimensionPixelSize(R.dimen.apps_customize_cell_height);
+        mOriginalCellWidth = mCellWidth =
+            resources.getDimensionPixelSize(R.dimen.apps_customize_cell_width);
+        mOriginalCellHeight = mCellHeight =
+            resources.getDimensionPixelSize(R.dimen.apps_customize_cell_height);
         mPeekWidth = resources.getDimensionPixelSize(R.dimen.apps_customize_peek_width);
         mCellCountX = LauncherModel.getCellCountX();
         mCellCountY = LauncherModel.getCellCountY();
         mWidthGap = mHeightGap = -1;
+        mMaxGap = resources.getDimensionPixelSize(R.dimen.apps_customize_max_gap);
 
         mChildren = new PagedViewCellLayoutChildren(context);
         mChildren.setCellDimensions(mCellWidth, mCellHeight);
@@ -214,53 +221,47 @@
             throw new RuntimeException("CellLayout cannot have UNSPECIFIED dimensions");
         }
 
-        final int cellWidth = mCellWidth;
-        final int cellHeight = mCellHeight;
+
 
         int numWidthGaps = mCellCountX - 1;
         int numHeightGaps = mCellCountY - 1;
 
-        int vSpaceLeft = heightSpecSize - mPaddingTop
-                - mPaddingBottom - (cellHeight * mCellCountY);
-        int heightGap = (numHeightGaps <= 0) ? 0 : (vSpaceLeft / numHeightGaps);
+        if (mWidthGap < 0 || mHeightGap < 0) {
+            int hSpace = widthSpecSize - mPaddingLeft - mPaddingRight;
+            int vSpace = heightSpecSize - mPaddingTop - mPaddingBottom;
+            int hFreeSpace = hSpace - (mCellCountX * mOriginalCellWidth);
+            int vFreeSpace = vSpace - (mCellCountY * mOriginalCellHeight);
+            mWidthGap = Math.min(mMaxGap, numWidthGaps > 0 ? (hFreeSpace / numWidthGaps) : 0);
+            mHeightGap = Math.min(mMaxGap,numHeightGaps > 0 ? (vFreeSpace / numHeightGaps) : 0);
 
-        int hSpaceLeft = widthSpecSize - mPaddingLeft
-                - mPaddingRight - (cellWidth * mCellCountX);
-        int widthGap = (numWidthGaps <= 0) ? 0 : (hSpaceLeft / numWidthGaps);
-
-        // center it around the min gaps
-        int minGap = Math.min(widthGap, heightGap);
-        /*
-        if (minGap < heightGap) {
-            // vertical space has shrunken, so change padding accordingly
-            paddingTop += ((heightGap - minGap) * (mCellCountY - 1)) / 2;
-        } else if (minGap < widthGap) {
-            // horizontal space has shrunken, so change padding accordingly
-            paddingLeft += ((widthGap - minGap) * (mCellCountX - 1)) / 2;
-        }
-        */
-        if (mWidthGap > -1 && mHeightGap > -1) {
-            widthGap = mWidthGap;
-            heightGap = mHeightGap;
-        } else {
-            widthGap = heightGap = minGap;
+            mChildren.setGap(mWidthGap, mHeightGap);
+            mHolographicChildren.setGap(mWidthGap, mHeightGap);
         }
 
-        int newWidth = (mCellCountX * cellWidth) + ((mCellCountX - 1) * widthGap);
-        int newHeight = (mCellCountY * cellHeight) + ((mCellCountY - 1) * heightGap);
+        // Initial values correspond to widthSpecMode == MeasureSpec.EXACTLY
+        int newWidth = widthSpecSize;
+        int newHeight = heightSpecSize;
+        if (widthSpecMode == MeasureSpec.AT_MOST) {
+            newWidth = mPaddingLeft + mPaddingRight + (mCellCountX * mCellWidth) +
+                ((mCellCountX - 1) * mWidthGap);
+            newHeight = mPaddingTop + mPaddingBottom + (mCellCountY * mCellHeight) +
+                ((mCellCountY - 1) * mHeightGap);
+            setMeasuredDimension(newWidth, newHeight);
+        }
 
         final int count = getChildCount();
         for (int i = 0; i < count; i++) {
             View child = getChildAt(i);
             int childWidthMeasureSpec =
-                MeasureSpec.makeMeasureSpec(newWidth, MeasureSpec.EXACTLY);
+                MeasureSpec.makeMeasureSpec(newWidth - mPaddingLeft -
+                        mPaddingRight, MeasureSpec.EXACTLY);
             int childheightMeasureSpec =
-                MeasureSpec.makeMeasureSpec(newHeight, MeasureSpec.EXACTLY);
+                MeasureSpec.makeMeasureSpec(newHeight - mPaddingTop -
+                        mPaddingBottom, MeasureSpec.EXACTLY);
             child.measure(childWidthMeasureSpec, childheightMeasureSpec);
         }
 
-        setMeasuredDimension(newWidth + mPaddingLeft + mPaddingRight,
-            newHeight + mPaddingTop + mPaddingBottom);
+        setMeasuredDimension(newWidth, newHeight);
     }
 
     int getContentWidth() {
