Getting the Overview Mode to look up to spec

-> New assets, text, fonts
-> New spacing of pages (translated upwards)
-> Updated outline color to white (the ones we're drawing)

Change-Id: Ie664ac0598ae18b86ae6d54d1d6b497c13d2ee95
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 54f8846..287bb50 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -99,7 +99,7 @@
 
         final Resources res = getContext().getResources();
         mFocusedOutlineColor = mFocusedGlowColor = mPressedOutlineColor = mPressedGlowColor =
-            res.getColor(android.R.color.holo_blue_light);
+            res.getColor(R.color.outline_color);
 
         setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
     }
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 661685b..30ca737 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -214,8 +214,8 @@
         final Resources res = getResources();
         mHotseatScale = (float) grid.hotseatIconSize / grid.iconSize;
 
-        mNormalBackground = res.getDrawable(R.drawable.homescreen_blue_normal_holo);
-        mActiveGlowBackground = res.getDrawable(R.drawable.homescreen_blue_strong_holo);
+        mNormalBackground = res.getDrawable(R.drawable.screenpanel);
+        mActiveGlowBackground = res.getDrawable(R.drawable.screenpanel_hover);
 
         mOverScrollLeft = res.getDrawable(R.drawable.overscroll_glow_left);
         mOverScrollRight = res.getDrawable(R.drawable.overscroll_glow_right);
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 763dfa1..31a9797 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -111,6 +111,7 @@
     protected float mTouchX;
 
     protected boolean mFirstLayout = true;
+    private int mNormalChildHeight;
 
     protected int mCurrentPage;
     protected int mRestorePage = -1;
@@ -722,6 +723,10 @@
         super.addView(page, 0, lp);
     }
 
+    public int getNormalChildHeight() {
+        return mNormalChildHeight;
+    }
+
     @Override
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         if (!mIsDataReady || getChildCount() == 0) {
@@ -739,6 +744,7 @@
         // viewport, we can be at most one and a half screens offset once we scale down
         DisplayMetrics dm = getResources().getDisplayMetrics();
         int maxSize = Math.max(dm.widthPixels, dm.heightPixels + mInsets.top + mInsets.bottom);
+
         int parentWidthSize, parentHeightSize;
         int scaledWidthSize, scaledHeightSize;
         if (mUseMinScale) {
@@ -804,6 +810,7 @@
 
                 childWidth = widthSize - horizontalPadding;
                 childHeight = heightSize - verticalPadding - mInsets.top - mInsets.bottom;
+                mNormalChildHeight = childHeight;
 
             } else {
                 childWidthMode = MeasureSpec.EXACTLY;
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 8cf2c41..aab0a63 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -170,6 +170,7 @@
     private SpringLoadedDragController mSpringLoadedDragController;
     private float mSpringLoadedShrinkFactor;
     private float mOverviewModeShrinkFactor;
+    private int mOverviewModePageOffset;
 
     // State variable that indicates whether the pages are small (ie when you're
     // in all apps or customize mode)
@@ -304,6 +305,7 @@
             res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f;
         mOverviewModeShrinkFactor =
                 res.getInteger(R.integer.config_workspaceOverviewShrinkPercentage) / 100.0f;
+        mOverviewModePageOffset = res.getDimensionPixelSize(R.dimen.overview_mode_page_offset);
         mCameraDistance = res.getInteger(R.integer.config_cameraDistance);
         mOriginalDefaultPage = mDefaultPage = a.getInt(R.styleable.Workspace_defaultScreen, 1);
         a.recycle();
@@ -403,7 +405,10 @@
         setClipChildren(false);
         setClipToPadding(false);
         setChildrenDrawnWithCacheEnabled(true);
-        setMinScale(0.5f);
+
+        // This is a bit of a hack to account for the fact that we translate the workspace
+        // up a bit, and still need to draw the background covering the whole screen.
+        setMinScale(mOverviewModeShrinkFactor - 0.2f);
         setupLayoutTransition();
 
         final Resources res = getResources();
@@ -1800,6 +1805,17 @@
         }
     }
 
+    int getOverviewModeTranslationY() {
+        int childHeight = getNormalChildHeight();
+        int viewPortHeight = getViewportHeight();
+        int scaledChildHeight = (int) (mOverviewModeShrinkFactor * childHeight);
+
+        int offset = (viewPortHeight - scaledChildHeight) / 2;
+        int offsetDelta = mOverviewModePageOffset - offset + mInsets.top;
+
+        return offsetDelta;
+    }
+
     Animator getChangeStateAnimation(final State state, boolean animated, int delay, int snapPage) {
         if (mState == state) {
             return null;
@@ -1824,6 +1840,7 @@
         float finalHotseatAndPageIndicatorAlpha = (stateIsOverview || stateIsSmall) ? 0f : 1f;
         float finalOverviewPanelAlpha = stateIsOverview ? 1f : 0f;
         float finalSearchBarAlpha = stateIsOverview ? 0f : 1f;
+        float finalWorkspaceTranslationY = stateIsOverview ? getOverviewModeTranslationY() : 0;
 
         boolean zoomIn = true;
         mNewScale = 1.0f;
@@ -1879,8 +1896,6 @@
                 mOldBackgroundAlphas[i] = cl.getBackgroundAlpha();
                 mNewBackgroundAlphas[i] = finalBackgroundAlpha;
             } else {
-                setScaleX(mNewScale);
-                setScaleY(mNewScale);
                 cl.setBackgroundAlpha(finalBackgroundAlpha);
                 cl.setShortcutAndWidgetAlpha(finalAlpha);
             }
@@ -1891,6 +1906,7 @@
             LauncherViewPropertyAnimator scale = new LauncherViewPropertyAnimator(this);
             scale.scaleX(mNewScale)
                 .scaleY(mNewScale)
+                .translationY(finalWorkspaceTranslationY)
                 .setInterpolator(mZoomInInterpolator);
             anim.play(scale);
             for (int index = 0; index < getChildCount(); index++) {
@@ -1961,6 +1977,9 @@
             searchBar.setAlpha(finalSearchBarAlpha);
             AlphaUpdateListener.updateVisibility(searchBar);
             updateCustomContentVisibility();
+            setScaleX(mNewScale);
+            setScaleY(mNewScale);
+            setTranslationY(finalWorkspaceTranslationY);
         }
         if (finalSearchBarAlpha == 0) {
             mLauncher.setVoiceButtonProxyVisible(false);
@@ -2148,7 +2167,7 @@
      * Responsibility for the bitmap is transferred to the caller.
      */
     private Bitmap createDragOutline(View v, Canvas canvas, int padding) {
-        final int outlineColor = getResources().getColor(android.R.color.holo_blue_light);
+        final int outlineColor = getResources().getColor(R.color.outline_color);
         final Bitmap b = Bitmap.createBitmap(
                 v.getWidth() + padding, v.getHeight() + padding, Bitmap.Config.ARGB_8888);
 
@@ -2165,7 +2184,7 @@
      */
     private Bitmap createDragOutline(Bitmap orig, Canvas canvas, int padding, int w, int h,
             boolean clipAlpha) {
-        final int outlineColor = getResources().getColor(android.R.color.holo_blue_light);
+        final int outlineColor = getResources().getColor(R.color.outline_color);
         final Bitmap b = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
         canvas.setBitmap(b);