diff options
-rw-r--r-- | res/drawable-hdpi/overscroll_glow_left.9.png | bin | 848 -> 858 bytes | |||
-rw-r--r-- | res/drawable-mdpi/overscroll_glow_left.9.png | bin | 547 -> 552 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/overscroll_glow_left.9.png | bin | 1236 -> 1249 bytes | |||
-rw-r--r-- | res/drawable-xxhdpi/overscroll_glow_left.9.png | bin | 2800 -> 4562 bytes | |||
-rw-r--r-- | res/values/config.xml | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 17 |
6 files changed, 9 insertions, 10 deletions
diff --git a/res/drawable-hdpi/overscroll_glow_left.9.png b/res/drawable-hdpi/overscroll_glow_left.9.png Binary files differindex 782ecf1c6..aaf43c73a 100644 --- a/res/drawable-hdpi/overscroll_glow_left.9.png +++ b/res/drawable-hdpi/overscroll_glow_left.9.png diff --git a/res/drawable-mdpi/overscroll_glow_left.9.png b/res/drawable-mdpi/overscroll_glow_left.9.png Binary files differindex 147e6a6b4..b79cdcdc2 100644 --- a/res/drawable-mdpi/overscroll_glow_left.9.png +++ b/res/drawable-mdpi/overscroll_glow_left.9.png diff --git a/res/drawable-xhdpi/overscroll_glow_left.9.png b/res/drawable-xhdpi/overscroll_glow_left.9.png Binary files differindex 8ece7f218..4f248f70b 100644 --- a/res/drawable-xhdpi/overscroll_glow_left.9.png +++ b/res/drawable-xhdpi/overscroll_glow_left.9.png diff --git a/res/drawable-xxhdpi/overscroll_glow_left.9.png b/res/drawable-xxhdpi/overscroll_glow_left.9.png Binary files differindex e188ce8ac..1a895cdc8 100644 --- a/res/drawable-xxhdpi/overscroll_glow_left.9.png +++ b/res/drawable-xxhdpi/overscroll_glow_left.9.png diff --git a/res/values/config.xml b/res/values/config.xml index fa84b9bc6..97408ccab 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -71,7 +71,7 @@ <integer name="config_dragFadeOutDuration">250</integer> <!-- Camera distance for the overscroll effect --> - <integer name="config_cameraDistance">6500</integer> + <integer name="config_cameraDistance">8000</integer> <!-- Whether or not to use custom clings if a custom workspace layout is passed in --> <bool name="config_useCustomClings">false</bool> diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index dcf10697e..1425f7ff5 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -194,6 +194,7 @@ public class Workspace extends SmoothPagedView private final int[] mTempXY = new int[2]; private int[] mTempVisiblePagesRange = new int[2]; private boolean mOverscrollTransformsSet; + private float mLastOverscrollPivotX; public static final int DRAG_BITMAP_PADDING = 2; private boolean mWorkspaceFadeInAdjacentScreens; @@ -1413,22 +1414,20 @@ public class Workspace extends SmoothPagedView final float rightBiasedPivot = 0.75f; final int lowerIndex = 0; final int upperIndex = getChildCount() - 1; - if (isRtl) { - index = mOverScrollX < 0 ? upperIndex : lowerIndex; - pivotX = (index == 0 ? leftBiasedPivot : rightBiasedPivot); - } else { - index = mOverScrollX < 0 ? lowerIndex : upperIndex; - pivotX = (index == 0 ? rightBiasedPivot : leftBiasedPivot); - } + + final boolean isLeftPage = mOverScrollX < 0; + index = (!isRtl && isLeftPage) || (isRtl && !isLeftPage) ? lowerIndex : upperIndex; + pivotX = isLeftPage ? rightBiasedPivot : leftBiasedPivot; CellLayout cl = (CellLayout) getChildAt(index); float scrollProgress = getScrollProgress(screenCenter, cl, index); - final boolean isLeftPage = (isRtl ? index > 0 : index == 0); cl.setOverScrollAmount(Math.abs(scrollProgress), isLeftPage); float rotation = -WORKSPACE_OVERSCROLL_ROTATION * scrollProgress; cl.setRotationY(rotation); - if (!mOverscrollTransformsSet) { + + if (!mOverscrollTransformsSet || Float.compare(mLastOverscrollPivotX, pivotX) != 0) { mOverscrollTransformsSet = true; + mLastOverscrollPivotX = pivotX; cl.setCameraDistance(mDensity * mCameraDistance); cl.setPivotX(cl.getMeasuredWidth() * pivotX); cl.setPivotY(cl.getMeasuredHeight() * 0.5f); |