Avoid seeing ClearAllButton for overview grid's snap position
- This is a follow-up of http://ag/15220572
- When determining if task's snap position is too close to ClearAllButton, avoid positions that will see part of ClearAllButton
Bug: 192254835
Test: manual
Change-Id: I09425075ff0c24835ac3c4e79856aef7985476b2
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index edda439..c19772a 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -3710,8 +3710,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) {