Merge "Ensure page scrolls are initialized even for 0 children." into tm-dev

This commit is contained in:
Winson Chung
2022-05-27 17:42:22 +00:00
committed by Android (Google) Code Review
+5 -4
View File
@@ -727,15 +727,16 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
pageScrollChanged = true;
}
if (childCount == 0) {
return;
}
if (DEBUG) Log.d(TAG, "PagedView.onLayout()");
pageScrollChanged |= getPageScrolls(pageScrolls, true, SIMPLE_SCROLL_LOGIC);
mPageScrolls = pageScrolls;
if (childCount == 0) {
onPageScrollsInitialized();
return;
}
final LayoutTransition transition = getLayoutTransition();
// If the transition is running defer updating max scroll, as some empty pages could
// still be present, and a max scroll change could cause sudden jumps in scroll.