Eliminate custom alpha handling in CellLayout

Also rename CellLayoutChildren to ShortcutsAndWidgetsView

Change-Id: Ic2ebc5497adb153cc2fce99730cc2c6fbdc101e6
diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java
index 4a3a7a4..a775ed5 100644
--- a/src/com/android/launcher2/BubbleTextView.java
+++ b/src/com/android/launcher2/BubbleTextView.java
@@ -247,8 +247,8 @@
     }
 
     void setCellLayoutPressedOrFocusedIcon() {
-        if (getParent() instanceof CellLayoutChildren) {
-            CellLayoutChildren parent = (CellLayoutChildren) getParent();
+        if (getParent() instanceof ShortcutAndWidgetContainer) {
+            ShortcutAndWidgetContainer parent = (ShortcutAndWidgetContainer) getParent();
             if (parent != null) {
                 CellLayout layout = (CellLayout) parent.getParent();
                 layout.setPressedOrFocusedIcon((mPressedOrFocusedBackground != null) ? this : null);
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 745c81b..5969f98 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -137,7 +137,7 @@
     private boolean mItemLocationsDirty = false;
 
     private TimeInterpolator mEaseOutInterpolator;
-    private CellLayoutChildren mChildren;
+    private ShortcutAndWidgetContainer mShortcutsAndWidgets;
 
     private boolean mIsHotseat = false;
     private float mChildScale = 1f;
@@ -281,9 +281,9 @@
         mBackgroundRect = new Rect();
         mForegroundRect = new Rect();
 
-        mChildren = new CellLayoutChildren(context);
-        mChildren.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
-        addView(mChildren);
+        mShortcutsAndWidgets = new ShortcutAndWidgetContainer(context);
+        mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
+        addView(mShortcutsAndWidgets);
     }
 
     static int widthInPortrait(Resources r, int numCells) {
@@ -309,7 +309,7 @@
     }
 
     public void enableHardwareLayers() {
-        mChildren.enableHardwareLayers();
+        mShortcutsAndWidgets.enableHardwareLayers();
     }
 
     public void setGridSize(int x, int y) {
@@ -353,13 +353,6 @@
         }
     }
 
-    public CellLayoutChildren getChildrenLayout() {
-        if (getChildCount() > 0) {
-            return (CellLayoutChildren) getChildAt(0);
-        }
-        return null;
-    }
-
     void setIsDragOverlapping(boolean isDragOverlapping) {
         if (mIsDragOverlapping != isDragOverlapping) {
             mIsDragOverlapping = isDragOverlapping;
@@ -616,7 +609,7 @@
         // (this happens if we're being dropped from all-apps
         if (bubbleChild.getLayoutParams() instanceof LayoutParams &&
                 (bubbleChild.getMeasuredWidth() | bubbleChild.getMeasuredHeight()) == 0) {
-            getChildrenLayout().measureChild(bubbleChild);
+            getShortcutsAndWidgets().measureChild(bubbleChild);
         }
         int measuredWidth = bubbleChild.getMeasuredWidth();
         int measuredHeight = bubbleChild.getMeasuredHeight();
@@ -667,7 +660,7 @@
 
             child.setId(childId);
 
-            mChildren.addView(child, index, lp);
+            mShortcutsAndWidgets.addView(child, index, lp);
 
             if (markCells) markCellsAsOccupiedForView(child);
 
@@ -679,61 +672,53 @@
     @Override
     public void removeAllViews() {
         clearOccupiedCells();
-        mChildren.removeAllViews();
+        mShortcutsAndWidgets.removeAllViews();
     }
 
     @Override
     public void removeAllViewsInLayout() {
-        if (mChildren.getChildCount() > 0) {
+        if (mShortcutsAndWidgets.getChildCount() > 0) {
             clearOccupiedCells();
-            mChildren.removeAllViewsInLayout();
+            mShortcutsAndWidgets.removeAllViewsInLayout();
         }
     }
 
     public void removeViewWithoutMarkingCells(View view) {
-        mChildren.removeView(view);
+        mShortcutsAndWidgets.removeView(view);
     }
 
     @Override
     public void removeView(View view) {
         markCellsAsUnoccupiedForView(view);
-        mChildren.removeView(view);
+        mShortcutsAndWidgets.removeView(view);
     }
 
     @Override
     public void removeViewAt(int index) {
-        markCellsAsUnoccupiedForView(mChildren.getChildAt(index));
-        mChildren.removeViewAt(index);
+        markCellsAsUnoccupiedForView(mShortcutsAndWidgets.getChildAt(index));
+        mShortcutsAndWidgets.removeViewAt(index);
     }
 
     @Override
     public void removeViewInLayout(View view) {
         markCellsAsUnoccupiedForView(view);
-        mChildren.removeViewInLayout(view);
+        mShortcutsAndWidgets.removeViewInLayout(view);
     }
 
     @Override
     public void removeViews(int start, int count) {
         for (int i = start; i < start + count; i++) {
-            markCellsAsUnoccupiedForView(mChildren.getChildAt(i));
+            markCellsAsUnoccupiedForView(mShortcutsAndWidgets.getChildAt(i));
         }
-        mChildren.removeViews(start, count);
+        mShortcutsAndWidgets.removeViews(start, count);
     }
 
     @Override
     public void removeViewsInLayout(int start, int count) {
         for (int i = start; i < start + count; i++) {
-            markCellsAsUnoccupiedForView(mChildren.getChildAt(i));
+            markCellsAsUnoccupiedForView(mShortcutsAndWidgets.getChildAt(i));
         }
-        mChildren.removeViewsInLayout(start, count);
-    }
-
-    public void drawChildren(Canvas canvas) {
-        mChildren.draw(canvas);
-    }
-
-    void buildChildrenLayer() {
-        mChildren.buildLayer();
+        mShortcutsAndWidgets.removeViewsInLayout(start, count);
     }
 
     @Override
@@ -747,11 +732,11 @@
         Rect frame = mRect;
         final int x = touchX + mScrollX;
         final int y = touchY + mScrollY;
-        final int count = mChildren.getChildCount();
+        final int count = mShortcutsAndWidgets.getChildCount();
 
         boolean found = false;
         for (int i = count - 1; i >= 0; i--) {
-            final View child = mChildren.getChildAt(i);
+            final View child = mShortcutsAndWidgets.getChildAt(i);
             final LayoutParams lp = (LayoutParams) child.getLayoutParams();
 
             if ((child.getVisibility() == VISIBLE || child.getAnimation() != null) &&
@@ -968,7 +953,7 @@
             int vFreeSpace = vSpace - (mCountY * mOriginalCellHeight);
             mWidthGap = Math.min(mMaxGap, numWidthGaps > 0 ? (hFreeSpace / numWidthGaps) : 0);
             mHeightGap = Math.min(mMaxGap,numHeightGaps > 0 ? (vFreeSpace / numHeightGaps) : 0);
-            mChildren.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
+            mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap);
         } else {
             mWidthGap = mOriginalWidthGap;
             mHeightGap = mOriginalHeightGap;
@@ -1017,12 +1002,12 @@
 
     @Override
     protected void setChildrenDrawingCacheEnabled(boolean enabled) {
-        mChildren.setChildrenDrawingCacheEnabled(enabled);
+        mShortcutsAndWidgets.setChildrenDrawingCacheEnabled(enabled);
     }
 
     @Override
     protected void setChildrenDrawnWithCacheEnabled(boolean enabled) {
-        mChildren.setChildrenDrawnWithCacheEnabled(enabled);
+        mShortcutsAndWidgets.setChildrenDrawnWithCacheEnabled(enabled);
     }
 
     public float getBackgroundAlpha() {
@@ -1044,34 +1029,27 @@
         }
     }
 
-    // Need to return true to let the view system know we know how to handle alpha-- this is
-    // because when our children have an alpha of 0.0f, they are still rendering their "dimmed"
-    // versions
-    @Override
-    protected boolean onSetAlpha(int alpha) {
-        return true;
-    }
-
-    @Override
-    public void setAlpha(float alpha) {
-        setChildrenAlpha(alpha);
-        super.setAlpha(alpha);
-    }
-
-    private void setChildrenAlpha(float alpha) {
+    public void setShortcutAndWidgetAlpha(float alpha) {
         final int childCount = getChildCount();
         for (int i = 0; i < childCount; i++) {
             getChildAt(i).setAlpha(alpha);
         }
     }
 
+    public ShortcutAndWidgetContainer getShortcutsAndWidgets() {
+        if (getChildCount() > 0) {
+            return (ShortcutAndWidgetContainer) getChildAt(0);
+        }
+        return null;
+    }
+
     public View getChildAt(int x, int y) {
-        return mChildren.getChildAt(x, y);
+        return mShortcutsAndWidgets.getChildAt(x, y);
     }
 
     public boolean animateChildToPosition(final View child, int cellX, int cellY, int duration,
             int delay, boolean permanent, boolean adjustOccupied) {
-        CellLayoutChildren clc = getChildrenLayout();
+        ShortcutAndWidgetContainer clc = getShortcutsAndWidgets();
         boolean[][] occupied = mOccupied;
         if (!permanent) {
             occupied = mTmpOccupied;
@@ -1623,7 +1601,7 @@
             boolean[][] occupied) {
         boolean found = false;
 
-        int childCount = mChildren.getChildCount();
+        int childCount = mShortcutsAndWidgets.getChildCount();
         Rect r0 = new Rect(boundingRect);
         Rect r1 = new Rect();
 
@@ -1644,7 +1622,7 @@
         }
 
         for (int i = 0; i < childCount; i++) {
-            View child = mChildren.getChildAt(i);
+            View child = mShortcutsAndWidgets.getChildAt(i);
             if (views.contains(child)) continue;
             LayoutParams lp = (LayoutParams) child.getLayoutParams();
 
@@ -1804,11 +1782,11 @@
             lp.tmpCellY = cellY;
         }
 
-        int childCount = mChildren.getChildCount();
+        int childCount = mShortcutsAndWidgets.getChildCount();
         Rect r0 = new Rect(cellX, cellY, cellX + spanX, cellY + spanY);
         Rect r1 = new Rect();
         for (int i = 0; i < childCount; i++) {
-            View child = mChildren.getChildAt(i);
+            View child = mShortcutsAndWidgets.getChildAt(i);
             if (child == ignoreView) continue;
             LayoutParams lp = (LayoutParams) child.getLayoutParams();
             r1.set(lp.cellX, lp.cellY, lp.cellX + lp.cellHSpan, lp.cellY + lp.cellVSpan);
@@ -1903,9 +1881,9 @@
     }
 
     private void copyCurrentStateToSolution(ItemConfiguration solution, boolean temp) {
-        int childCount = mChildren.getChildCount();
+        int childCount = mShortcutsAndWidgets.getChildCount();
         for (int i = 0; i < childCount; i++) {
-            View child = mChildren.getChildAt(i);
+            View child = mShortcutsAndWidgets.getChildAt(i);
             LayoutParams lp = (LayoutParams) child.getLayoutParams();
             Point p;
             if (temp) {
@@ -1924,9 +1902,9 @@
             }
         }
 
-        int childCount = mChildren.getChildCount();
+        int childCount = mShortcutsAndWidgets.getChildCount();
         for (int i = 0; i < childCount; i++) {
-            View child = mChildren.getChildAt(i);
+            View child = mShortcutsAndWidgets.getChildAt(i);
             if (child == dragView) continue;
             LayoutParams lp = (LayoutParams) child.getLayoutParams();
             Point p = solution.map.get(child);
@@ -1951,9 +1929,9 @@
             }
         }
 
-        int childCount = mChildren.getChildCount();
+        int childCount = mShortcutsAndWidgets.getChildCount();
         for (int i = 0; i < childCount; i++) {
-            View child = mChildren.getChildAt(i);
+            View child = mShortcutsAndWidgets.getChildAt(i);
             if (child == dragView) continue;
             LayoutParams lp = (LayoutParams) child.getLayoutParams();
             Point p = solution.map.get(child);
@@ -1976,18 +1954,18 @@
                 mOccupied[i][j] = mTmpOccupied[i][j];
             }
         }
-        int childCount = mChildren.getChildCount();
+        int childCount = mShortcutsAndWidgets.getChildCount();
         for (int i = 0; i < childCount; i++) {
-            LayoutParams lp = (LayoutParams) mChildren.getChildAt(i).getLayoutParams();
+            LayoutParams lp = (LayoutParams) mShortcutsAndWidgets.getChildAt(i).getLayoutParams();
             lp.cellX = lp.tmpCellX;
             lp.cellY = lp.tmpCellY;
         }
     }
 
     public void setUseTempCoords(boolean useTempCoords) {
-        int childCount = mChildren.getChildCount();
+        int childCount = mShortcutsAndWidgets.getChildCount();
         for (int i = 0; i < childCount; i++) {
-            LayoutParams lp = (LayoutParams) mChildren.getChildAt(i).getLayoutParams();
+            LayoutParams lp = (LayoutParams) mShortcutsAndWidgets.getChildAt(i).getLayoutParams();
             lp.useTmpCoords = useTempCoords;
         }
     }
@@ -1998,9 +1976,9 @@
                 mTmpOccupied[i][j] = mOccupied[i][j];
             }
         }
-        int childCount = mChildren.getChildCount();
+        int childCount = mShortcutsAndWidgets.getChildCount();
         for (int i = 0; i < childCount; i++) {
-            View child = mChildren.getChildAt(i);
+            View child = mShortcutsAndWidgets.getChildAt(i);
             if (child == ignoreView) continue;
             LayoutParams lp = (LayoutParams) child.getLayoutParams();
             lp.tmpCellX = lp.cellX;
@@ -2094,7 +2072,7 @@
         }
         boolean[][] occupied = mOccupied;
 
-        mChildren.requestLayout();
+        mShortcutsAndWidgets.requestLayout();
         return result;
     }
 
@@ -2542,7 +2520,7 @@
         markCellsAsOccupiedForView(view, mOccupied);
     }
     public void markCellsAsOccupiedForView(View view, boolean[][] occupied) {
-        if (view == null || view.getParent() != mChildren) return;
+        if (view == null || view.getParent() != mShortcutsAndWidgets) return;
         LayoutParams lp = (LayoutParams) view.getLayoutParams();
         markCellsForView(lp.cellX, lp.cellY, lp.cellHSpan, lp.cellVSpan, occupied, true);
     }
@@ -2551,7 +2529,7 @@
         markCellsAsUnoccupiedForView(view, mOccupied);
     }
     public void markCellsAsUnoccupiedForView(View view, boolean occupied[][]) {
-        if (view == null || view.getParent() != mChildren) return;
+        if (view == null || view.getParent() != mShortcutsAndWidgets) return;
         LayoutParams lp = (LayoutParams) view.getLayoutParams();
         markCellsForView(lp.cellX, lp.cellY, lp.cellHSpan, lp.cellVSpan, occupied, false);
     }
diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java
index ce5c8c5..cde9149 100644
--- a/src/com/android/launcher2/DragLayer.java
+++ b/src/com/android/launcher2/DragLayer.java
@@ -433,7 +433,7 @@
 
     public void animateViewIntoPosition(DragView dragView, final View child, int duration,
             final Runnable onFinishAnimationRunnable, View anchorView) {
-        CellLayoutChildren parentChildren = (CellLayoutChildren) child.getParent();
+        ShortcutAndWidgetContainer parentChildren = (ShortcutAndWidgetContainer) child.getParent();
         CellLayout parent = (CellLayout) (CellLayout) parentChildren.getParent();
         CellLayout.LayoutParams lp =  (CellLayout.LayoutParams) child.getLayoutParams();
         parentChildren.measureChild(child);
diff --git a/src/com/android/launcher2/FocusHelper.java b/src/com/android/launcher2/FocusHelper.java
index 7807b5d..ecc9d9c 100644
--- a/src/com/android/launcher2/FocusHelper.java
+++ b/src/com/android/launcher2/FocusHelper.java
@@ -534,7 +534,7 @@
                 if (handleKeyEvent) {
                     // Select the first bubble text view in the current page of the workspace
                     final CellLayout layout = (CellLayout) workspace.getChildAt(pageIndex);
-                    final CellLayoutChildren children = layout.getChildrenLayout();
+                    final ShortcutAndWidgetContainer children = layout.getShortcutsAndWidgets();
                     final View newIcon = getIconInDirection(layout, children, -1, 1);
                     if (newIcon != null) {
                         newIcon.requestFocus();
@@ -556,9 +556,10 @@
     /**
      * Private helper method to get the CellLayoutChildren given a CellLayout index.
      */
-    private static CellLayoutChildren getCellLayoutChildrenForIndex(ViewGroup container, int i) {
+    private static ShortcutAndWidgetContainer getCellLayoutChildrenForIndex(
+            ViewGroup container, int i) {
         ViewGroup parent = (ViewGroup) container.getChildAt(i);
-        return (CellLayoutChildren) parent.getChildAt(0);
+        return (ShortcutAndWidgetContainer) parent.getChildAt(0);
     }
 
     /**
@@ -664,7 +665,7 @@
      * Handles key events in a Workspace containing.
      */
     static boolean handleIconKeyEvent(View v, int keyCode, KeyEvent e) {
-        CellLayoutChildren parent = (CellLayoutChildren) v.getParent();
+        ShortcutAndWidgetContainer parent = (ShortcutAndWidgetContainer) v.getParent();
         final CellLayout layout = (CellLayout) parent.getParent();
         final Workspace workspace = (Workspace) layout.getParent();
         final ViewGroup launcher = (ViewGroup) workspace.getParent();
@@ -819,7 +820,7 @@
      * Handles key events for items in a Folder.
      */
     static boolean handleFolderKeyEvent(View v, int keyCode, KeyEvent e) {
-        CellLayoutChildren parent = (CellLayoutChildren) v.getParent();
+        ShortcutAndWidgetContainer parent = (ShortcutAndWidgetContainer) v.getParent();
         final CellLayout layout = (CellLayout) parent.getParent();
         final Folder folder = (Folder) layout.getParent();
         View title = folder.mFolderName;
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 07e76c9..4621c85 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -148,7 +148,7 @@
         super.onFinishInflate();
         mContent = (CellLayout) findViewById(R.id.folder_content);
         mContent.setGridSize(0, 0);
-        mContent.getChildrenLayout().setMotionEventSplittingEnabled(false);
+        mContent.getShortcutsAndWidgets().setMotionEventSplittingEnabled(false);
         mFolderName = (FolderEditText) findViewById(R.id.folder_name);
         mFolderName.setFolder(this);
         mFolderName.setOnFocusChangeListener(this);
@@ -731,7 +731,7 @@
         mLauncher.getWorkspace().setFinalScrollForPageChange(currentPage);
         // We first fetch the currently visible CellLayoutChildren
         CellLayout currentLayout = (CellLayout) mLauncher.getWorkspace().getChildAt(currentPage);
-        CellLayoutChildren boundingLayout = currentLayout.getChildrenLayout();
+        ShortcutAndWidgetContainer boundingLayout = currentLayout.getShortcutsAndWidgets();
         Rect bounds = new Rect();
         parent.getDescendantRectRelativeToSelf(boundingLayout, bounds);
         // We reset the workspaces scroll
@@ -822,11 +822,11 @@
     }
 
     public int getItemCount() {
-        return mContent.getChildrenLayout().getChildCount();
+        return mContent.getShortcutsAndWidgets().getChildCount();
     }
 
     public View getItemAt(int index) {
-        return mContent.getChildrenLayout().getChildAt(index);
+        return mContent.getShortcutsAndWidgets().getChildAt(index);
     }
 
     private void onCloseComplete() {
diff --git a/src/com/android/launcher2/CellLayoutChildren.java b/src/com/android/launcher2/ShortcutAndWidgetContainer.java
similarity index 97%
rename from src/com/android/launcher2/CellLayoutChildren.java
rename to src/com/android/launcher2/ShortcutAndWidgetContainer.java
index 4ca44ed..7e5e940 100644
--- a/src/com/android/launcher2/CellLayoutChildren.java
+++ b/src/com/android/launcher2/ShortcutAndWidgetContainer.java
@@ -26,7 +26,7 @@
 
 import com.android.launcher2.CellLayout.LayoutParams;
 
-public class CellLayoutChildren extends ViewGroup {
+public class ShortcutAndWidgetContainer extends ViewGroup {
     static final String TAG = "CellLayoutChildren";
 
     // These are temporary variables to prevent having to allocate a new object just to
@@ -41,7 +41,7 @@
     private int mWidthGap;
     private int mHeightGap;
 
-    public CellLayoutChildren(Context context) {
+    public ShortcutAndWidgetContainer(Context context) {
         super(context);
         mWallpaperManager = WallpaperManager.getInstance(context);
     }
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 76070c4..3ead52e 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -363,7 +363,7 @@
             final int childCount = getChildCount();
             for (int i = 0; i < childCount; i++) {
                 CellLayout cl = (CellLayout) getChildAt(i);
-                cl.buildChildrenLayer();
+                cl.getShortcutsAndWidgets().buildLayer();
             }
         }
     }
@@ -377,7 +377,7 @@
         int count = getChildCount();
         for (int i = 0; i < count; i++) {
             CellLayout cl = (CellLayout) getPageAt(i);
-            cl.getChildrenLayout().animate().alpha(mDragFadeOutAlpha)
+            cl.getShortcutsAndWidgets().animate().alpha(mDragFadeOutAlpha)
                 .setInterpolator(new AccelerateInterpolator(1.5f))
                 .setDuration(mDragFadeOutDuration)
                 .start();
@@ -393,7 +393,7 @@
         int count = getChildCount();
         for (int i = 0; i < count; i++) {
             CellLayout cl = (CellLayout) getPageAt(i);
-            cl.getChildrenLayout().animate().alpha(1f)
+            cl.getShortcutsAndWidgets().animate().alpha(1f)
                 .setInterpolator(new DecelerateInterpolator(1.5f))
                 .setDuration(mDragFadeOutDuration)
                 .start();
@@ -722,7 +722,7 @@
         // user scrolls while we are transitioning (should not affect dispatchDraw optimizations)
         if (!mFadeInAdjacentScreens) {
             for (int i = 0; i < getChildCount(); ++i) {
-                getPageAt(i).setAlpha(1f);
+                ((CellLayout) getPageAt(i)).setShortcutAndWidgetAlpha(1f);
             }
         }
 
@@ -1205,7 +1205,7 @@
                 cl.setRotationY(rotation);
                 if (mFadeInAdjacentScreens && !isSmall()) {
                     float alpha = 1 - Math.abs(scrollProgress);
-                    cl.setAlpha(alpha);
+                    cl.setShortcutAndWidgetAlpha(alpha);
                 }
             }
         }
@@ -1657,7 +1657,7 @@
                 cl.setScaleY(finalScaleFactor);
                 cl.setBackgroundAlpha(finalBackgroundAlpha);
                 cl.setBackgroundAlphaMultiplier(finalAlphaMultiplierValue);
-                cl.setAlpha(finalAlpha);
+                cl.setShortcutAndWidgetAlpha(finalAlpha);
                 cl.setRotationY(rotation);
             }
         }
@@ -1673,7 +1673,7 @@
                     cl.setScaleY(mNewScaleYs[i]);
                     cl.setBackgroundAlpha(mNewBackgroundAlphas[i]);
                     cl.setBackgroundAlphaMultiplier(mNewBackgroundAlphaMultipliers[i]);
-                    cl.setAlpha(mNewAlphas[i]);
+                    cl.setShortcutAndWidgetAlpha(mNewAlphas[i]);
                     cl.setRotationY(mNewRotationYs[i]);
                 } else {
                     LauncherViewPropertyAnimator a = new LauncherViewPropertyAnimator(cl);
@@ -1683,10 +1683,16 @@
                         .scaleY(mNewScaleYs[i])
                         .setDuration(duration)
                         .setInterpolator(mZoomInInterpolator);
-                    if (mOldAlphas[i] != mNewAlphas[i]) {
-                        a.alpha(mNewAlphas[i]);
-                    }
                     anim.play(a);
+
+                    LauncherViewPropertyAnimator alphaAnim =
+                        new LauncherViewPropertyAnimator(cl.getShortcutsAndWidgets());
+                    if (mOldAlphas[i] != mNewAlphas[i]) {
+                        alphaAnim.alpha(mNewAlphas[i])
+                            .setDuration(duration)
+                            .setInterpolator(mZoomInInterpolator);
+                        anim.play(alphaAnim);
+                    }
                     if (mOldRotationYs[i] != 0 || mNewRotationYs[i] != 0) {
                         ValueAnimator rotate = ValueAnimator.ofFloat(0f, 1f).setDuration(duration);
                         rotate.setInterpolator(new DecelerateInterpolator(2.0f));
@@ -1755,7 +1761,7 @@
         if (!mFadeInAdjacentScreens) {
             for (int i = 0; i < getChildCount(); i++) {
                 final CellLayout cl = (CellLayout) getChildAt(i);
-                cl.setAlpha(1f);
+                cl.setShortcutAndWidgetAlpha(1f);
             }
         }
     }
@@ -3075,7 +3081,7 @@
                     info.spanY, insertAtFirst);
             cellLayout.onDropChild(view);
             CellLayout.LayoutParams lp = (CellLayout.LayoutParams) view.getLayoutParams();
-            cellLayout.getChildrenLayout().measureChild(view);
+            cellLayout.getShortcutsAndWidgets().measureChild(view);
 
 
             LauncherModel.addOrMoveItemInDatabase(mLauncher, info, container, screen,
@@ -3314,10 +3320,10 @@
     }
 
     private void updateItemLocationsInDatabase(CellLayout cl) {
-        int count = cl.getChildrenLayout().getChildCount();
+        int count = cl.getShortcutsAndWidgets().getChildCount();
         int screen = indexOfChild(cl);
         for (int i = 0; i < count; i++) {
-            View v = cl.getChildrenLayout().getChildAt(i);
+            View v = cl.getShortcutsAndWidgets().getChildAt(i);
             ItemInfo info = (ItemInfo) v.getTag();
 
             LauncherModel.moveItemInDatabase(mLauncher, info, Favorites.CONTAINER_DESKTOP, screen,
@@ -3434,7 +3440,7 @@
     CellLayout getParentCellLayoutForView(View v) {
         ArrayList<CellLayout> layouts = getWorkspaceAndHotseatCellLayouts();
         for (CellLayout layout : layouts) {
-            if (layout.getChildrenLayout().indexOfChild(v) > -1) {
+            if (layout.getShortcutsAndWidgets().indexOfChild(v) > -1) {
                 return layout;
             }
         }
@@ -3458,23 +3464,26 @@
 
     /**
      * We should only use this to search for specific children.  Do not use this method to modify
-     * CellLayoutChildren directly.
+     * ShortcutsAndWidgetsContainer directly. Includes ShortcutAndWidgetContainers from
+     * the hotseat and workspace pages
      */
-    ArrayList<CellLayoutChildren> getWorkspaceAndHotseatCellLayoutChildren() {
-        ArrayList<CellLayoutChildren> childrenLayouts = new ArrayList<CellLayoutChildren>();
+    ArrayList<ShortcutAndWidgetContainer> getAllShortcutAndWidgetContainers() {
+        ArrayList<ShortcutAndWidgetContainer> childrenLayouts =
+                new ArrayList<ShortcutAndWidgetContainer>();
         int screenCount = getChildCount();
         for (int screen = 0; screen < screenCount; screen++) {
-            childrenLayouts.add(((CellLayout) getChildAt(screen)).getChildrenLayout());
+            childrenLayouts.add(((CellLayout) getChildAt(screen)).getShortcutsAndWidgets());
         }
         if (mLauncher.getHotseat() != null) {
-            childrenLayouts.add(mLauncher.getHotseat().getLayout().getChildrenLayout());
+            childrenLayouts.add(mLauncher.getHotseat().getLayout().getShortcutsAndWidgets());
         }
         return childrenLayouts;
     }
 
     public Folder getFolderForTag(Object tag) {
-        ArrayList<CellLayoutChildren> childrenLayouts = getWorkspaceAndHotseatCellLayoutChildren();
-        for (CellLayoutChildren layout: childrenLayouts) {
+        ArrayList<ShortcutAndWidgetContainer> childrenLayouts =
+                getAllShortcutAndWidgetContainers();
+        for (ShortcutAndWidgetContainer layout: childrenLayouts) {
             int count = layout.getChildCount();
             for (int i = 0; i < count; i++) {
                 View child = layout.getChildAt(i);
@@ -3490,8 +3499,9 @@
     }
 
     public View getViewForTag(Object tag) {
-        ArrayList<CellLayoutChildren> childrenLayouts = getWorkspaceAndHotseatCellLayoutChildren();
-        for (CellLayoutChildren layout: childrenLayouts) {
+        ArrayList<ShortcutAndWidgetContainer> childrenLayouts =
+                getAllShortcutAndWidgetContainers();
+        for (ShortcutAndWidgetContainer layout: childrenLayouts) {
             int count = layout.getChildCount();
             for (int i = 0; i < count; i++) {
                 View child = layout.getChildAt(i);
@@ -3504,8 +3514,9 @@
     }
 
     void clearDropTargets() {
-        ArrayList<CellLayoutChildren> childrenLayouts = getWorkspaceAndHotseatCellLayoutChildren();
-        for (CellLayoutChildren layout: childrenLayouts) {
+        ArrayList<ShortcutAndWidgetContainer> childrenLayouts =
+                getAllShortcutAndWidgetContainers();
+        for (ShortcutAndWidgetContainer layout: childrenLayouts) {
             int childCount = layout.getChildCount();
             for (int j = 0; j < childCount; j++) {
                 View v = layout.getChildAt(j);
@@ -3527,7 +3538,7 @@
 
         ArrayList<CellLayout> cellLayouts = getWorkspaceAndHotseatCellLayouts();
         for (final CellLayout layoutParent: cellLayouts) {
-            final ViewGroup layout = layoutParent.getChildrenLayout();
+            final ViewGroup layout = layoutParent.getShortcutsAndWidgets();
 
             // Avoid ANRs by treating each screen separately
             post(new Runnable() {
@@ -3613,8 +3624,8 @@
     }
 
     void updateShortcuts(ArrayList<ApplicationInfo> apps) {
-        ArrayList<CellLayoutChildren> childrenLayouts = getWorkspaceAndHotseatCellLayoutChildren();
-        for (CellLayoutChildren layout: childrenLayouts) {
+        ArrayList<ShortcutAndWidgetContainer> childrenLayouts = getAllShortcutAndWidgetContainers();
+        for (ShortcutAndWidgetContainer layout: childrenLayouts) {
             int childCount = layout.getChildCount();
             for (int j = 0; j < childCount; j++) {
                 final View view = layout.getChildAt(j);