From f4f0c4d82a993b73b0afe90bdfb1d14026625401 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Wed, 5 May 2021 10:28:05 -0700 Subject: [PATCH] Prevent thumbnails from shifting if placeholder view doesn't overlap Always shift thumbnails when in phone mode. Bug: 181705607 Test: Placeholder view didn't shift when no thumbnails underneath it in portrait. Change-Id: Ib2f066fdf17134b3f5bbd9b465b87868e9ce7583 --- .../BaseRecentsViewStateController.java | 2 +- .../states/SplitScreenSelectState.java | 7 +++- .../android/quickstep/views/RecentsView.java | 42 +++++++++++++++++++ src/com/android/launcher3/LauncherState.java | 6 +-- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index e508690113..2eb19ec146 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -105,7 +105,7 @@ public abstract class BaseRecentsViewStateController TASK_PRIMARY_SPLIT_TRANSLATION, TASK_SECONDARY_SPLIT_TRANSLATION, mLauncher.getDeviceProfile()); setter.setFloat(mRecentsView, taskViewsFloat, - toState.getOverviewSecondaryTranslation(mLauncher), LINEAR); + toState.getSplitSelectTranslation(mLauncher), LINEAR); setter.setFloat(mRecentsView, getContentAlphaProperty(), toState.overviewUi ? 1 : 0, config.getInterpolator(ANIM_OVERVIEW_FADE, AGGRESSIVE_EASE_IN_OUT)); diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java index 722d74a55a..6968494b0f 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java @@ -41,11 +41,14 @@ public class SplitScreenSelectState extends OverviewState { } @Override - public float getOverviewSecondaryTranslation(Launcher launcher) { + public float getSplitSelectTranslation(Launcher launcher) { RecentsView recentsView = launcher.getOverviewPanel(); - PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler(); int splitPosition = recentsView.getSplitPlaceholder().getSplitController() .getActiveSplitPositionOption().mStagePosition; + if (!recentsView.shouldShiftThumbnailsForSplitSelect(splitPosition)) { + return 0f; + } + PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler(); int direction = orientationHandler.getSplitTranslationDirectionFactor(splitPosition); return launcher.getResources().getDimension(R.dimen.split_placeholder_size) * direction; } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index a04b886bd4..cf94d680e2 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -124,6 +124,7 @@ import com.android.launcher3.util.DynamicResource; import com.android.launcher3.util.IntSet; import com.android.launcher3.util.MultiValueAlpha; import com.android.launcher3.util.ResourceBasedOverride.Overrides; +import com.android.launcher3.util.SplitConfigurationOptions; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; import com.android.launcher3.util.Themes; import com.android.launcher3.util.TranslateEdgeEffect; @@ -2367,6 +2368,47 @@ public abstract class RecentsView