diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index e1a389582f..74c8e395c7 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -409,7 +409,7 @@ public abstract class RecentsView 0) { + int minScroll; if (mIsRtl) { // If we aren't showing the clear all button, use the rightmost task as the min // scroll. - return getScrollForPage(mDisallowScrollToClearAll ? indexOfChild( + minScroll = getScrollForPage(mDisallowScrollToClearAll ? indexOfChild( getTaskViewAt(getTaskViewCount() - 1)) : indexOfChild(mClearAllButton)); + if (showAsGrid() && isSplitSelectionActive() + && mSplitSelectStateController.getActiveSplitStagePosition() + == SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT) { + minScroll -= mSplitPlaceholderSize; + } } else { TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null; - return getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView) + minScroll = getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView) : 0); + // TODO(b/200537659): Adjust according to mSplitPlaceholderSize. } + return minScroll; } return super.computeMinScroll(); } @@ -4366,16 +4375,24 @@ public abstract class RecentsView 0) { + int maxScroll; if (mIsRtl) { TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null; - return getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView) + maxScroll = getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView) : 0); + if (showAsGrid() && isSplitSelectionActive() + && mSplitSelectStateController.getActiveSplitStagePosition() + == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) { + maxScroll += mSplitPlaceholderSize; + } } else { // If we aren't showing the clear all button, use the leftmost task as the min // scroll. - return getScrollForPage(mDisallowScrollToClearAll ? indexOfChild( + maxScroll = getScrollForPage(mDisallowScrollToClearAll ? indexOfChild( getTaskViewAt(getTaskViewCount() - 1)) : indexOfChild(mClearAllButton)); + // TODO(b/200537659): Adjust according to mSplitPlaceholderSize. } + return maxScroll; } return super.computeMaxScroll(); }