summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-10-25 00:40:34 (GMT)
committerDanesh M <daneshm90@gmail.com>2015-09-28 01:55:56 (GMT)
commit42bdeeea7fd06c71f6aa1b179ada3c8c7b1559ba (patch)
tree258967f09069242d42b01d5e52cfa3bcdcc42e87
parentbb2619a2c4f53acca421f98a17f46d96b17fa68f (diff)
downloadandroid_packages_apps_Trebuchet-42bdeeea7fd06c71f6aa1b179ada3c8c7b1559ba.zip
android_packages_apps_Trebuchet-42bdeeea7fd06c71f6aa1b179ada3c8c7b1559ba.tar.gz
android_packages_apps_Trebuchet-42bdeeea7fd06c71f6aa1b179ada3c8c7b1559ba.tar.bz2
Fix edge case where LauncherOverlay scroll woudln't be reset
-> If the Workspace has a single page and the user goes from overscrolling in one direction, and then the other, the LauncherOverlay scroll wouldn't be set to 0 until the scrolling settled Change-Id: I29ee9abdfa023ae3599d1590cdaebf457e2220fa
-rw-r--r--src/com/android/launcher3/Workspace.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 2cbbaa7..aa919b3 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -301,6 +301,7 @@ public class Workspace extends SmoothPagedView
boolean mScrollInteractionBegan;
boolean mStartedSendingScrollEvents;
boolean mShouldSendPageSettled;
+ int mLastOverlaySroll = 0;
private final Runnable mBindPages = new Runnable() {
@Override
@@ -1322,8 +1323,11 @@ public class Workspace extends SmoothPagedView
boolean shouldOverScroll = (amount <= 0 && (!hasCustomContent() || isRtl)) ||
(amount >= 0 && (!hasCustomContent() || !isRtl));
- boolean shouldScrollOverlay = (amount <= 0 && mLauncherOverlay != null && !isRtl) ||
- (amount >= 0 && mLauncherOverlay != null && isRtl);
+ boolean shouldScrollOverlay = mLauncherOverlay != null &&
+ ((amount <= 0 && !isRtl) || (amount >= 0 && isRtl));
+
+ boolean shouldZeroOverlay = mLauncherOverlay != null && mLastOverlaySroll != 0 &&
+ ((amount >= 0 && !isRtl) || (amount <= 0 && isRtl));
if (shouldScrollOverlay) {
if (!mStartedSendingScrollEvents && mScrollInteractionBegan) {
@@ -1336,6 +1340,7 @@ public class Workspace extends SmoothPagedView
int progress = (int) Math.abs((f * 100));
+ mLastOverlaySroll = progress;
mLauncherOverlay.onScrollChange(progress, isRtl);
} else if (shouldOverScroll) {
dampedOverScroll(amount);
@@ -1343,6 +1348,10 @@ public class Workspace extends SmoothPagedView
} else {
mOverScrollEffect = 0;
}
+
+ if (shouldZeroOverlay) {
+ mLauncherOverlay.onScrollChange(0, isRtl);
+ }
}
@Override