diff --git a/src/com/android/launcher2/AppWidgetResizeFrame.java b/src/com/android/launcher2/AppWidgetResizeFrame.java
index eca5ad7..22bd6e6 100644
--- a/src/com/android/launcher2/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher2/AppWidgetResizeFrame.java
@@ -303,8 +303,8 @@
 
     public void snapToWidget(boolean animate) {
         final DragLayer.LayoutParams lp = (DragLayer.LayoutParams) getLayoutParams();
-        int xOffset = mCellLayout.getLeft() + mCellLayout.getLeftPadding() - mWorkspace.getScrollX();
-        int yOffset = mCellLayout.getTop() + mCellLayout.getTopPadding() - mWorkspace.getScrollY();
+        int xOffset = mCellLayout.getLeft() + mCellLayout.getPaddingLeft() - mWorkspace.getScrollX();
+        int yOffset = mCellLayout.getTop() + mCellLayout.getPaddingTop() - mWorkspace.getScrollY();
 
         int newWidth = mWidgetView.getWidth() + 2 * mBackgroundPadding - mWidgetPaddingLeft -
                 mWidgetPaddingRight;
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index c1aa2d5..8182b82 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -54,19 +54,17 @@
 public class CellLayout extends ViewGroup {
     static final String TAG = "CellLayout";
 
+    private int mOriginalCellWidth;
+    private int mOriginalCellHeight;
     private int mCellWidth;
     private int mCellHeight;
 
-    private int mLeftPadding;
-    private int mRightPadding;
-    private int mTopPadding;
-    private int mBottomPadding;
-
     private int mCountX;
     private int mCountY;
 
     private int mWidthGap;
     private int mHeightGap;
+    private int mMaxGap;
 
     private final Rect mRect = new Rect();
     private final CellInfo mCellInfo = new CellInfo();
@@ -148,19 +146,13 @@
 
         TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CellLayout, defStyle, 0);
 
-        mCellWidth = a.getDimensionPixelSize(R.styleable.CellLayout_cellWidth, 10);
-        mCellHeight = a.getDimensionPixelSize(R.styleable.CellLayout_cellHeight, 10);
-        mWidthGap = a.getDimensionPixelSize(R.styleable.CellLayout_widthGap, -1);
-        mHeightGap = a.getDimensionPixelSize(R.styleable.CellLayout_heightGap, -1);
-
-        mLeftPadding =
-            a.getDimensionPixelSize(R.styleable.CellLayout_xAxisStartPadding, 10);
-        mRightPadding =
-            a.getDimensionPixelSize(R.styleable.CellLayout_xAxisEndPadding, 10);
-        mTopPadding =
-            a.getDimensionPixelSize(R.styleable.CellLayout_yAxisStartPadding, 10);
-        mBottomPadding =
-            a.getDimensionPixelSize(R.styleable.CellLayout_yAxisEndPadding, 10);
+        mOriginalCellWidth =
+            mCellWidth = a.getDimensionPixelSize(R.styleable.CellLayout_cellWidth, 10);
+        mOriginalCellHeight =
+            mCellHeight = a.getDimensionPixelSize(R.styleable.CellLayout_cellHeight, 10);
+        mWidthGap = a.getDimensionPixelSize(R.styleable.CellLayout_widthGap, 0);
+        mHeightGap = a.getDimensionPixelSize(R.styleable.CellLayout_heightGap, 0);
+        mMaxGap = a.getDimensionPixelSize(R.styleable.CellLayout_maxGap, 0);
 
         mCountX = LauncherModel.getCellCountX();
         mCountY = LauncherModel.getCellCountY();
@@ -275,9 +267,10 @@
         // have. We ignore the left/right padding on CellLayout because it turns out in our design
         // the padding extends outside the visible screen size, but it looked fine anyway.
         int cellWidth = r.getDimensionPixelSize(R.dimen.workspace_cell_width);
-        int widthGap = r.getDimensionPixelSize(R.dimen.workspace_width_gap_port);
+        int minGap = Math.min(r.getDimensionPixelSize(R.dimen.workspace_width_gap),
+                r.getDimensionPixelSize(R.dimen.workspace_height_gap));
 
-        return  widthGap * (numCells - 1) + cellWidth * numCells;
+        return  minGap * (numCells - 1) + cellWidth * numCells;
     }
 
     static int heightInLandscape(Resources r, int numCells) {
@@ -285,9 +278,10 @@
         // have. We ignore the left/right padding on CellLayout because it turns out in our design
         // the padding extends outside the visible screen size, but it looked fine anyway.
         int cellHeight = r.getDimensionPixelSize(R.dimen.workspace_cell_height);
-        int heightGap = r.getDimensionPixelSize(R.dimen.workspace_height_gap_land);
+        int minGap = Math.min(r.getDimensionPixelSize(R.dimen.workspace_width_gap),
+                r.getDimensionPixelSize(R.dimen.workspace_height_gap));
 
-        return heightGap * (numCells - 1) + cellHeight * numCells;
+        return minGap * (numCells - 1) + cellHeight * numCells;
     }
 
     public void enableHardwareLayers() {
@@ -303,10 +297,10 @@
 
     private void invalidateBubbleTextView(BubbleTextView icon) {
         final int padding = icon.getPressedOrFocusedBackgroundPadding();
-        invalidate(icon.getLeft() + getLeftPadding() - padding,
-                icon.getTop() + getTopPadding() - padding,
-                icon.getRight() + getLeftPadding() + padding,
-                icon.getBottom() + getTopPadding() + padding);
+        invalidate(icon.getLeft() + getPaddingLeft() - padding,
+                icon.getTop() + getPaddingTop() - padding,
+                icon.getRight() + getPaddingLeft() + padding,
+                icon.getBottom() + getPaddingTop() + padding);
     }
 
     void setPressedOrFocusedIcon(BubbleTextView icon) {
@@ -480,9 +474,9 @@
             final int width = d.getIntrinsicWidth();
             final int height = d.getIntrinsicHeight();
 
-            int x = getLeftPadding() - (mWidthGap / 2) - (width / 2);
+            int x = getPaddingLeft() - (mWidthGap / 2) - (width / 2);
             for (int col = 0; col <= countX; col++) {
-                int y = getTopPadding() - (mHeightGap / 2) - (height / 2);
+                int y = getPaddingTop() - (mHeightGap / 2) - (height / 2);
                 for (int row = 0; row <= countY; row++) {
                     mTmpPointF.set(x - mDragCenter.x, y - mDragCenter.y);
                     float dist = mTmpPointF.length();
@@ -518,8 +512,8 @@
             final Bitmap b = mPressedOrFocusedIcon.getPressedOrFocusedBackground();
             if (b != null) {
                 canvas.drawBitmap(b,
-                        mPressedOrFocusedIcon.getLeft() + getLeftPadding() - padding,
-                        mPressedOrFocusedIcon.getTop() + getTopPadding() - padding,
+                        mPressedOrFocusedIcon.getLeft() + getPaddingLeft() - padding,
+                        mPressedOrFocusedIcon.getTop() + getPaddingTop() - padding,
                         null);
             }
         }
@@ -668,7 +662,7 @@
                 // to this view.
                 final int tmpXY[] = mTmpXY;
                 child.getLocationOnScreen(tmpXY);
-                frame.offset(mLeftPadding, mTopPadding);
+                frame.offset(mPaddingLeft, mPaddingTop);
 
                 if (frame.contains(x, y)) {
                     cellInfo.cell = child;
@@ -733,8 +727,8 @@
      * @param result Array of 2 ints to hold the x and y coordinate of the cell
      */
     void pointToCellExact(int x, int y, int[] result) {
-        final int hStartPadding = getLeftPadding();
-        final int vStartPadding = getTopPadding();
+        final int hStartPadding = getPaddingLeft();
+        final int vStartPadding = getPaddingTop();
 
         result[0] = (x - hStartPadding) / (mCellWidth + mWidthGap);
         result[1] = (y - vStartPadding) / (mCellHeight + mHeightGap);
@@ -767,8 +761,8 @@
      * @param result Array of 2 ints to hold the x and y coordinate of the point
      */
     void cellToPoint(int cellX, int cellY, int[] result) {
-        final int hStartPadding = getLeftPadding();
-        final int vStartPadding = getTopPadding();
+        final int hStartPadding = getPaddingLeft();
+        final int vStartPadding = getPaddingTop();
 
         result[0] = hStartPadding + cellX * (mCellWidth + mWidthGap);
         result[1] = vStartPadding + cellY * (mCellHeight + mHeightGap);
@@ -783,8 +777,8 @@
      * @param result Array of 2 ints to hold the x and y coordinate of the point
      */
     void cellToCenterPoint(int cellX, int cellY, int[] result) {
-        final int hStartPadding = getLeftPadding();
-        final int vStartPadding = getTopPadding();
+        final int hStartPadding = getPaddingLeft();
+        final int vStartPadding = getPaddingTop();
 
         result[0] = hStartPadding + cellX * (mCellWidth + mWidthGap) + mCellWidth / 2;
         result[1] = vStartPadding + cellY * (mCellHeight + mHeightGap) + mCellHeight / 2;
@@ -806,30 +800,14 @@
         return mHeightGap;
     }
 
-    int getLeftPadding() {
-        return mLeftPadding;
-    }
-
-    int getTopPadding() {
-        return mTopPadding;
-    }
-
-    int getRightPadding() {
-        return mRightPadding;
-    }
-
-    int getBottomPadding() {
-        return mBottomPadding;
-    }
-
     Rect getContentRect(Rect r) {
         if (r == null) {
             r = new Rect();
         }
         int left = getPaddingLeft();
         int top = getPaddingTop();
-        int right = left + getWidth() - mLeftPadding - mRightPadding;
-        int bottom = top + getHeight() - mTopPadding - mBottomPadding;
+        int right = left + getWidth() - mPaddingLeft - mPaddingRight;
+        int bottom = top + getHeight() - mPaddingTop - mPaddingBottom;
         r.set(left, top, right, bottom);
         return r;
     }
@@ -848,31 +826,31 @@
             throw new RuntimeException("CellLayout cannot have UNSPECIFIED dimensions");
         }
 
-        final int cellWidth = mCellWidth;
-        final int cellHeight = mCellHeight;
-
         int numWidthGaps = mCountX - 1;
         int numHeightGaps = mCountY - 1;
 
         if (mWidthGap < 0 || mHeightGap < 0) {
-            int vSpaceLeft = heightSpecSize - mTopPadding - mBottomPadding - (cellHeight * mCountY);
-            mHeightGap = numHeightGaps > 0 ? vSpaceLeft / numHeightGaps : 0;
+            int hSpace = widthSpecSize - mPaddingLeft - mPaddingRight;
+            int vSpace = heightSpecSize - mPaddingTop - mPaddingBottom;
+            int hFreeSpace = hSpace - (mCountX * mOriginalCellWidth);
+            int vFreeSpace = vSpace - (mCountY * mOriginalCellHeight);
+            mWidthGap = Math.min(mMaxGap, numWidthGaps > 0 ? (hFreeSpace / numWidthGaps) : 0);
+            mHeightGap = Math.min(mMaxGap,numHeightGaps > 0 ? (vFreeSpace / numHeightGaps) : 0);
+            int remainingHSpace = hFreeSpace - (numWidthGaps * mWidthGap);
+            int remainingVSpace = vFreeSpace - (numHeightGaps * mHeightGap);
+            mCellWidth = mOriginalCellWidth + remainingHSpace / mCountX;
+            mCellHeight = mOriginalCellHeight + remainingVSpace / mCountY;
 
-            int hSpaceLeft = widthSpecSize - mLeftPadding - mRightPadding - (cellWidth * mCountX);
-            mWidthGap = numWidthGaps > 0 ? hSpaceLeft / numWidthGaps : 0;
-
-            // center it around the min gaps
-            int minGap = Math.min(mWidthGap, mHeightGap);
-            mWidthGap = mHeightGap = minGap;
+            mChildren.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
         }
 
         // Initial values correspond to widthSpecMode == MeasureSpec.EXACTLY
         int newWidth = widthSpecSize;
         int newHeight = heightSpecSize;
         if (widthSpecMode == MeasureSpec.AT_MOST) {
-            newWidth = mLeftPadding + mRightPadding + (mCountX * cellWidth) +
+            newWidth = mPaddingLeft + mPaddingRight + (mCountX * mCellWidth) +
                 ((mCountX - 1) * mWidthGap);
-            newHeight = mTopPadding + mBottomPadding + (mCountY * cellHeight) +
+            newHeight = mPaddingTop + mPaddingBottom + (mCountY * mCellHeight) +
                 ((mCountY - 1) * mHeightGap);
             setMeasuredDimension(newWidth, newHeight);
         }
@@ -880,10 +858,10 @@
         int count = getChildCount();
         for (int i = 0; i < count; i++) {
             View child = getChildAt(i);
-            int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(newWidth - mLeftPadding -
-                    mRightPadding, MeasureSpec.EXACTLY);
-            int childheightMeasureSpec = MeasureSpec.makeMeasureSpec(newHeight - mTopPadding -
-                    mBottomPadding, MeasureSpec.EXACTLY);
+            int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(newWidth - mPaddingLeft -
+                    mPaddingRight, MeasureSpec.EXACTLY);
+            int childheightMeasureSpec = MeasureSpec.makeMeasureSpec(newHeight - mPaddingTop -
+                    mPaddingBottom, MeasureSpec.EXACTLY);
             child.measure(childWidthMeasureSpec, childheightMeasureSpec);
         }
         setMeasuredDimension(newWidth, newHeight);
@@ -894,7 +872,8 @@
         int count = getChildCount();
         for (int i = 0; i < count; i++) {
             View child = getChildAt(i);
-            child.layout(mLeftPadding, mTopPadding, r - l - mRightPadding , b - t - mBottomPadding);
+            child.layout(mPaddingLeft, mPaddingTop,
+                    r - l - mPaddingRight, b - t - mPaddingBottom);
         }
     }
 
@@ -1460,8 +1439,8 @@
         final int widthGap = mWidthGap;
         final int heightGap = mHeightGap;
 
-        final int hStartPadding = getLeftPadding();
-        final int vStartPadding = getTopPadding();
+        final int hStartPadding = getPaddingLeft();
+        final int vStartPadding = getPaddingTop();
 
         int width = cellHSpan * cellWidth + ((cellHSpan - 1) * widthGap);
         int height = cellVSpan * cellHeight + ((cellVSpan - 1) * heightGap);
@@ -1656,12 +1635,12 @@
     }
 
     public int getDesiredWidth() {
-        return mLeftPadding + mRightPadding + (mCountX * mCellWidth) +
+        return mPaddingLeft + mPaddingRight + (mCountX * mCellWidth) +
                 (Math.max((mCountX - 1), 0) * mWidthGap);
     }
 
     public int getDesiredHeight()  {
-        return mTopPadding + mBottomPadding + (mCountY * mCellHeight) +
+        return mPaddingTop + mPaddingBottom + (mCountY * mCellHeight) +
                 (Math.max((mCountY - 1), 0) * mHeightGap);
     }
 
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 5d85957..2dfce62 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2109,10 +2109,10 @@
 
         int width = cell.getWidth();
         int height = cell.getHeight();
-        int x = cell.getLeftPadding();
-        int y = cell.getTopPadding();
-        width -= (x + cell.getRightPadding());
-        height -= (y + cell.getBottomPadding());
+        int x = cell.getPaddingLeft();
+        int y = cell.getPaddingTop();
+        width -= (x + cell.getPaddingRight());
+        height -= (y + cell.getPaddingBottom());
 
         float scale = w / width;
 
@@ -2135,7 +2135,7 @@
 
             final Canvas c = new Canvas(bitmap);
             c.scale(scale, scale);
-            c.translate(-cell.getLeftPadding(), -cell.getTopPadding());
+            c.translate(-cell.getPaddingLeft(), -cell.getPaddingTop());
             cell.drawChildren(c);
 
             image.setBackgroundDrawable(resources.getDrawable(R.drawable.preview_background));
diff --git a/src/com/android/launcher2/Utilities.java b/src/com/android/launcher2/Utilities.java
index 04abd77..7758333 100644
--- a/src/com/android/launcher2/Utilities.java
+++ b/src/com/android/launcher2/Utilities.java
@@ -114,7 +114,7 @@
                         width = (int) (height * ratio);
                     }
                 } else if (sourceWidth < width && sourceHeight < height) {
-                    // It's small, use the size they gave us.
+                    // Don't scale up the icon
                     width = sourceWidth;
                     height = sourceHeight;
                 }
@@ -224,7 +224,7 @@
         if (LauncherApplication.isScreenLarge()) {
             sIconContentSize = (int) resources.getDimension(R.dimen.app_icon_content_size);
         }
-        sIconTextureWidth = sIconTextureHeight = sIconWidth + 2;
+        sIconTextureWidth = sIconTextureHeight = sIconWidth;
 
         sBlurPaint.setMaskFilter(new BlurMaskFilter(5 * density, BlurMaskFilter.Blur.NORMAL));
         sGlowColorPressedPaint.setColor(0xffffc300);
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 7818ef4..005bd27 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -2238,8 +2238,8 @@
 
         // Set its old pos (in the new parent's coordinates); it will be animated
         // in animateViewIntoPosition after the next layout pass
-        lp.oldX = viewX - (layout.getLeft() + layout.getLeftPadding() - mScrollX);
-        lp.oldY = viewY - (layout.getTop() + layout.getTopPadding() - mScrollY);
+        lp.oldX = viewX - (layout.getLeft() + layout.getPaddingLeft() - mScrollX);
+        lp.oldY = viewY - (layout.getTop() + layout.getPaddingTop() - mScrollY);
     }
 
     public void animateViewIntoPosition(final View view, final int fromX, final int fromY, 
@@ -2301,8 +2301,8 @@
         final CellLayout.LayoutParams lp = (CellLayout.LayoutParams) view.getLayoutParams();
 
         // Convert the animation params to be relative to the Workspace, not the CellLayout
-        final int fromX = lp.oldX + parent.getLeft() + parent.getLeftPadding();
-        final int fromY = lp.oldY + parent.getTop() + parent.getTopPadding();
+        final int fromX = lp.oldX + parent.getLeft() + parent.getPaddingLeft();
+        final int fromY = lp.oldY + parent.getTop() + parent.getPaddingTop();
 
         final int dx = lp.x - lp.oldX;
         final int dy = lp.y - lp.oldY;
