Improving performance of state transitions

- Caching CellLayouts to bitmaps when they're small again
- Enabling hardware layers on customize tray/all apps during transition

Change-Id: Ia4f5f7b608a9d013ed48b990551fd1b9de503b32
diff --git a/src/com/android/launcher2/CachedViewGroup.java b/src/com/android/launcher2/CachedViewGroup.java
index b5cfd60..f314b32 100644
--- a/src/com/android/launcher2/CachedViewGroup.java
+++ b/src/com/android/launcher2/CachedViewGroup.java
@@ -26,6 +26,7 @@
 import android.graphics.Rect;
 import android.graphics.Bitmap.Config;
 import android.graphics.PorterDuff.Mode;
+import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewGroup;
 
@@ -52,6 +53,15 @@
 
     public CachedViewGroup(Context context) {
         super(context);
+        init();
+    }
+
+    public CachedViewGroup(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+        init();
+    }
+
+    private void init() {
         mBackgroundRect = new Rect();
         mCacheRect = new Rect();
         final Resources res = getResources();
@@ -124,14 +134,13 @@
         float alpha = getAlpha();
         setAlpha(1.0f);
         isUpdatingCache = true;
-        draw(mCacheCanvas);
+        drawChildren(mCacheCanvas);
         isUpdatingCache = false;
         setAlpha(alpha);
 
         mIsCacheDirty = false;
     }
 
-
     public void drawChildren(Canvas canvas) {
         super.dispatchDraw(canvas);
     }
@@ -148,11 +157,6 @@
         invalidateCache();
     }
 
-    public void removeViewWithoutMarkingCells(View view) {
-        super.removeView(view);
-        invalidateCache();
-    }
-
     @Override
     public void removeView(View view) {
         super.removeView(view);