Merge "Import revised translations.  DO NOT MERGE" into honeycomb-mr2
diff --git a/res/layout-large/customize_tab_widget_indicator.xml b/res/layout-large/customize_tab_widget_indicator.xml
new file mode 100644
index 0000000..39f0867
--- /dev/null
+++ b/res/layout-large/customize_tab_widget_indicator.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+
+<TextView
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    style="@style/CustomizeTabIndicator.Wide" />
diff --git a/res/values-large-port/styles.xml b/res/values-large-port/styles.xml
new file mode 100644
index 0000000..ba23a89
--- /dev/null
+++ b/res/values-large-port/styles.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 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>
+        <item name="android:paddingTop">12dp</item>
+        <item name="android:paddingBottom">16dp</item>
+        <item name="android:textSize">16sp</item>
+    </style>
+</resources>
diff --git a/res/values-large/styles.xml b/res/values-large/styles.xml
index 7208d97..266a01e 100644
--- a/res/values-large/styles.xml
+++ b/res/values-large/styles.xml
@@ -41,4 +41,15 @@
         <item name="android:paddingTop">0dip</item>
         <item name="android:includeFontPadding">false</item>
     </style>
+
+    <style name="TabIndicator.Wide">
+        <item name="android:paddingLeft">40dp</item>
+        <item name="android:paddingRight">40dp</item>
+        <item name="android:paddingTop">15dp</item>
+        <item name="android:paddingBottom">20dp</item>
+        <item name="android:textSize">20sp</item>
+    </style>
+
+    <style name="CustomizeTabIndicator.Wide" parent="TabIndicator.Wide">
+    </style>
 </resources>
diff --git a/res/values-xlarge/styles.xml b/res/values-xlarge/styles.xml
new file mode 100644
index 0000000..fdf2f19
--- /dev/null
+++ b/res/values-xlarge/styles.xml
@@ -0,0 +1,23 @@
+<?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">
+    </style>
+</resources>
diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java
index 01cf920..28f44e4 100644
--- a/src/com/android/launcher2/AllAppsPagedView.java
+++ b/src/com/android/launcher2/AllAppsPagedView.java
@@ -69,6 +69,7 @@
 
     private int mLastMeasureWidth = -1;
     private int mLastMeasureHeight = -1;
+    private boolean mWaitingToInitPages = true;
 
     private int mMaxCellCountY;
 
@@ -121,13 +122,16 @@
             mCellCountY = determineCellCountY(height, layout);
             mLastMeasureWidth = width;
             mLastMeasureHeight = height;
