diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java index 4f5f27a2c0..e79d56b631 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java @@ -17,8 +17,6 @@ package com.android.launcher3.uioverrides.states; import com.android.launcher3.Launcher; -import com.android.launcher3.R; -import com.android.launcher3.touch.PagedOrientationHandler; import com.android.quickstep.views.RecentsView; /** @@ -38,12 +36,6 @@ public class SplitScreenSelectState extends OverviewState { @Override public float getSplitSelectTranslation(Launcher launcher) { RecentsView recentsView = launcher.getOverviewPanel(); - int splitPosition = recentsView.getSplitPlaceholder().getActiveSplitStagePosition(); - if (!recentsView.shouldShiftThumbnailsForSplitSelect()) { - return 0f; - } - PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler(); - int direction = orientationHandler.getSplitTranslationDirectionFactor(splitPosition); - return launcher.getResources().getDimension(R.dimen.split_placeholder_size) * direction; + return recentsView.getSplitSelectTranslation(); } } diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java index a343e0a593..283c6745df 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java @@ -150,6 +150,11 @@ public class FloatingTaskView extends FrameLayout { mOrientationHandler.setSecondaryScale(mSplitPlaceholderView.getIconView(), childScaleY); } + public void updateOrientationHandler(PagedOrientationHandler orientationHandler) { + mOrientationHandler = orientationHandler; + mSplitPlaceholderView.getIconView().setRotation(mOrientationHandler.getDegreesRotated()); + } + protected void initPosition(RectF pos, InsettableFrameLayout.LayoutParams lp) { mStartingPosition.set(pos); lp.ignoreInsets = true; diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java index 3e06f55829..6b7d8a557f 100644 --- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java +++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java @@ -24,7 +24,6 @@ import static com.android.launcher3.LauncherState.SPRING_LOADED; import android.annotation.TargetApi; import android.content.Context; -import android.content.res.Configuration; import android.os.Build; import android.util.AttributeSet; import android.view.MotionEvent; @@ -171,10 +170,13 @@ public class LauncherRecentsView extends RecentsView taskViewsFloat = + orientationHandler.getSplitSelectTaskOffset( + TASK_PRIMARY_SPLIT_TRANSLATION, TASK_SECONDARY_SPLIT_TRANSLATION, + mActivity.getDeviceProfile()); + taskViewsFloat.first.set(this, getSplitSelectTranslation()); + taskViewsFloat.second.set(this, 0f); + + applySplitPrimaryScrollOffset(); + } + private void updateDeadZoneRects() { // Get the deadzone rect surrounding the clear all button to not dismiss overview to home mClearAllButtonDeadZoneRect.setEmpty(); diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java index 0c390679d9..9a2d6d8c54 100644 --- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java @@ -255,7 +255,7 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler { } @Override - public int getSplitTranslationDirectionFactor(int stagePosition) { + public int getSplitTranslationDirectionFactor(int stagePosition, DeviceProfile deviceProfile) { if (stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) { return -1; } else { diff --git a/src/com/android/launcher3/touch/PagedOrientationHandler.java b/src/com/android/launcher3/touch/PagedOrientationHandler.java index 54b30fbec8..95168fb3d6 100644 --- a/src/com/android/launcher3/touch/PagedOrientationHandler.java +++ b/src/com/android/launcher3/touch/PagedOrientationHandler.java @@ -95,7 +95,8 @@ public interface PagedOrientationHandler { int getScrollOffsetStart(View view, Rect insets); int getScrollOffsetEnd(View view, Rect insets); int getSecondaryTranslationDirectionFactor(); - int getSplitTranslationDirectionFactor(@StagePosition int stagePosition); + int getSplitTranslationDirectionFactor(@StagePosition int stagePosition, + DeviceProfile deviceProfile); ChildBounds getChildBounds(View child, int childStart, int pageCenter, boolean layoutChild); void setMaxScroll(AccessibilityEvent event, int maxScroll); boolean getRecentsRtlSetting(Resources resources); diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java index cb1ba7d402..7d70f77138 100644 --- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java +++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java @@ -261,8 +261,8 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { } @Override - public int getSplitTranslationDirectionFactor(int stagePosition) { - if (stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) { + public int getSplitTranslationDirectionFactor(int stagePosition, DeviceProfile deviceProfile) { + if (deviceProfile.isLandscape && stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) { return -1; } else { return 1; diff --git a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java index ce2e13644d..a921f943d1 100644 --- a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java @@ -37,7 +37,6 @@ import android.widget.LinearLayout; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.Utilities; -import com.android.launcher3.util.SplitConfigurationOptions; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; import com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds; import com.android.launcher3.views.BaseDragLayer; @@ -53,7 +52,7 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler { } @Override - public int getSplitTranslationDirectionFactor(int stagePosition) { + public int getSplitTranslationDirectionFactor(int stagePosition, DeviceProfile deviceProfile) { if (stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) { return -1; } else {