mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 18:28:20 +00:00
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
This commit is contained in:
@@ -715,13 +715,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user