summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2012-06-11 18:42:01 (GMT)
committerAndroid Git Automerger <android-git-automerger@android.com>2012-06-11 18:42:01 (GMT)
commitb5703df0580bb225d59e914e81a73acb0ab0e791 (patch)
treec1e8f2e269bf2fcf6ee6afb0fdf333d8b3f4513a
parent97ade3390c66c145f94e497464947c581b60308d (diff)
parent94309887fe7ebcbb7236da2b261546be9649f7de (diff)
downloadandroid_packages_apps_Trebuchet-b5703df0580bb225d59e914e81a73acb0ab0e791.zip
android_packages_apps_Trebuchet-b5703df0580bb225d59e914e81a73acb0ab0e791.tar.gz
android_packages_apps_Trebuchet-b5703df0580bb225d59e914e81a73acb0ab0e791.tar.bz2
am 94309887: Improving overscroll paramaters for 7-inch devices
* commit '94309887fe7ebcbb7236da2b261546be9649f7de': Improving overscroll paramaters for 7-inch devices
-rw-r--r--res/values-sw600dp/config.xml4
-rw-r--r--res/values-sw720dp/config.xml3
-rw-r--r--res/values/config.xml3
-rw-r--r--src/com/android/launcher2/Workspace.java5
4 files changed, 13 insertions, 2 deletions
diff --git a/res/values-sw600dp/config.xml b/res/values-sw600dp/config.xml
index a463d73..02789de 100644
--- a/res/values-sw600dp/config.xml
+++ b/res/values-sw600dp/config.xml
@@ -13,4 +13,8 @@
<integer name="folder_max_count_x">-1</integer>
<integer name="folder_max_count_y">-1</integer>
<integer name="folder_max_num_items">-1</integer>
+
+ <!-- Camera distance for the overscroll effect. We use a higher value here because the
+ workspace screens run nearly flush to the edge of the screen-->
+ <integer name="config_cameraDistance">14000</integer>
</resources>
diff --git a/res/values-sw720dp/config.xml b/res/values-sw720dp/config.xml
index 7a6f6d8..97a6e9f 100644
--- a/res/values-sw720dp/config.xml
+++ b/res/values-sw720dp/config.xml
@@ -12,4 +12,7 @@
<bool name="config_useDropTargetDownTransition">true</bool>
<!-- Whether or not to fade the side pages -->
<bool name="config_workspaceFadeAdjacentScreens">true</bool>
+
+ <!-- Camera distance for the overscroll effect -->
+ <integer name="config_cameraDistance">6500</integer>
</resources>
diff --git a/res/values/config.xml b/res/values/config.xml
index a8d80fe..423a3a9 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -67,6 +67,9 @@
<integer name="config_dragFadeOutAlpha">80</integer>
<integer name="config_dragFadeOutDuration">250</integer>
+ <!-- Camera distance for the overscroll effect -->
+ <integer name="config_cameraDistance">6500</integer>
+
<!-- Folder max bounds and max number of items. Note: folder_max_count_x * folder_max_count_y
>= folder_max_num_items. When these are set to -1, they are automatically determined. -->
<integer name="folder_max_count_x">4</integer>
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 11eb3c1..0192630 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);