Loading quickstep/src/com/android/quickstep/views/RecentsView.java +12 −1 Original line number Diff line number Diff line Loading @@ -1557,6 +1557,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T ActiveGestureErrorDetector.GestureEvent.SCROLLER_ANIMATION_ABORTED); } @Override protected boolean isPageScrollsInitialized() { return super.isPageScrollsInitialized() && mLoadPlanEverApplied; } protected void applyLoadPlan(ArrayList<GroupTask> taskGroups) { if (mPendingAnimation != null) { mPendingAnimation.addEndListener(success -> applyLoadPlan(taskGroups)); Loading @@ -1570,6 +1575,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T // With all tasks removed, touch handling in PagedView is disabled and we need to reset // touch state or otherwise values will be obsolete. resetTouchState(); if (isPageScrollsInitialized()) { onPageScrollsInitialized(); } return; } Loading Loading @@ -1723,6 +1731,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T resetTaskVisuals(); onTaskStackUpdated(); updateEnabledOverlays(); if (isPageScrollsInitialized()) { onPageScrollsInitialized(); } } private boolean isModal() { Loading Loading @@ -2066,7 +2077,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T if (!mActivity.getDeviceProfile().isTablet) { return super.getDestinationPage(scaledScroll); } if (!pageScrollsInitialized()) { if (!isPageScrollsInitialized()) { Log.e(TAG, "Cannot get destination page: RecentsView not properly initialized", new IllegalStateException()); Loading src/com/android/launcher3/PagedView.java +6 −6 Original line number Diff line number Diff line Loading @@ -699,7 +699,7 @@ public abstract class PagedView<T extends View & PageIndicator> 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(); } Loading @@ -708,12 +708,12 @@ public abstract class PagedView<T extends View & PageIndicator> 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(); } Loading @@ -727,7 +727,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou final int childCount = getChildCount(); int[] pageScrolls = mPageScrolls; boolean pageScrollChanged = false; if (!pageScrollsInitialized()) { if (!isPageScrollsInitialized()) { pageScrolls = new int[childCount]; pageScrollChanged = true; } Loading Loading @@ -1199,7 +1199,7 @@ public abstract class PagedView<T extends View & PageIndicator> 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]; Loading @@ -1209,7 +1209,7 @@ public abstract class PagedView<T extends View & PageIndicator> 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); Loading Loading
quickstep/src/com/android/quickstep/views/RecentsView.java +12 −1 Original line number Diff line number Diff line Loading @@ -1557,6 +1557,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T ActiveGestureErrorDetector.GestureEvent.SCROLLER_ANIMATION_ABORTED); } @Override protected boolean isPageScrollsInitialized() { return super.isPageScrollsInitialized() && mLoadPlanEverApplied; } protected void applyLoadPlan(ArrayList<GroupTask> taskGroups) { if (mPendingAnimation != null) { mPendingAnimation.addEndListener(success -> applyLoadPlan(taskGroups)); Loading @@ -1570,6 +1575,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T // With all tasks removed, touch handling in PagedView is disabled and we need to reset // touch state or otherwise values will be obsolete. resetTouchState(); if (isPageScrollsInitialized()) { onPageScrollsInitialized(); } return; } Loading Loading @@ -1723,6 +1731,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T resetTaskVisuals(); onTaskStackUpdated(); updateEnabledOverlays(); if (isPageScrollsInitialized()) { onPageScrollsInitialized(); } } private boolean isModal() { Loading Loading @@ -2066,7 +2077,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T if (!mActivity.getDeviceProfile().isTablet) { return super.getDestinationPage(scaledScroll); } if (!pageScrollsInitialized()) { if (!isPageScrollsInitialized()) { Log.e(TAG, "Cannot get destination page: RecentsView not properly initialized", new IllegalStateException()); Loading
src/com/android/launcher3/PagedView.java +6 −6 Original line number Diff line number Diff line Loading @@ -699,7 +699,7 @@ public abstract class PagedView<T extends View & PageIndicator> 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(); } Loading @@ -708,12 +708,12 @@ public abstract class PagedView<T extends View & PageIndicator> 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(); } Loading @@ -727,7 +727,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou final int childCount = getChildCount(); int[] pageScrolls = mPageScrolls; boolean pageScrollChanged = false; if (!pageScrollsInitialized()) { if (!isPageScrollsInitialized()) { pageScrolls = new int[childCount]; pageScrollChanged = true; } Loading Loading @@ -1199,7 +1199,7 @@ public abstract class PagedView<T extends View & PageIndicator> 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]; Loading @@ -1209,7 +1209,7 @@ public abstract class PagedView<T extends View & PageIndicator> 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); Loading