From 94309887fe7ebcbb7236da2b261546be9649f7de Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Fri, 8 Jun 2012 16:24:56 -0700 Subject: Improving overscroll paramaters for 7-inch devices Change-Id: Iba805137fca121bab7675eac22236af9642c27bb --- res/values-sw600dp/config.xml | 4 ++++ res/values-sw720dp/config.xml | 3 +++ res/values/config.xml | 3 +++ src/com/android/launcher2/Workspace.java | 5 +++-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/res/values-sw600dp/config.xml b/res/values-sw600dp/config.xml index a463d73df..02789deb8 100644 --- a/res/values-sw600dp/config.xml +++ b/res/values-sw600dp/config.xml @@ -13,4 +13,8 @@ -1 -1 -1 + + + 14000 diff --git a/res/values-sw720dp/config.xml b/res/values-sw720dp/config.xml index 7a6f6d82d..97a6e9f68 100644 --- a/res/values-sw720dp/config.xml +++ b/res/values-sw720dp/config.xml @@ -12,4 +12,7 @@ true true + + + 6500 diff --git a/res/values/config.xml b/res/values/config.xml index a8d80fee2..423a3a96f 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -67,6 +67,9 @@ 80 250 + + 6500 + 4 diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 11eb3c15b..0192630b6 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -77,7 +77,6 @@ public class Workspace extends SmoothPagedView // Y rotation to apply to the workspace screens private static final float WORKSPACE_OVERSCROLL_ROTATION = 24f; - private static float CAMERA_DISTANCE = 6500; private static final int CHILDREN_OUTLINE_FADE_OUT_DELAY = 0; private static final int CHILDREN_OUTLINE_FADE_OUT_DURATION = 375; @@ -196,6 +195,7 @@ public class Workspace extends SmoothPagedView private boolean mIsStaticWallpaper; private int mWallpaperTravelWidth; private int mSpringLoadedPageSpacing; + private int mCameraDistance; // Variables relating to the creation of user folders by hovering shortcuts over shortcuts private static final int FOLDER_CREATION_TIMEOUT = 0; @@ -321,6 +321,7 @@ public class Workspace extends SmoothPagedView res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f; mSpringLoadedPageSpacing = res.getDimensionPixelSize(R.dimen.workspace_spring_loaded_page_spacing); + mCameraDistance = res.getInteger(R.integer.config_cameraDistance); // if the value is manually specified, use that instead cellCountX = a.getInt(R.styleable.Workspace_cellCountX, cellCountX); @@ -1273,7 +1274,7 @@ public class Workspace extends SmoothPagedView setFadeForOverScroll(Math.abs(scrollProgress)); if (!mOverscrollTransformsSet) { mOverscrollTransformsSet = true; - cl.setCameraDistance(mDensity * CAMERA_DISTANCE); + cl.setCameraDistance(mDensity * mCameraDistance); cl.setPivotX(cl.getMeasuredWidth() * (index == 0 ? 0.75f : 0.25f)); cl.setPivotY(cl.getMeasuredHeight() * 0.5f); cl.setOverscrollTransformsDirty(true); -- cgit v1.2.3