From 410f3cdfb4a8c2cf82749a3e73201fb7930540ae Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Sun, 22 Sep 2013 12:09:32 -0700 Subject: 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 --- .../homescreen_blue_normal_holo.9.png | Bin 387 -> 0 bytes .../homescreen_blue_strong_holo.9.png | Bin 422 -> 0 bytes res/drawable-hdpi/ic_gel_setting_icn.png | Bin 1694 -> 0 bytes res/drawable-hdpi/ic_gel_wallpaper_icn.png | Bin 1456 -> 0 bytes res/drawable-hdpi/ic_gel_widget_icn.png | Bin 1111 -> 0 bytes res/drawable-hdpi/ic_setting.png | Bin 0 -> 2637 bytes res/drawable-hdpi/ic_wallpaper.png | Bin 0 -> 2189 bytes res/drawable-hdpi/ic_widget.png | Bin 0 -> 1560 bytes res/drawable-hdpi/screenpanel.9.png | Bin 0 -> 881 bytes res/drawable-hdpi/screenpanel_hover.9.png | Bin 0 -> 1189 bytes .../homescreen_blue_normal_holo.9.png | Bin 285 -> 0 bytes .../homescreen_blue_strong_holo.9.png | Bin 303 -> 0 bytes res/drawable-mdpi/ic_gel_setting_icn.png | Bin 1082 -> 0 bytes res/drawable-mdpi/ic_gel_wallpaper_icn.png | Bin 1025 -> 0 bytes res/drawable-mdpi/ic_gel_widget_icn.png | Bin 898 -> 0 bytes res/drawable-mdpi/ic_setting.png | Bin 0 -> 1669 bytes res/drawable-mdpi/ic_setting_icn.png | Bin 0 -> 1718 bytes res/drawable-mdpi/ic_wallpaper.png | Bin 0 -> 1494 bytes res/drawable-mdpi/ic_widget.png | Bin 0 -> 1174 bytes res/drawable-mdpi/screenpanel.9.png | Bin 0 -> 900 bytes res/drawable-mdpi/screenpanel_hover.9.png | Bin 0 -> 913 bytes .../homescreen_blue_normal_holo.9.png | Bin 470 -> 0 bytes .../homescreen_blue_strong_holo.9.png | Bin 508 -> 0 bytes res/drawable-xhdpi/ic_gel_setting_icn.png | Bin 2386 -> 0 bytes res/drawable-xhdpi/ic_gel_wallpaper_icn.png | Bin 1949 -> 0 bytes res/drawable-xhdpi/ic_gel_widget_icn.png | Bin 1386 -> 0 bytes res/drawable-xhdpi/ic_setting.png | Bin 0 -> 3625 bytes res/drawable-xhdpi/ic_wallpaper.png | Bin 0 -> 2875 bytes res/drawable-xhdpi/ic_widget.png | Bin 0 -> 1978 bytes res/drawable-xhdpi/screenpanel.9.png | Bin 0 -> 1403 bytes res/drawable-xhdpi/screenpanel_hover.9.png | Bin 0 -> 1586 bytes .../homescreen_blue_normal_holo.9.png | Bin 1427 -> 0 bytes .../homescreen_blue_strong_holo.9.png | Bin 1503 -> 0 bytes res/drawable-xxhdpi/ic_gel_setting_icn.png | Bin 2937 -> 0 bytes res/drawable-xxhdpi/ic_gel_wallpaper_icn.png | Bin 2602 -> 0 bytes res/drawable-xxhdpi/ic_gel_widget_icn.png | Bin 1910 -> 0 bytes res/drawable-xxhdpi/ic_setting.png | Bin 0 -> 4105 bytes res/drawable-xxhdpi/ic_wallpaper.png | Bin 0 -> 3422 bytes res/drawable-xxhdpi/ic_widget.png | Bin 0 -> 2413 bytes res/drawable-xxhdpi/screenpanel.9.png | Bin 0 -> 5196 bytes res/drawable-xxhdpi/screenpanel_hover.9.png | Bin 0 -> 4418 bytes res/layout/overview_panel.xml | 29 ++++++++++++++------- res/values/colors.xml | 1 + res/values/config.xml | 2 +- res/values/dimens.xml | 3 ++- res/values/strings.xml | 4 +-- src/com/android/launcher3/BubbleTextView.java | 2 +- src/com/android/launcher3/CellLayout.java | 4 +-- src/com/android/launcher3/PagedView.java | 7 +++++ src/com/android/launcher3/Workspace.java | 29 +++++++++++++++++---- 50 files changed, 59 insertions(+), 22 deletions(-) delete mode 100644 res/drawable-hdpi/homescreen_blue_normal_holo.9.png delete mode 100644 res/drawable-hdpi/homescreen_blue_strong_holo.9.png delete mode 100644 res/drawable-hdpi/ic_gel_setting_icn.png delete mode 100644 res/drawable-hdpi/ic_gel_wallpaper_icn.png delete mode 100644 res/drawable-hdpi/ic_gel_widget_icn.png create mode 100644 res/drawable-hdpi/ic_setting.png create mode 100644 res/drawable-hdpi/ic_wallpaper.png create mode 100644 res/drawable-hdpi/ic_widget.png create mode 100644 res/drawable-hdpi/screenpanel.9.png create mode 100644 res/drawable-hdpi/screenpanel_hover.9.png delete mode 100644 res/drawable-mdpi/homescreen_blue_normal_holo.9.png delete mode 100644 res/drawable-mdpi/homescreen_blue_strong_holo.9.png delete mode 100644 res/drawable-mdpi/ic_gel_setting_icn.png delete mode 100644 res/drawable-mdpi/ic_gel_wallpaper_icn.png delete mode 100644 res/drawable-mdpi/ic_gel_widget_icn.png create mode 100644 res/drawable-mdpi/ic_setting.png create mode 100644 res/drawable-mdpi/ic_setting_icn.png create mode 100644 res/drawable-mdpi/ic_wallpaper.png create mode 100644 res/drawable-mdpi/ic_widget.png create mode 100644 res/drawable-mdpi/screenpanel.9.png create mode 100644 res/drawable-mdpi/screenpanel_hover.9.png delete mode 100644 res/drawable-xhdpi/homescreen_blue_normal_holo.9.png delete mode 100644 res/drawable-xhdpi/homescreen_blue_strong_holo.9.png delete mode 100644 res/drawable-xhdpi/ic_gel_setting_icn.png delete mode 100644 res/drawable-xhdpi/ic_gel_wallpaper_icn.png delete mode 100644 res/drawable-xhdpi/ic_gel_widget_icn.png create mode 100644 res/drawable-xhdpi/ic_setting.png create mode 100644 res/drawable-xhdpi/ic_wallpaper.png create mode 100644 res/drawable-xhdpi/ic_widget.png create mode 100644 res/drawable-xhdpi/screenpanel.9.png create mode 100644 res/drawable-xhdpi/screenpanel_hover.9.png delete mode 100644 res/drawable-xxhdpi/homescreen_blue_normal_holo.9.png delete mode 100644 res/drawable-xxhdpi/homescreen_blue_strong_holo.9.png delete mode 100644 res/drawable-xxhdpi/ic_gel_setting_icn.png delete mode 100644 res/drawable-xxhdpi/ic_gel_wallpaper_icn.png delete mode 100644 res/drawable-xxhdpi/ic_gel_widget_icn.png create mode 100644 res/drawable-xxhdpi/ic_setting.png create mode 100644 res/drawable-xxhdpi/ic_wallpaper.png create mode 100644 res/drawable-xxhdpi/ic_widget.png create mode 100644 res/drawable-xxhdpi/screenpanel.9.png create mode 100644 res/drawable-xxhdpi/screenpanel_hover.9.png diff --git a/res/drawable-hdpi/homescreen_blue_normal_holo.9.png b/res/drawable-hdpi/homescreen_blue_normal_holo.9.png deleted file mode 100644 index 27106964f..000000000 Binary files a/res/drawable-hdpi/homescreen_blue_normal_holo.9.png and /dev/null differ diff --git a/res/drawable-hdpi/homescreen_blue_strong_holo.9.png b/res/drawable-hdpi/homescreen_blue_strong_holo.9.png deleted file mode 100644 index c88ef14a2..000000000 Binary files a/res/drawable-hdpi/homescreen_blue_strong_holo.9.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_gel_setting_icn.png b/res/drawable-hdpi/ic_gel_setting_icn.png deleted file mode 100644 index f80594710..000000000 Binary files a/res/drawable-hdpi/ic_gel_setting_icn.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_gel_wallpaper_icn.png b/res/drawable-hdpi/ic_gel_wallpaper_icn.png deleted file mode 100644 index ad13c856d..000000000 Binary files a/res/drawable-hdpi/ic_gel_wallpaper_icn.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_gel_widget_icn.png b/res/drawable-hdpi/ic_gel_widget_icn.png deleted file mode 100644 index 2bfd2c17b..000000000 Binary files a/res/drawable-hdpi/ic_gel_widget_icn.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_setting.png b/res/drawable-hdpi/ic_setting.png new file mode 100644 index 000000000..c617154f1 Binary files /dev/null and b/res/drawable-hdpi/ic_setting.png differ diff --git a/res/drawable-hdpi/ic_wallpaper.png b/res/drawable-hdpi/ic_wallpaper.png new file mode 100644 index 000000000..5e5d1186b Binary files /dev/null and b/res/drawable-hdpi/ic_wallpaper.png differ diff --git a/res/drawable-hdpi/ic_widget.png b/res/drawable-hdpi/ic_widget.png new file mode 100644 index 000000000..8c57af0de Binary files /dev/null and b/res/drawable-hdpi/ic_widget.png differ diff --git a/res/drawable-hdpi/screenpanel.9.png b/res/drawable-hdpi/screenpanel.9.png new file mode 100644 index 000000000..36e7dfd9c Binary files /dev/null and b/res/drawable-hdpi/screenpanel.9.png differ diff --git a/res/drawable-hdpi/screenpanel_hover.9.png b/res/drawable-hdpi/screenpanel_hover.9.png new file mode 100644 index 000000000..3321fc925 Binary files /dev/null and b/res/drawable-hdpi/screenpanel_hover.9.png differ diff --git a/res/drawable-mdpi/homescreen_blue_normal_holo.9.png b/res/drawable-mdpi/homescreen_blue_normal_holo.9.png deleted file mode 100644 index efdc86136..000000000 Binary files a/res/drawable-mdpi/homescreen_blue_normal_holo.9.png and /dev/null differ diff --git a/res/drawable-mdpi/homescreen_blue_strong_holo.9.png b/res/drawable-mdpi/homescreen_blue_strong_holo.9.png deleted file mode 100644 index e3edb6490..000000000 Binary files a/res/drawable-mdpi/homescreen_blue_strong_holo.9.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_gel_setting_icn.png b/res/drawable-mdpi/ic_gel_setting_icn.png deleted file mode 100644 index 096e6bcc8..000000000 Binary files a/res/drawable-mdpi/ic_gel_setting_icn.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_gel_wallpaper_icn.png b/res/drawable-mdpi/ic_gel_wallpaper_icn.png deleted file mode 100644 index 61a7b7ee1..000000000 Binary files a/res/drawable-mdpi/ic_gel_wallpaper_icn.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_gel_widget_icn.png b/res/drawable-mdpi/ic_gel_widget_icn.png deleted file mode 100644 index 8a2cb7a2f..000000000 Binary files a/res/drawable-mdpi/ic_gel_widget_icn.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_setting.png b/res/drawable-mdpi/ic_setting.png new file mode 100644 index 000000000..0c8ae9d65 Binary files /dev/null and b/res/drawable-mdpi/ic_setting.png differ diff --git a/res/drawable-mdpi/ic_setting_icn.png b/res/drawable-mdpi/ic_setting_icn.png new file mode 100644 index 000000000..5c32c54da Binary files /dev/null and b/res/drawable-mdpi/ic_setting_icn.png differ diff --git a/res/drawable-mdpi/ic_wallpaper.png b/res/drawable-mdpi/ic_wallpaper.png new file mode 100644 index 000000000..333a206e2 Binary files /dev/null and b/res/drawable-mdpi/ic_wallpaper.png differ diff --git a/res/drawable-mdpi/ic_widget.png b/res/drawable-mdpi/ic_widget.png new file mode 100644 index 000000000..5f974c28c Binary files /dev/null and b/res/drawable-mdpi/ic_widget.png differ diff --git a/res/drawable-mdpi/screenpanel.9.png b/res/drawable-mdpi/screenpanel.9.png new file mode 100644 index 000000000..4de3017f5 Binary files /dev/null and b/res/drawable-mdpi/screenpanel.9.png differ diff --git a/res/drawable-mdpi/screenpanel_hover.9.png b/res/drawable-mdpi/screenpanel_hover.9.png new file mode 100644 index 000000000..dd7740665 Binary files /dev/null and b/res/drawable-mdpi/screenpanel_hover.9.png differ diff --git a/res/drawable-xhdpi/homescreen_blue_normal_holo.9.png b/res/drawable-xhdpi/homescreen_blue_normal_holo.9.png deleted file mode 100644 index 3f8eaf597..000000000 Binary files a/res/drawable-xhdpi/homescreen_blue_normal_holo.9.png and /dev/null differ diff --git a/res/drawable-xhdpi/homescreen_blue_strong_holo.9.png b/res/drawable-xhdpi/homescreen_blue_strong_holo.9.png deleted file mode 100644 index 738cd2a9c..000000000 Binary files a/res/drawable-xhdpi/homescreen_blue_strong_holo.9.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_gel_setting_icn.png b/res/drawable-xhdpi/ic_gel_setting_icn.png deleted file mode 100644 index fe17163b1..000000000 Binary files a/res/drawable-xhdpi/ic_gel_setting_icn.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_gel_wallpaper_icn.png b/res/drawable-xhdpi/ic_gel_wallpaper_icn.png deleted file mode 100644 index d9472d981..000000000 Binary files a/res/drawable-xhdpi/ic_gel_wallpaper_icn.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_gel_widget_icn.png b/res/drawable-xhdpi/ic_gel_widget_icn.png deleted file mode 100644 index da6e3e9c2..000000000 Binary files a/res/drawable-xhdpi/ic_gel_widget_icn.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_setting.png b/res/drawable-xhdpi/ic_setting.png new file mode 100644 index 000000000..91ba98c55 Binary files /dev/null and b/res/drawable-xhdpi/ic_setting.png differ diff --git a/res/drawable-xhdpi/ic_wallpaper.png b/res/drawable-xhdpi/ic_wallpaper.png new file mode 100644 index 000000000..41dc000fd Binary files /dev/null and b/res/drawable-xhdpi/ic_wallpaper.png differ diff --git a/res/drawable-xhdpi/ic_widget.png b/res/drawable-xhdpi/ic_widget.png new file mode 100644 index 000000000..47dcdd14f Binary files /dev/null and b/res/drawable-xhdpi/ic_widget.png differ diff --git a/res/drawable-xhdpi/screenpanel.9.png b/res/drawable-xhdpi/screenpanel.9.png new file mode 100644 index 000000000..b4b828d3e Binary files /dev/null and b/res/drawable-xhdpi/screenpanel.9.png differ diff --git a/res/drawable-xhdpi/screenpanel_hover.9.png b/res/drawable-xhdpi/screenpanel_hover.9.png new file mode 100644 index 000000000..a44dc113f Binary files /dev/null and b/res/drawable-xhdpi/screenpanel_hover.9.png differ diff --git a/res/drawable-xxhdpi/homescreen_blue_normal_holo.9.png b/res/drawable-xxhdpi/homescreen_blue_normal_holo.9.png deleted file mode 100644 index 040748a49..000000000 Binary files a/res/drawable-xxhdpi/homescreen_blue_normal_holo.9.png and /dev/null differ diff --git a/res/drawable-xxhdpi/homescreen_blue_strong_holo.9.png b/res/drawable-xxhdpi/homescreen_blue_strong_holo.9.png deleted file mode 100644 index b75b3221b..000000000 Binary files a/res/drawable-xxhdpi/homescreen_blue_strong_holo.9.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_gel_setting_icn.png b/res/drawable-xxhdpi/ic_gel_setting_icn.png deleted file mode 100644 index 813716def..000000000 Binary files a/res/drawable-xxhdpi/ic_gel_setting_icn.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_gel_wallpaper_icn.png b/res/drawable-xxhdpi/ic_gel_wallpaper_icn.png deleted file mode 100644 index 352544606..000000000 Binary files a/res/drawable-xxhdpi/ic_gel_wallpaper_icn.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_gel_widget_icn.png b/res/drawable-xxhdpi/ic_gel_widget_icn.png deleted file mode 100644 index 934243706..000000000 Binary files a/res/drawable-xxhdpi/ic_gel_widget_icn.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_setting.png b/res/drawable-xxhdpi/ic_setting.png new file mode 100644 index 000000000..6e1e6627c Binary files /dev/null and b/res/drawable-xxhdpi/ic_setting.png differ diff --git a/res/drawable-xxhdpi/ic_wallpaper.png b/res/drawable-xxhdpi/ic_wallpaper.png new file mode 100644 index 000000000..c71844410 Binary files /dev/null and b/res/drawable-xxhdpi/ic_wallpaper.png differ diff --git a/res/drawable-xxhdpi/ic_widget.png b/res/drawable-xxhdpi/ic_widget.png new file mode 100644 index 000000000..fddfecaa3 Binary files /dev/null and b/res/drawable-xxhdpi/ic_widget.png differ diff --git a/res/drawable-xxhdpi/screenpanel.9.png b/res/drawable-xxhdpi/screenpanel.9.png new file mode 100644 index 000000000..c44f3b898 Binary files /dev/null and b/res/drawable-xxhdpi/screenpanel.9.png differ diff --git a/res/drawable-xxhdpi/screenpanel_hover.9.png b/res/drawable-xxhdpi/screenpanel_hover.9.png new file mode 100644 index 000000000..1ab18da6a Binary files /dev/null and b/res/drawable-xxhdpi/screenpanel_hover.9.png differ diff --git a/res/layout/overview_panel.xml b/res/layout/overview_panel.xml index e4f4c8960..751579324 100644 --- a/res/layout/overview_panel.xml +++ b/res/layout/overview_panel.xml @@ -22,24 +22,30 @@ android:paddingBottom="@dimen/overview_panel_bottom_padding"> + android:drawableTop="@drawable/ic_wallpaper" + android:gravity="center_horizontal" + android:fontFamily="sans-serif-condensed" + android:textAllCaps="true" + android:textSize="12sp" /> + android:gravity="center_horizontal" + android:drawableTop="@drawable/ic_widget" + android:fontFamily="sans-serif-condensed" + android:textAllCaps="true" + android:textSize="12sp"/> @@ -49,6 +55,9 @@ android:layout_height="wrap_content" android:text="@string/settings_button_text" android:drawablePadding="4dp" - android:drawableTop="@drawable/ic_gel_setting_icn" - android:textSize="18dp" /> + android:gravity="center_horizontal" + android:drawableTop="@drawable/ic_setting" + android:fontFamily="sans-serif-condensed" + android:textAllCaps="true" + android:textSize="12sp" /> diff --git a/res/values/colors.xml b/res/values/colors.xml index 6b9221c33..48a06fc7d 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -34,4 +34,5 @@ #FFF #66000000 #FF333333 + #FFFFFFFF diff --git a/res/values/config.xml b/res/values/config.xml index 202764028..fa84b9bc6 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -17,7 +17,7 @@ 80 - 50 + 58 diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 7a1a7aaf8..2910b7c7c 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -41,7 +41,8 @@ 0dp 15dp 50dp - 40dp + 60dp + 130dp 4dip diff --git a/res/values/strings.xml b/res/values/strings.xml index 8406302c1..6c05f7d29 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -284,9 +284,9 @@ s --> - Add Widget + Widgets - Wallpaper + Wallpapers Settings diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 54f8846b1..287bb5096 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -99,7 +99,7 @@ public class BubbleTextView extends TextView { 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 661685b42..30ca7376b 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -214,8 +214,8 @@ public class CellLayout extends ViewGroup { 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 763dfa1a9..31a979760 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -111,6 +111,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc protected float mTouchX; protected boolean mFirstLayout = true; + private int mNormalChildHeight; protected int mCurrentPage; protected int mRestorePage = -1; @@ -722,6 +723,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc 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 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc // 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 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc 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 8cf2c41f6..aab0a639a 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -170,6 +170,7 @@ public class Workspace extends SmoothPagedView 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 @@ public class Workspace extends SmoothPagedView 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 @@ public class Workspace extends SmoothPagedView 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 @@ public class Workspace extends SmoothPagedView } } + 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 @@ public class Workspace extends SmoothPagedView 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 @@ public class Workspace extends SmoothPagedView mOldBackgroundAlphas[i] = cl.getBackgroundAlpha(); mNewBackgroundAlphas[i] = finalBackgroundAlpha; } else { - setScaleX(mNewScale); - setScaleY(mNewScale); cl.setBackgroundAlpha(finalBackgroundAlpha); cl.setShortcutAndWidgetAlpha(finalAlpha); } @@ -1891,6 +1906,7 @@ public class Workspace extends SmoothPagedView 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 @@ public class Workspace extends SmoothPagedView searchBar.setAlpha(finalSearchBarAlpha); AlphaUpdateListener.updateVisibility(searchBar); updateCustomContentVisibility(); + setScaleX(mNewScale); + setScaleY(mNewScale); + setTranslationY(finalWorkspaceTranslationY); } if (finalSearchBarAlpha == 0) { mLauncher.setVoiceButtonProxyVisible(false); @@ -2148,7 +2167,7 @@ public class Workspace extends SmoothPagedView * 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 @@ public class Workspace extends SmoothPagedView */ 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); -- cgit v1.2.3