diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 68628746a5..5e645ea917 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1557,6 +1557,11 @@ public abstract class RecentsView taskGroups) { if (mPendingAnimation != null) { mPendingAnimation.addEndListener(success -> applyLoadPlan(taskGroups)); @@ -1570,6 +1575,9 @@ public abstract class RecentsView extends ViewGrou } /** Returns true iff this PagedView's scroll amounts are initialized to each page index. */ - protected boolean pageScrollsInitialized() { + protected boolean isPageScrollsInitialized() { return mPageScrolls != null && mPageScrolls.length == getChildCount(); } @@ -708,12 +708,12 @@ public abstract class PagedView extends ViewGrou */ public void runOnPageScrollsInitialized(Runnable callback) { mOnPageScrollsInitializedCallbacks.add(callback); - if (pageScrollsInitialized()) { + if (isPageScrollsInitialized()) { onPageScrollsInitialized(); } } - private void onPageScrollsInitialized() { + protected void onPageScrollsInitialized() { for (Runnable callback : mOnPageScrollsInitializedCallbacks) { callback.run(); } @@ -727,7 +727,7 @@ public abstract class PagedView extends ViewGrou final int childCount = getChildCount(); int[] pageScrolls = mPageScrolls; boolean pageScrollChanged = false; - if (!pageScrollsInitialized()) { + if (!isPageScrollsInitialized()) { pageScrolls = new int[childCount]; pageScrollChanged = true; } @@ -1199,7 +1199,7 @@ public abstract class PagedView extends ViewGrou } public int getScrollForPage(int index) { - if (!pageScrollsInitialized() || index >= mPageScrolls.length || index < 0) { + if (!isPageScrollsInitialized() || index >= mPageScrolls.length || index < 0) { return 0; } else { return mPageScrolls[index]; @@ -1209,7 +1209,7 @@ public abstract class PagedView extends ViewGrou // While layout transitions are occurring, a child's position may stray from its baseline // position. This method returns the magnitude of this stray at any given time. public int getLayoutTransitionOffsetForPage(int index) { - if (!pageScrollsInitialized() || index >= mPageScrolls.length || index < 0) { + if (!isPageScrollsInitialized() || index >= mPageScrolls.length || index < 0) { return 0; } else { View child = getChildAt(index);