Merge "Only adjust min/max scroll for split screen in landscape" into sc-v2-dev am: fe69980f90

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15992132

Change-Id: Ia9fa4abf3e2ce8f5284c31fb8a66daa236be1794
This commit is contained in:
Alex Chau
2021-10-07 15:05:38 +00:00
committed by Automerger Merge Worker

View File

@@ -4358,12 +4358,14 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
protected int computeMinScroll() {
if (getTaskViewCount() > 0) {
int minScroll;
boolean isLandscapeGridSplit = mActivity.getDeviceProfile().isLandscape
&& showAsGrid() && isSplitSelectionActive();
if (mIsRtl) {
// If we aren't showing the clear all button, use the rightmost task as the min
// scroll.
minScroll = getScrollForPage(mDisallowScrollToClearAll ? indexOfChild(
getTaskViewAt(getTaskViewCount() - 1)) : indexOfChild(mClearAllButton));
if (showAsGrid() && isSplitSelectionActive()
if (isLandscapeGridSplit
&& mSplitSelectStateController.getActiveSplitStagePosition()
== SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT) {
minScroll -= mSplitPlaceholderSize;
@@ -4372,7 +4374,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null;
minScroll = getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView)
: 0);
// TODO(b/200537659): Adjust according to mSplitPlaceholderSize.
// TODO(b/200537659): Adjust according to mSplitPlaceholderSize when
// isLandscapeGridSplit is true.
}
return minScroll;
}
@@ -4383,11 +4386,13 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
protected int computeMaxScroll() {
if (getTaskViewCount() > 0) {
int maxScroll;
boolean isLandscapeGridSplit = mActivity.getDeviceProfile().isLandscape
&& showAsGrid() && isSplitSelectionActive();
if (mIsRtl) {
TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null;
maxScroll = getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView)
: 0);
if (showAsGrid() && isSplitSelectionActive()
if (isLandscapeGridSplit
&& mSplitSelectStateController.getActiveSplitStagePosition()
== SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) {
maxScroll += mSplitPlaceholderSize;
@@ -4397,7 +4402,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
// scroll.
maxScroll = getScrollForPage(mDisallowScrollToClearAll ? indexOfChild(
getTaskViewAt(getTaskViewCount() - 1)) : indexOfChild(mClearAllButton));
// TODO(b/200537659): Adjust according to mSplitPlaceholderSize.
// TODO(b/200537659): Adjust according to mSplitPlaceholderSize when
// isLandscapeGridSplit is true.
}
return maxScroll;
}