+            removeAllViews();
+            invalidatePageData();
         }
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
     }
 
     @Override
     protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        if (mFirstLayout) {
+        if (mWaitingToInitPages) {
+            mWaitingToInitPages = false;
             invalidatePageData();
 
             // invalidatePageData() is what causes the child pages to be created. We need the
@@ -548,12 +552,17 @@
     }
 
     @Override
-    public void syncPages() {
-        if (mCellCountX <= 0 || mCellCountY <= 0) {
+    protected void invalidatePageData() {
+        if (mWaitingToInitPages || mCellCountX <= 0 || mCellCountY <= 0) {
             // We don't know our size yet, which means we haven't calculated cell count x/y;
             // onMeasure will call us once we figure out our size
             return;
         }
+        super.invalidatePageData();
+    }
+
+    @Override
+    public void syncPages() {
         // ensure that we have the right number of pages (min of 1, since we have placeholders)
         int numPages = Math.max(1,
                 (int) Math.ceil((float) mFilteredApps.size() / (mCellCountX * mCellCountY)));
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java
index 406d634..f803856 100644
--- a/src/com/android/launcher2/CustomizePagedView.java
+++ b/src/com/android/launcher2/CustomizePagedView.java
@@ -151,6 +151,8 @@
 
     private AllAppsPagedView mAllAppsPagedView;
 
+    private boolean mWaitingToInitPages = true;
+
     public CustomizePagedView(Context context) {
         this(context, null, 0);
     }
@@ -208,6 +210,8 @@
             mPageContentWidth = layout.getContentWidth();
             mPageContentHeight = layout.getContentHeight();
             mMinPageWidth = layout.getWidthBeforeFirstLayout();
+            removeAllViews();
+            invalidatePageData();
         }
         if (mPageContentHeight > 0) {
             // Lock our height to the size of the page content
@@ -220,7 +224,8 @@
 
     @Override
     protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        if (mFirstLayout) {
+        if (mWaitingToInitPages) {
+            mWaitingToInitPages = false;
             invalidatePageData();
 
             // invalidatePageData() is what causes the child pages to be created. We need the
@@ -1140,12 +1145,17 @@
     }
 
     @Override
-    public void syncPages() {
-        if (mFirstMeasure) {
+    protected void invalidatePageData() {
+        if (mWaitingToInitPages || mCellCountX <= 0 || mCellCountY <= 0) {
             // We don't know our size yet, which means we haven't calculated cell count x/y;
             // onMeasure will call us once we figure out our size
             return;
         }
+        super.invalidatePageData();
+    }
+
+    @Override
+    public void syncPages() {
         boolean enforceMinimumPagedWidths = false;
         boolean centerPagedViewCellLayouts = false;
         switch (mCustomizationType) {
diff --git a/src/com/android/launcher2/CustomizeTrayTabHost.java b/src/com/android/launcher2/CustomizeTrayTabHost.java
index b6c55f8..e1ba700 100644
--- a/src/com/android/launcher2/CustomizeTrayTabHost.java
+++ b/src/com/android/launcher2/CustomizeTrayTabHost.java
@@ -74,18 +74,23 @@
         TextView tabView;
         TabWidget tabWidget = (TabWidget) findViewById(com.android.internal.R.id.tabs);
 
-        tabView = (TextView) mInflater.inflate(R.layout.tab_widget_indicator, tabWidget, false);
+        tabView = (TextView) mInflater.inflate(
+                R.layout.customize_tab_widget_indicator, tabWidget, false);
         tabView.setText(mContext.getString(R.string.widgets_tab_label));
-        addTab(newTabSpec(WIDGETS_TAG).setIndicator(tabView).setContent(contentFactory));
-        tabView = (TextView) mInflater.inflate(R.layout.tab_widget_indicator, tabWidget, false);
+        addTab(newTabSpec(WIDGETS_TAG)
+                .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));
         addTab(newTabSpec(APPLICATIONS_TAG)
                 .setIndicator(tabView).setContent(contentFactory));
-        tabView = (TextView) mInflater.inflate(R.layout.tab_widget_indicator, tabWidget, false);
+        tabView = (TextView) mInflater.inflate(
+                R.layout.customize_tab_widget_indicator, tabWidget, false);
         tabView.setText(mContext.getString(R.string.wallpapers_tab_label));
         addTab(newTabSpec(WALLPAPERS_TAG)
                 .setIndicator(tabView).setContent(contentFactory));
-        tabView = (TextView) mInflater.inflate(R.layout.tab_widget_indicator, tabWidget, false);
+        tabView = (TextView) mInflater.inflate(
+                R.layout.customize_tab_widget_indicator, tabWidget, false);
         tabView.setText(mContext.getString(R.string.shortcuts_tab_label));
         addTab(newTabSpec(SHORTCUTS_TAG)
                 .setIndicator(tabView).setContent(contentFactory));
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 2dd145d..aa6bef4 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -111,8 +111,8 @@
     protected int mPageLayoutWidthGap;
     protected int mPageLayoutHeightGap;
     protected int mPageLayoutMaxHeight;
-    protected int mCellCountX = -1;
-    protected int mCellCountY = -1;
+    protected int mCellCountX = 0;
+    protected int mCellCountY = 0;
     protected boolean mCenterPagesVertically;
     protected boolean mAllowOverScroll = true;
     protected int mUnboundedScrollX;