Merge "Proper fix for gesture nav flicker using runOnPageScrollsInitialized()" into tm-qpr-dev

This commit is contained in:
Tony Wickham
2022-07-06 16:30:01 +00:00
committed by Android (Google) Code Review
3 changed files with 3 additions and 5 deletions

View File

@@ -444,7 +444,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
});
setupRecentsViewUi();
linkRecentsViewScroll();
mRecentsView.runOnPageScrollsInitialized(this::linkRecentsViewScroll);
activity.runOnBindToTouchInteractionService(this::onLauncherBindToService);
mActivity.registerActivityLifecycleCallbacks(mLifecycleCallbacks);

View File

@@ -2303,7 +2303,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
boolean runningTaskTileHidden = mRunningTaskTileHidden;
setCurrentTask(runningTaskViewId);
mFocusedTaskViewId = runningTaskViewId;
setCurrentPage(getRunningTaskIndex());
runOnPageScrollsInitialized(() -> setCurrentPage(getRunningTaskIndex()));
setRunningTaskViewShowScreenshot(false);
setRunningTaskHidden(runningTaskTileHidden);
// Update task size after setting current task.

View File

@@ -1187,9 +1187,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
}
public int getScrollForPage(int index) {
// TODO(b/233112195): Use !pageScrollsInitialized() instead of mPageScrolls == null, once we
// root cause where we should be using runOnPageScrollsInitialized().
if (mPageScrolls == null || index >= mPageScrolls.length || index < 0) {
if (!pageScrollsInitialized() || index >= mPageScrolls.length || index < 0) {
return 0;
} else {
return mPageScrolls[index];