Merge "Avoid seeing ClearAllButton for overview grid's snap position" into sc-v2-dev
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index be6e3ff..6ea4a0d 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -3756,8 +3756,8 @@
             TaskView taskView = getTaskViewAt(i);
             float scrollDiff = taskView.getScrollAdjustment(showAsFullscreen, showAsGrid);
             int pageScroll = newPageScrolls[i + mTaskViewStartIndex] + (int) scrollDiff;
-            if ((mIsRtl && pageScroll < clearAllScroll)
-                    || (!mIsRtl && pageScroll > clearAllScroll)) {
+            if ((mIsRtl && pageScroll < clearAllScroll + clearAllWidth)
+                    || (!mIsRtl && pageScroll > clearAllScroll - clearAllWidth)) {
                 pageScroll = clearAllScroll + (mIsRtl ? clearAllWidth : -clearAllWidth);
             }
             if (outPageScrolls[i] != pageScroll) {