Merge "Fix public variables to not have 'm' prefix" into sc-v2-dev

This commit is contained in:
Vinit Nayak
2021-08-26 00:07:45 +00:00
committed by Android (Google) Code Review
7 changed files with 51 additions and 51 deletions
@@ -44,7 +44,7 @@ public class SplitScreenSelectState extends OverviewState {
public float getSplitSelectTranslation(Launcher launcher) {
RecentsView recentsView = launcher.getOverviewPanel();
int splitPosition = recentsView.getSplitPlaceholder()
.getActiveSplitPositionOption().mStagePosition;
.getActiveSplitPositionOption().stagePosition;
if (!recentsView.shouldShiftThumbnailsForSplitSelect(splitPosition)) {
return 0f;
}
@@ -100,7 +100,7 @@ public interface TaskShortcutFactory {
private SplitPositionOption mSplitPositionOption;
public SplitSelectSystemShortcut(BaseDraggingActivity target, TaskView taskView,
SplitPositionOption option) {
super(option.mIconResId, option.mTextResId, target, taskView.getItemInfo());
super(option.iconResId, option.textResId, target, taskView.getItemInfo());
mTaskView = taskView;
mSplitPositionOption = option;
setEnabled(taskView.getRecentsView().getTaskViewCount() > 1);
@@ -83,7 +83,7 @@ public class SplitSelectStateController {
mSecondTaskView = taskView;
// Assume initial task is for top/left part of screen
final int[] taskIds = mInitialPosition.mStagePosition == STAGE_POSITION_TOP_OR_LEFT
final int[] taskIds = mInitialPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT
? 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) {
@@ -113,7 +113,7 @@ public class SplitSelectStateController {
DeviceProfile deviceProfile) {
InsettableFrameLayout.LayoutParams params =
new InsettableFrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT);
boolean topLeftPosition = mInitialPosition.mStagePosition == STAGE_POSITION_TOP_OR_LEFT;
boolean topLeftPosition = mInitialPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT;
if (deviceProfile.isLandscape) {
params.width = (int) resources.getDimension(R.dimen.split_placeholder_size);
params.gravity = topLeftPosition ? Gravity.START : Gravity.END;
@@ -176,7 +176,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
mStagePosition = STAGE_POSITION_UNDEFINED;
return;
}
mStagePosition = mThumbnailPosition.equals(splitInfo.mLeftTopBounds) ?
mStagePosition = mThumbnailPosition.equals(splitInfo.leftTopBounds) ?
STAGE_POSITION_TOP_OR_LEFT :
STAGE_POSITION_BOTTOM_OR_RIGHT;
}
@@ -169,12 +169,12 @@ 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
if (splitPosition.mStagePosition == STAGE_POSITION_TOP_OR_LEFT) {
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.mStagePosition);
splitPosition.stagePosition);
}
@Override
@@ -389,10 +389,10 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
SplitConfigurationOptions.StagedSplitBounds splitInfo, int desiredStagePosition) {
float diff;
if (desiredStagePosition == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) {
diff = outRect.height() * (1f - splitInfo.mLeftTaskPercent);
diff = outRect.height() * (1f - splitInfo.leftTaskPercent);
outRect.bottom -= diff;
} else {
diff = outRect.height() * splitInfo.mLeftTaskPercent;
diff = outRect.height() * splitInfo.leftTaskPercent;
outRect.top += diff;
}
}
@@ -402,7 +402,7 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
SplitConfigurationOptions.StagedSplitBounds splitInfo, int desiredStagePosition) {
if (desiredStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
// The preview set is for the bottom/right, inset by top/left task
splitOffset.x = splitInfo.mLeftTopBounds.width() + splitInfo.mDividerBounds.width() / 2;
splitOffset.x = splitInfo.leftTopBounds.width() + splitInfo.dividerBounds.width() / 2;
}
}
@@ -413,12 +413,12 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
int spaceAboveSnapshot = dp.overviewTaskThumbnailTopMarginPx;
int totalThumbnailHeight = taskParent.getHeight() - spaceAboveSnapshot;
int totalThumbnailWidth = taskParent.getWidth();
int dividerBar = splitBoundsConfig.mDividerBounds.width() / 2;
int dividerBar = splitBoundsConfig.dividerBounds.width() / 2;
ViewGroup.LayoutParams primaryLp = mSnapshotView.getLayoutParams();
ViewGroup.LayoutParams secondaryLp = mSnapshotView2.getLayoutParams();
primaryLp.width = totalThumbnailWidth;
primaryLp.height = (int)(totalThumbnailHeight * splitBoundsConfig.mLeftTaskPercent);
primaryLp.height = (int)(totalThumbnailHeight * splitBoundsConfig.leftTaskPercent);
secondaryLp.width = totalThumbnailWidth;
secondaryLp.height = totalThumbnailHeight - primaryLp.height - dividerBar;
@@ -167,7 +167,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
@Override
public int getSplitTaskViewDismissDirection(SplitPositionOption splitPosition,
DeviceProfile dp) {
if (splitPosition.mStagePosition == STAGE_POSITION_TOP_OR_LEFT) {
if (splitPosition.stagePosition == STAGE_POSITION_TOP_OR_LEFT) {
if (dp.isLandscape) {
// Left side
return SPLIT_TRANSLATE_PRIMARY_NEGATIVE;
@@ -175,12 +175,12 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
// Top side
return SPLIT_TRANSLATE_SECONDARY_NEGATIVE;
}
} else if (splitPosition.mStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
} 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.mStagePosition);
splitPosition.stagePosition);
}
@Override
@@ -425,7 +425,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
}
// Now we rotate the portrait rect depending on what side we want pinned
boolean pinToRight = splitPositionOption.mStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
boolean pinToRight = splitPositionOption.stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
int screenHeight = dp.heightPx;
float postRotateScale = (float) screenHeight / width;
@@ -453,7 +453,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
}
// Now we rotate the portrait rect depending on what side we want pinned
boolean pinToRight = initialSplitOption.mStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
boolean pinToRight = initialSplitOption.stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
float postRotateScale = (float) screenHeight / screenWidth;
mTmpMatrix.reset();
@@ -477,18 +477,18 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
float diff;
if (desiredStagePosition == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) {
if (isLandscape) {
diff = outRect.width() * (1f - splitInfo.mLeftTaskPercent);
diff = outRect.width() * (1f - splitInfo.leftTaskPercent);
outRect.right -= diff;
} else {
diff = outRect.height() * (1f - splitInfo.mTopTaskPercent);
diff = outRect.height() * (1f - splitInfo.topTaskPercent);
outRect.bottom -= diff;
}
} else {
if (isLandscape) {
diff = outRect.width() * splitInfo.mLeftTaskPercent;
diff = outRect.width() * splitInfo.leftTaskPercent;
outRect.left += diff;
} else {
diff = outRect.height() * splitInfo.mTopTaskPercent;
diff = outRect.height() * splitInfo.topTaskPercent;
outRect.top += diff;
}
}
@@ -499,11 +499,11 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
SplitConfigurationOptions.StagedSplitBounds splitInfo, int desiredStagePosition) {
if (desiredStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
if (dp.isLandscape) {
splitOffset.x = splitInfo.mLeftTopBounds.width() +
splitInfo.mDividerBounds.width() / 2;
splitOffset.x = splitInfo.leftTopBounds.width() +
splitInfo.dividerBounds.width() / 2;
} else {
splitOffset.y = splitInfo.mLeftTopBounds.height() +
splitInfo.mDividerBounds.height() / 2;
splitOffset.y = splitInfo.leftTopBounds.height() +
splitInfo.dividerBounds.height() / 2;
}
}
}
@@ -516,15 +516,15 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
int totalThumbnailHeight = taskParent.getHeight() - spaceAboveSnapshot;
int totalThumbnailWidth = taskParent.getWidth();
int dividerBar = (dp.isLandscape ?
splitBoundsConfig.mDividerBounds.width() :
splitBoundsConfig.mDividerBounds.height())
splitBoundsConfig.dividerBounds.width() :
splitBoundsConfig.dividerBounds.height())
/ 2;
ViewGroup.LayoutParams primaryLp = mSnapshotView.getLayoutParams();
ViewGroup.LayoutParams secondaryLp = mSnapshotView2.getLayoutParams();
if (dp.isLandscape) {
primaryLp.height = totalThumbnailHeight;
primaryLp.width = (int)(totalThumbnailWidth * splitBoundsConfig.mLeftTaskPercent);
primaryLp.width = (int)(totalThumbnailWidth * splitBoundsConfig.leftTaskPercent);
secondaryLp.height = totalThumbnailHeight;
secondaryLp.width = totalThumbnailWidth - primaryLp.width - dividerBar;
@@ -532,7 +532,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
mSnapshotView2.setTranslationY(spaceAboveSnapshot);
} else {
primaryLp.width = totalThumbnailWidth;
primaryLp.height = (int)(totalThumbnailHeight * splitBoundsConfig.mTopTaskPercent);
primaryLp.height = (int)(totalThumbnailHeight * splitBoundsConfig.topTaskPercent);
secondaryLp.width = totalThumbnailWidth;
secondaryLp.height = totalThumbnailHeight - primaryLp.height - dividerBar;
@@ -69,44 +69,44 @@ public final class SplitConfigurationOptions {
///////////////////////////////////
public static class SplitPositionOption {
public final int mIconResId;
public final int mTextResId;
public final int iconResId;
public final int textResId;
@StagePosition
public final int mStagePosition;
public final int stagePosition;
@StageType
public final int mStageType;
public SplitPositionOption(int iconResId, int textResId, int stagePosition, int stageType) {
mIconResId = iconResId;
mTextResId = textResId;
mStagePosition = stagePosition;
this.iconResId = iconResId;
this.textResId = textResId;
this.stagePosition = stagePosition;
mStageType = stageType;
}
}
public static class StagedSplitBounds {
public final Rect mLeftTopBounds;
public final Rect mRightBottomBounds;
public final Rect mDividerBounds;
public final Rect leftTopBounds;
public final Rect rightBottomBounds;
public final Rect dividerBounds;
// This class is orientation-agnostic, so we compute both for later use
public final float mTopTaskPercent;
public final float mLeftTaskPercent;
public final float topTaskPercent;
public final float leftTaskPercent;
public StagedSplitBounds(Rect leftTopBounds, Rect rightBottomBounds, Rect dividerBounds) {
mLeftTopBounds = leftTopBounds;
mRightBottomBounds = rightBottomBounds;
mDividerBounds = dividerBounds;
float totalHeight = mLeftTopBounds.height()
+ mRightBottomBounds.height()
+ mDividerBounds.height();
float totalWidth = mLeftTopBounds.width()
+ mRightBottomBounds.width()
+ mDividerBounds.width();
this.leftTopBounds = leftTopBounds;
this.rightBottomBounds = rightBottomBounds;
this.dividerBounds = dividerBounds;
float totalHeight = this.leftTopBounds.height()
+ this.rightBottomBounds.height()
+ this.dividerBounds.height();
float totalWidth = this.leftTopBounds.width()
+ this.rightBottomBounds.width()
+ this.dividerBounds.width();
mLeftTaskPercent = mLeftTopBounds.width() / totalWidth;
mTopTaskPercent = mLeftTopBounds.height() / totalHeight;
leftTaskPercent = this.leftTopBounds.width() / totalWidth;
topTaskPercent = this.leftTopBounds.height() / totalHeight;
}
}