Support split status bar in launcher

Change-Id: I2f6687f52e8326f80e84251e39bf6cd6dc9b2f2b
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 1223d1c..6f4759d 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -447,6 +447,8 @@
             }
         }
 
+        int previewOffset = FolderRingAnimator.sPreviewSize;
+
         // The folder outer / inner ring image(s)
         for (int i = 0; i < mFolderOuterRings.size(); i++) {
             FolderRingAnimator fra = mFolderOuterRings.get(i);
@@ -458,7 +460,7 @@
             cellToPoint(fra.mCellX, fra.mCellY, mTempLocation);
 
             int centerX = mTempLocation[0] + mCellWidth / 2;
-            int centerY = mTempLocation[1] + FolderRingAnimator.sPreviewSize / 2;
+            int centerY = mTempLocation[1] + previewOffset / 2;
 
             canvas.save();
             canvas.translate(centerX - width / 2, centerY - height / 2);
@@ -473,7 +475,7 @@
             cellToPoint(fra.mCellX, fra.mCellY, mTempLocation);
 
             centerX = mTempLocation[0] + mCellWidth / 2;
-            centerY = mTempLocation[1] + FolderRingAnimator.sPreviewSize / 2;
+            centerY = mTempLocation[1] + previewOffset / 2;
             canvas.save();
             canvas.translate(centerX - width / 2, centerY - width / 2);
             d.setBounds(0, 0, width, height);
@@ -488,7 +490,7 @@
 
             cellToPoint(mFolderLeaveBehindCell[0], mFolderLeaveBehindCell[1], mTempLocation);
             int centerX = mTempLocation[0] + mCellWidth / 2;
-            int centerY = mTempLocation[1] + FolderRingAnimator.sPreviewSize / 2;
+            int centerY = mTempLocation[1] + previewOffset / 2;
 
             canvas.save();
             canvas.translate(centerX - width / 2, centerY - width / 2);
@@ -570,12 +572,8 @@
         return mIsHotseat ? mHotseatChildScale : mChildScale;
     }
 
-    public boolean addViewToCellLayout(
-            View child, int index, int childId, LayoutParams params, boolean markCells) {
-        return addViewToCellLayout(child, index, childId, params, markCells, false);
-    }
 
-    private void scaleChild(BubbleTextView bubbleChild, float pivot, float scale) {
+    private void scaleChild(BubbleTextView bubbleChild, float scale) {
         // If we haven't measured the child yet, do it now
         // (this happens if we're being dropped from all-apps
         if (bubbleChild.getLayoutParams() instanceof LayoutParams &&
@@ -595,7 +593,7 @@
     }
 
     public boolean addViewToCellLayout(View child, int index, int childId, LayoutParams params,
-            boolean markCells, boolean allApps) {
+            boolean markCells) {
         final LayoutParams lp = params;
 
         // Hotseat icons - scale down and remove text
@@ -608,14 +606,14 @@
             // Start the child with 100% scale and visible text
             resetChild(bubbleChild);
 
-            if (mIsHotseat && !allApps && mHotseatChildScale >= 0) {
+            if (mIsHotseat && mHotseatChildScale >= 0) {
                 // Scale/make transparent for a hotseat
-                scaleChild(bubbleChild, 0f, mHotseatChildScale);
+                scaleChild(bubbleChild, mHotseatChildScale);
 
                 bubbleChild.setTextColor(getResources().getColor(android.R.color.transparent));
             } else if (mChildScale >= 0) {
                 // Else possibly still scale it if we need to for smaller icons
-                scaleChild(bubbleChild, 0f, mChildScale);
+                scaleChild(bubbleChild, mChildScale);
             }
         }
 
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java
index 4a71329..d643084 100644
--- a/src/com/android/launcher2/FolderIcon.java
+++ b/src/com/android/launcher2/FolderIcon.java
@@ -198,11 +198,13 @@
             }
             mAcceptAnimator = ValueAnimator.ofFloat(0f, 1f);
             mAcceptAnimator.setDuration(CONSUMPTION_ANIMATION_DURATION);
+
+            final int previewSize = sPreviewSize;
             mAcceptAnimator.addUpdateListener(new AnimatorUpdateListener() {
                 public void onAnimationUpdate(ValueAnimator animation) {
                     final float percent = (Float) animation.getAnimatedValue();
-                    mOuterRingSize = (1 + percent * OUTER_RING_GROWTH_FACTOR) * sPreviewSize;
-                    mInnerRingSize = (1 + percent * INNER_RING_GROWTH_FACTOR) * sPreviewSize;
+                    mOuterRingSize = (1 + percent * OUTER_RING_GROWTH_FACTOR) * previewSize;
+                    mInnerRingSize = (1 + percent * INNER_RING_GROWTH_FACTOR) * previewSize;
                     if (mCellLayout != null) {
                         mCellLayout.invalidate();
                     }
@@ -225,11 +227,13 @@
             }
             mNeutralAnimator = ValueAnimator.ofFloat(0f, 1f);
             mNeutralAnimator.setDuration(CONSUMPTION_ANIMATION_DURATION);
+
+            final int previewSize = sPreviewSize;
             mNeutralAnimator.addUpdateListener(new AnimatorUpdateListener() {
                 public void onAnimationUpdate(ValueAnimator animation) {
                     final float percent = (Float) animation.getAnimatedValue();
-                    mOuterRingSize = (1 + (1 - percent) * OUTER_RING_GROWTH_FACTOR) * sPreviewSize;
-                    mInnerRingSize = (1 + (1 - percent) * INNER_RING_GROWTH_FACTOR) * sPreviewSize;
+                    mOuterRingSize = (1 + (1 - percent) * OUTER_RING_GROWTH_FACTOR) * previewSize;
+                    mInnerRingSize = (1 + (1 - percent) * INNER_RING_GROWTH_FACTOR) * previewSize;
                     if (mCellLayout != null) {
                         mCellLayout.invalidate();
                     }
diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java
index a6c9fb2..15d606d 100644
--- a/src/com/android/launcher2/Hotseat.java
+++ b/src/com/android/launcher2/Hotseat.java
@@ -132,6 +132,6 @@
         int y = getCellYFromOrder(mAllAppsButtonRank);
         CellLayout.LayoutParams lp = new CellLayout.LayoutParams(x,y,1,1);
         lp.canReorder = false;
-        mContent.addViewToCellLayout(allAppsButton, -1, 0, lp, true, true);
+        mContent.addViewToCellLayout(allAppsButton, -1, 0, lp, true);
     }
 }