Switched to tabbed version of AllApps2D on xlarge screens.

- add a temporary new zoom animation for all apps
- modify AllApps2D to allow it to be transparent
- other changes to dismiss the customization drawer when appropriate

Change-Id: I5660ab77f256ded299c1721c589983a1b30d56a4
diff --git a/src/com/android/launcher2/AllApps2D.java b/src/com/android/launcher2/AllApps2D.java
index b18fc1a..b993364 100644
--- a/src/com/android/launcher2/AllApps2D.java
+++ b/src/com/android/launcher2/AllApps2D.java
@@ -16,15 +16,15 @@
 
 package com.android.launcher2;
 
-import java.util.ArrayList;
-import java.util.Collections;
+import com.android.launcher.R;
 
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.res.Resources;
-import android.graphics.drawable.BitmapDrawable;
 import android.graphics.Bitmap;
-import android.graphics.Color;
+import android.graphics.PixelFormat;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.KeyEvent;
@@ -39,7 +39,8 @@
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
-import com.android.launcher.R;
+import java.util.ArrayList;
+import java.util.Collections;
 
 public class AllApps2D
         extends RelativeLayout
@@ -67,6 +68,8 @@
 
     private AppsAdapter mAppsAdapter;
 
+    private boolean mIsViewOpaque;
+
     // ------------------------------------------------------------
     
     public static class HomeButton extends ImageButton {
@@ -125,24 +128,24 @@
 
     @Override
     protected void onFinishInflate() {
-        setBackgroundColor(Color.BLACK);
+        mIsViewOpaque = super.isOpaque();
 
         try {
             mGrid = (GridView)findViewWithTag("all_apps_2d_grid");
             if (mGrid == null) throw new Resources.NotFoundException();
             mGrid.setOnItemClickListener(this);
             mGrid.setOnItemLongClickListener(this);
-            mGrid.setBackgroundColor(Color.BLACK);
-            mGrid.setCacheColorHint(Color.BLACK);
             
+            // The home button is optional; some layouts might not use it
             ImageButton homeButton = (ImageButton) findViewWithTag("all_apps_2d_home");
-            if (homeButton == null) throw new Resources.NotFoundException();
-            homeButton.setOnClickListener(
-                new View.OnClickListener() {
-                    public void onClick(View v) {
-                        mLauncher.closeAllApps(true);
-                    }
-                });
+            if (homeButton != null) {
+                homeButton.setOnClickListener(
+                    new View.OnClickListener() {
+                        public void onClick(View v) {
+                            mLauncher.closeAllApps(true);
+                        }
+                    });
+            }
         } catch (Resources.NotFoundException e) {
             Log.e(TAG, "Can't find necessary layout elements for AllApps2D");
         }
@@ -251,7 +254,7 @@
 
     @Override
     public boolean isOpaque() {
-        return mZoom > 0.999f;
+        return mIsViewOpaque && mZoom > 0.999f;
     }
 
     public void setApps(ArrayList<ApplicationInfo> list) {