Changes page alignment in PagedView calcualtion
- Align pages to right (instead of left) in RTL, to make scroll calculation for grid overview easier for out of orientation tasks
- Changed TaskView pivot direction to be consistent with page alignment
- Add scroll offset for ClearAllButton to align to left in RTL
- Fixed Workspace scroll issues in RTL, and removed needs to use panelCount when calculating page scroll
Bug: 175939487
Test: Test carousel/grid overveiw, Workspace, Folder scroll view for normal/RTL
Change-Id: Ic0ba88e5d58638e1149d97a68a978d80fbf26774
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 76885cc..01f7c71 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -715,13 +715,10 @@
final int primaryDimension = bounds.primaryDimension;
final int childPrimaryEnd = bounds.childPrimaryEnd;
- // In case the pages are of different width, align the page to left or right edge
- // based on the orientation.
- // In case we have multiple panels on the screen, scrollOffsetEnd is the scroll
- // needed for the whole visible area, so we have to divide it by panelCount.
- final int pageScroll = mIsRtl
- ? (childStart - scrollOffsetStart)
- : Math.max(0, childPrimaryEnd - scrollOffsetEnd / getPanelCount());
+ // In case the pages are of different width, align the page to left edge for non-RTL
+ // or right edge for RTL.
+ final int pageScroll =
+ mIsRtl ? childPrimaryEnd - scrollOffsetEnd : childStart - scrollOffsetStart;
if (outPageScrolls[i] != pageScroll) {
pageScrollChanged = true;
outPageScrolls[i] = pageScroll;