Consider orientationHandler when calculating ClearAllButton scrollOffset
Bug: 185498648
Fixes: 185498648
Test: Manual
Change-Id: I7aaab4e62c3e7edf3ecdb3fe40020b8064e0109b
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 1df3d3c..57e14aa 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -3152,7 +3152,8 @@
// Align ClearAllButton to the left (RTL) or right (non-RTL), which is different from other
// TaskViews. This must be called after laying out ClearAllButton.
if (layoutChildren) {
- int clearAllWidthDiff = mTaskWidth - mClearAllButton.getWidth();
+ int clearAllWidthDiff = mOrientationHandler.getPrimaryValue(mTaskWidth, mTaskHeight)
+ - mOrientationHandler.getPrimarySize(mClearAllButton);
mClearAllButton.setScrollOffsetPrimary(mIsRtl ? clearAllWidthDiff : -clearAllWidthDiff);
}