Merge "Page resets when scrolling slowly fix" into 24D1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d7022dc0ac
@@ -826,7 +826,9 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
|||||||
// or right edge for RTL.
|
// or right edge for RTL.
|
||||||
final int pageScroll =
|
final int pageScroll =
|
||||||
mIsRtl ? childPrimaryEnd - scrollOffsetEnd : childStart - scrollOffsetStart;
|
mIsRtl ? childPrimaryEnd - scrollOffsetEnd : childStart - scrollOffsetStart;
|
||||||
if (outPageScrolls[i] != pageScroll) {
|
// If there's more than one panel, only update scroll on leftmost panel.
|
||||||
|
if (outPageScrolls[i] != pageScroll
|
||||||
|
&& (panelCount <= 1 || i == getLeftmostVisiblePageForIndex(i))) {
|
||||||
pageScrollChanged = true;
|
pageScrollChanged = true;
|
||||||
outPageScrolls[i] = pageScroll;
|
outPageScrolls[i] = pageScroll;
|
||||||
}
|
}
|
||||||
@@ -842,7 +844,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
|||||||
|
|
||||||
if (panelCount > 1) {
|
if (panelCount > 1) {
|
||||||
for (int i = 0; i < childCount; i++) {
|
for (int i = 0; i < childCount; i++) {
|
||||||
// In case we have multiple panels, always use left most panel's page scroll for all
|
// In case we have multiple panels, always use leftmost panel's page scroll for all
|
||||||
// panels on the screen.
|
// panels on the screen.
|
||||||
int adjustedScroll = outPageScrolls[getLeftmostVisiblePageForIndex(i)];
|
int adjustedScroll = outPageScrolls[getLeftmostVisiblePageForIndex(i)];
|
||||||
if (outPageScrolls[i] != adjustedScroll) {
|
if (outPageScrolls[i] != adjustedScroll) {
|
||||||
|
|||||||
Reference in New Issue
Block a user