Merge "Import revised translations.  DO NOT MERGE" into ics-mr0
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 4103141..d8ff73c 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -643,12 +643,14 @@
     private void updateCurrentTab(int currentPage) {
         AppsCustomizeTabHost tabHost = getTabHost();
         String tag = tabHost.getCurrentTabTag();
-        if (currentPage >= mNumAppsPages &&
-                !tag.equals(tabHost.getTabTagForContentType(ContentType.Widgets))) {
-            tabHost.setCurrentTabFromContent(ContentType.Widgets);
-        } else if (currentPage < mNumAppsPages &&
-                !tag.equals(tabHost.getTabTagForContentType(ContentType.Applications))) {
-            tabHost.setCurrentTabFromContent(ContentType.Applications);
+        if (tag != null) {
+            if (currentPage >= mNumAppsPages &&
+                    !tag.equals(tabHost.getTabTagForContentType(ContentType.Widgets))) {
+                tabHost.setCurrentTabFromContent(ContentType.Widgets);
+            } else if (currentPage < mNumAppsPages &&
+                    !tag.equals(tabHost.getTabTagForContentType(ContentType.Applications))) {
+                tabHost.setCurrentTabFromContent(ContentType.Applications);
+            }
         }
     }
 
@@ -1367,8 +1369,10 @@
     public void reset() {
         AppsCustomizeTabHost tabHost = getTabHost();
         String tag = tabHost.getCurrentTabTag();
-        if (!tag.equals(tabHost.getTabTagForContentType(ContentType.Applications))) {
-            tabHost.setCurrentTabFromContent(ContentType.Applications);
+        if (tag != null) {
+            if (!tag.equals(tabHost.getTabTagForContentType(ContentType.Applications))) {
+                tabHost.setCurrentTabFromContent(ContentType.Applications);
+            }
         }
         if (mCurrentPage != 0) {
             invalidatePageData(0);
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index 8d67e5d..688ea15 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -167,6 +167,14 @@
         mAppsCustomizePane.hideScrollingIndicator(false);
     }
 
+    private void reloadCurrentPage() {
+        if (!LauncherApplication.isScreenLarge()) {
+            mAppsCustomizePane.flashScrollingIndicator();
+        }
+        mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage());
+        mAppsCustomizePane.requestFocus();
+    }
+
     private void onTabChangedEnd(AppsCustomizePagedView.ContentType type) {
         mAppsCustomizePane.setContentType(type);
     }
@@ -188,6 +196,12 @@
         post(new Runnable() {
             @Override
             public void run() {
+                if (mAppsCustomizePane.getMeasuredWidth() <= 0 ||
+                        mAppsCustomizePane.getMeasuredHeight() <= 0) {
+                    reloadCurrentPage();
+                    return;
+                }
+
                 // Setup the animation buffer
                 Bitmap b = Bitmap.createBitmap(mAppsCustomizePane.getMeasuredWidth(),
                         mAppsCustomizePane.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
@@ -217,12 +231,7 @@
                 inAnim.addListener(new AnimatorListenerAdapter() {
                     @Override
                     public void onAnimationEnd(Animator animation) {
-                        if (!LauncherApplication.isScreenLarge()) {
-                            mAppsCustomizePane.flashScrollingIndicator();
-                        }
-                        mAppsCustomizePane.loadAssociatedPages(
-                                mAppsCustomizePane.getCurrentPage());
-                        mAppsCustomizePane.requestFocus();
+                        reloadCurrentPage();
                     }
                 });
                 AnimatorSet animSet = new AnimatorSet();