merge in honeycomb-mr2-release history after reset to honeycomb-mr2
diff --git a/res/values-xlarge-port/styles.xml b/res/values-xlarge-port/styles.xml
new file mode 100644
index 0000000..2c5f5bb
--- /dev/null
+++ b/res/values-xlarge-port/styles.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2011 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+-->
+
+<resources>
+    <style name="CustomizeTabIndicator.Wide" parent="TabIndicator.Wide">
+        <item name="android:paddingLeft">20dp</item>
+        <item name="android:paddingRight">20dp</item>
+    </style>
+</resources>
diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java
index fd5979f..36ff8e1 100644
--- a/src/com/android/launcher2/AllAppsPagedView.java
+++ b/src/com/android/launcher2/AllAppsPagedView.java
@@ -174,7 +174,9 @@
 
         availableHeight -= mPageLayoutPaddingTop + mPageLayoutPaddingBottom;
         availableHeight -= cellHeight; // Assume at least one row
-        availableHeight -= screenHeight * 0.16f;
+        Resources r = getContext().getResources();
+        float scaleFactor = r.getInteger(R.integer.config_allAppsZoomScaleFactor) / 100f;
+        availableHeight -= screenHeight * scaleFactor;
         if (availableHeight > 0) {
             return Math.min(mMaxCellCountY,
                     1 + availableHeight / (cellHeight + mPageLayoutHeightGap));
diff --git a/src/com/android/launcher2/CustomizeTrayTabHost.java b/src/com/android/launcher2/CustomizeTrayTabHost.java
index e1ba700..c261bfb 100644
--- a/src/com/android/launcher2/CustomizeTrayTabHost.java
+++ b/src/com/android/launcher2/CustomizeTrayTabHost.java
@@ -81,7 +81,7 @@
                 .setIndicator(tabView).setContent(contentFactory));
         tabView = (TextView) mInflater.inflate(
                 R.layout.customize_tab_widget_indicator, tabWidget, false);
-        tabView.setText(mContext.getString(R.string.applications_tab_label));
+        tabView.setText(mContext.getString(R.string.all_apps_tab_apps));
         addTab(newTabSpec(APPLICATIONS_TAG)
                 .setIndicator(tabView).setContent(contentFactory));
         tabView = (TextView) mInflater.inflate(
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index 1ba5c05..d715ee3 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -189,8 +189,6 @@
     }
 
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        // TODO: currently ignoring padding
-
         int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec);
         int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
 
@@ -233,10 +231,8 @@
             widthGap = heightGap = minGap;
         }
 
-        int newWidth = mPaddingLeft + mPaddingRight + (mCellCountX * cellWidth) +
-            ((mCellCountX - 1) * widthGap);
-        int newHeight = mPaddingTop + mPaddingBottom + (mCellCountY * cellHeight) +
-            ((mCellCountY - 1) * heightGap);
+        int newWidth = (mCellCountX * cellWidth) + ((mCellCountX - 1) * widthGap);
+        int newHeight = (mCellCountY * cellHeight) + ((mCellCountY - 1) * heightGap);
 
         final int count = getChildCount();
         for (int i = 0; i < count; i++) {
@@ -248,7 +244,8 @@
             child.measure(childWidthMeasureSpec, childheightMeasureSpec);
         }
 
-        setMeasuredDimension(newWidth, newHeight);
+        setMeasuredDimension(newWidth + mPaddingLeft + mPaddingRight,
+            newHeight + mPaddingTop + mPaddingBottom);
     }
 
     int getContentWidth() {
@@ -278,7 +275,8 @@
         int count = getChildCount();
         for (int i = 0; i < count; i++) {
             View child = getChildAt(i);
-            child.layout(0, 0, r - l, b - t);
+            child.layout(mPaddingLeft, mPaddingTop,
+                r - l - mPaddingRight, b - t - mPaddingBottom);
         }
     }
 
diff --git a/src/com/android/launcher2/PagedViewCellLayoutChildren.java b/src/com/android/launcher2/PagedViewCellLayoutChildren.java
index 92ff461..0907c60 100644
--- a/src/com/android/launcher2/PagedViewCellLayoutChildren.java
+++ b/src/com/android/launcher2/PagedViewCellLayoutChildren.java
@@ -92,8 +92,8 @@
             PagedViewCellLayout.LayoutParams lp =
                 (PagedViewCellLayout.LayoutParams) child.getLayoutParams();
             lp.setup(mCellWidth, mCellHeight, mWidthGap, mHeightGap,
-                    ((ViewGroup)getParent()).getPaddingLeft(),
-                    ((ViewGroup)getParent()).getPaddingTop());
+                    getPaddingLeft(),
+                    getPaddingTop());
 
             int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(lp.width,
                     MeasureSpec.EXACTLY);
@@ -111,18 +111,21 @@
         int count = getChildCount();
 
         int offsetX = 0;
-        if (mCenterContent) {
+        if (mCenterContent && count > 0) {
             // determine the max width of all the rows and center accordingly
-            int maxRowWidth = 0;
+            int maxRowX = 0;
+            int minRowX = Integer.MAX_VALUE;
             for (int i = 0; i < count; i++) {
                 View child = getChildAt(i);
                 if (child.getVisibility() != GONE) {
                     PagedViewCellLayout.LayoutParams lp =
                         (PagedViewCellLayout.LayoutParams) child.getLayoutParams();
-                    maxRowWidth = Math.max(maxRowWidth, lp.x + lp.width);
+                    minRowX = Math.min(minRowX, lp.x);
+                    maxRowX = Math.max(maxRowX, lp.x + lp.width);
                 }
             }
-            offsetX = (getMeasuredWidth() / 2) - (maxRowWidth / 2);
+            int maxRowWidth = maxRowX - minRowX;
+            offsetX = (getMeasuredWidth() - maxRowWidth) / 2;
         }
 
         for (int i = 0; i < count; i++) {