Merge "Code cleanup from rebase" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-08-28 00:57:22 +00:00
committed by Android (Google) Code Review
4 changed files with 0 additions and 77 deletions
@@ -43,12 +43,7 @@ public class SplitScreenSelectState extends OverviewState {
@Override
public float getSplitSelectTranslation(Launcher launcher) {
RecentsView recentsView = launcher.getOverviewPanel();
//<<<<<<< HEAD
// int splitPosition = recentsView.getSplitPlaceholder()
// .getActiveSplitPositionOption().stagePosition;
//=======
int splitPosition = recentsView.getSplitPlaceholder().getActiveSplitStagePosition();
//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
if (!recentsView.shouldShiftThumbnailsForSplitSelect(splitPosition)) {
return 0f;
}
@@ -16,25 +16,18 @@
package com.android.quickstep.util;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
import android.app.ActivityThread;
import android.content.res.Resources;
import android.graphics.Rect;
import android.os.Handler;
import android.os.IBinder;
import android.view.Gravity;
import android.view.RemoteAnimationAdapter;
import android.view.SurfaceControl;
import android.window.TransitionInfo;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InsettableFrameLayout;
import com.android.launcher3.R;
import com.android.launcher3.util.SplitConfigurationOptions;
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
import com.android.quickstep.SystemUiProxy;
@@ -81,12 +74,7 @@ public class SplitSelectStateController {
public void setSecondTaskId(TaskView taskView) {
mSecondTaskView = taskView;
// Assume initial task is for top/left part of screen
//<<<<<<< HEAD
// final int[] taskIds = mInitialPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT
//=======
final int[] taskIds = mStagePosition == STAGE_POSITION_TOP_OR_LEFT
//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
? new int[]{mInitialTaskView.getTask().key.id, taskView.getTask().key.id}
: new int[]{taskView.getTask().key.id, mInitialTaskView.getTask().key.id};
if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
@@ -108,30 +96,6 @@ public class SplitSelectStateController {
}
}
/**
* @return {@link InsettableFrameLayout.LayoutParams} to correctly position the
* split placeholder view
*/
public InsettableFrameLayout.LayoutParams getLayoutParamsForActivePosition(Resources resources,
DeviceProfile deviceProfile) {
InsettableFrameLayout.LayoutParams params =
new InsettableFrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT);
//<<<<<<< HEAD
// boolean topLeftPosition = mInitialPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT;
//=======
boolean topLeftPosition = mStagePosition == STAGE_POSITION_TOP_OR_LEFT;
//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
if (deviceProfile.isLandscape) {
params.width = (int) resources.getDimension(R.dimen.split_placeholder_size);
params.gravity = topLeftPosition ? Gravity.START : Gravity.END;
} else {
params.height = (int) resources.getDimension(R.dimen.split_placeholder_size);
params.gravity = Gravity.TOP;
}
return params;
}
public @StagePosition int getActiveSplitStagePosition() {
return mStagePosition;
}
@@ -170,20 +170,11 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
DeviceProfile dp) {
// Don't use device profile here because we know we're in fake landscape, only split option
// available is top/left
//<<<<<<< HEAD
// if (splitPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT) {
// // Top (visually left) side
// return SPLIT_TRANSLATE_PRIMARY_NEGATIVE;
// }
// throw new IllegalStateException("Invalid split stage position: " +
// splitPosition.stagePosition);
//=======
if (stagePosition == STAGE_POSITION_TOP_OR_LEFT) {
// Top (visually left) side
return SPLIT_TRANSLATE_PRIMARY_NEGATIVE;
}
throw new IllegalStateException("Invalid split stage position: " + stagePosition);
//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
}
@Override
@@ -394,7 +385,6 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
}
@Override
//<<<<<<< HEAD
public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect,
SplitConfigurationOptions.StagedSplitBounds splitInfo, int desiredStagePosition) {
float diff;
@@ -435,11 +425,9 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
mSnapshotView2.setTranslationY(primaryLp.height + spaceAboveSnapshot + dividerBar);
}
//=======
@Override
public int getDefaultSplitPosition(DeviceProfile deviceProfile) {
throw new IllegalStateException("Default position not available in fake landscape");
//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
}
@Override
@@ -168,11 +168,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
@Override
public int getSplitTaskViewDismissDirection(@StagePosition int stagePosition,
DeviceProfile dp) {
//<<<<<<< HEAD
// if (splitPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT) {
//=======
if (stagePosition == STAGE_POSITION_TOP_OR_LEFT) {
//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
if (dp.isLandscape) {
// Left side
return SPLIT_TRANSLATE_PRIMARY_NEGATIVE;
@@ -180,20 +176,11 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
// Top side
return SPLIT_TRANSLATE_SECONDARY_NEGATIVE;
}
//<<<<<<< HEAD
// } else if (splitPosition.stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
// We don't have a bottom option, so should be right
// return SPLIT_TRANSLATE_PRIMARY_POSITIVE;
// }
// throw new IllegalStateException("Invalid split stage position: " +
// splitPosition.stagePosition);
//=======
} else if (stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
// We don't have a bottom option, so should be right
return SPLIT_TRANSLATE_PRIMARY_POSITIVE;
}
throw new IllegalStateException("Invalid split stage position: " + stagePosition);
//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
}
@Override
@@ -438,11 +425,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
}
// Now we rotate the portrait rect depending on what side we want pinned
//<<<<<<< HEAD
// boolean pinToRight = splitPositionOption.stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
//=======
boolean pinToRight = stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
int screenHeight = dp.heightPx;
float postRotateScale = (float) screenHeight / width;
@@ -470,11 +453,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
}
// Now we rotate the portrait rect depending on what side we want pinned
//<<<<<<< HEAD
// boolean pinToRight = initialSplitOption.stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
//=======
boolean pinToRight = stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
float postRotateScale = (float) screenHeight / screenWidth;
mTmpMatrix.reset();
@@ -492,7 +471,6 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
}
@Override
//<<<<<<< HEAD
public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect,
SplitConfigurationOptions.StagedSplitBounds splitInfo, int desiredStagePosition) {
boolean isLandscape = dp.isLandscape;
@@ -563,7 +541,6 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
}
}
//=======
@Override
public int getDefaultSplitPosition(DeviceProfile deviceProfile) {
if (!deviceProfile.isTablet) {
@@ -573,7 +550,6 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
return STAGE_POSITION_BOTTOM_OR_RIGHT;
} else {
return STAGE_POSITION_TOP_OR_LEFT;
//>>>>>>> f6769c8532 (Add Split button in OverviewActions)
}
}