diff options
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 2cbbaa702..aa919b307 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 |