summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2015-06-10 18:40:05 -0700
committerAdam Cohen <adamcohen@google.com>2015-06-10 18:45:38 -0700
commitb2b02b9bd2e0b0da7373125c06f6d67d9758d8fe (patch)
tree0753ef4c06b9915cecbc1d7bfb21ba767322aa07
parent2d0fc8dccd49a630a1e4a18e6b6b773d7c7bde71 (diff)
downloadandroid_packages_apps_Trebuchet-b2b02b9bd2e0b0da7373125c06f6d67d9758d8fe.tar.gz
android_packages_apps_Trebuchet-b2b02b9bd2e0b0da7373125c06f6d67d9758d8fe.tar.bz2
android_packages_apps_Trebuchet-b2b02b9bd2e0b0da7373125c06f6d67d9758d8fe.zip
Fix a small UI nit with screen reordering
-> When in overview mode, flinging the pages can leave the scroller running (invisibly) for much additional time, since the scroller fling bounds far exceed the alloawble scroll bounds (in order to achieve a hard wall type effect) -> When this is happening, user couldn't pick up a page for reordering -> Ended the scroller early in this case to avoid the problem Change-Id: I8b6f140d9a87bb742e57625e90ca7d76a2158e28
-rw-r--r--src/com/android/launcher3/PagedView.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 18832c680..4a85b448f 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -567,6 +567,13 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
public void scrollTo(int x, int y) {
// In free scroll mode, we clamp the scrollX
if (mFreeScroll) {
+ // If the scroller is trying to move to a location beyond the maximum allowed
+ // in the free scroll mode, we make sure to end the scroll operation.
+ if (!mScroller.isFinished() &&
+ (x > mFreeScrollMaxScrollX || x < mFreeScrollMinScrollX)) {
+ forceFinishScroller();
+ }
+
x = Math.min(x, mFreeScrollMaxScrollX);
x = Math.max(x, mFreeScrollMinScrollX);
}