Consider orientationHandler when calculating ClearAllButton scrollOffset

Bug: 185498648
Fixes: 185498648
Test: Manual
Change-Id: I7aaab4e62c3e7edf3ecdb3fe40020b8064e0109b
This commit is contained in:
Alex Chau
2021-04-15 20:14:41 +01:00
parent 84a1e40912
commit 8181479443
@@ -3152,7 +3152,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
// 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);
}