Setting min width of content in customize tray automatically
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java
index 3dfa7c2..55b22fc 100644
--- a/src/com/android/launcher2/CustomizePagedView.java
+++ b/src/com/android/launcher2/CustomizePagedView.java
@@ -172,12 +172,12 @@
         final Resources r = context.getResources();
         setDragSlopeThreshold(
                 r.getInteger(R.integer.config_customizationDrawerDragSlopeThreshold) / 100.0f);
-        mMinPageWidth = r.getDimensionPixelSize(R.dimen.customization_drawer_content_min_width);
 
         // Create a dummy page and set it up to find out the content width (used by our parent)
         PagedViewCellLayout layout = new PagedViewCellLayout(getContext());
         setupPage(layout);
         mPageContentWidth = layout.getContentWidth();
+        mMinPageWidth = layout.getWidthBeforeFirstLayout();
 
         setVisibility(View.GONE);
         setSoundEffectsEnabled(false);
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index 53657e5..b94be4d 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -247,9 +247,12 @@
         // Return the distance from the left edge of the content of the leftmost icon to
         // the right edge of the content of the rightmost icon
 
-        // icons are centered within cells, find out how much offset that accounts for
-        int iconHorizontalOffset = (mCellWidth - Utilities.getIconContentSize());
-        return mCellCountX * mCellWidth + (mCellCountX - 1) * mWidthGap - iconHorizontalOffset;
+        // icons are centered within cells, find out how much padding that accounts for
+        return getWidthBeforeLayout() - (mCellWidth - Utilities.getIconContentSize());
+    }
+
+    int getWidthBeforeLayout() {
+        return mCellCountX * mCellWidth + (mCellCountX - 1) * mWidthGap;
     }
 
     @Override