Initial changes to creating a fake landscape Launcher UI

Workspace and hotseat are drawn in rotated UI giving the impression that the
device is in Portrait, even though it is in landscape

Bug: 131360075
Change-Id: I29c4068af25fd4dcf7039b9a45886e864a137977
This commit is contained in:
Sunny Goyal
2019-04-30 12:04:37 -07:00
parent c2803ec5b2
commit ae6e318711
24 changed files with 611 additions and 222 deletions

View File

@@ -93,14 +93,16 @@ public class WorkspaceStateTransitionAnimation {
Interpolator scaleInterpolator = builder.getInterpolator(ANIM_WORKSPACE_SCALE, ZOOM_OUT);
propertySetter.setFloat(mWorkspace, SCALE_PROPERTY, mNewScale, scaleInterpolator);
// Set the hotseat's pivot point to match the workspace's, so that it scales together.
DragLayer dragLayer = mLauncher.getDragLayer();
int[] workspacePivot = new int[]{(int) mWorkspace.getPivotX(),
(int) mWorkspace.getPivotY()};
dragLayer.getDescendantCoordRelativeToSelf(mWorkspace, workspacePivot);
dragLayer.mapCoordInSelfToDescendant(hotseat, workspacePivot);
hotseat.setPivotX(workspacePivot[0]);
hotseat.setPivotY(workspacePivot[1]);
if (!hotseat.getRotationMode().isTransposed) {
// Set the hotseat's pivot point to match the workspace's, so that it scales together.
DragLayer dragLayer = mLauncher.getDragLayer();
float[] workspacePivot =
new float[]{ mWorkspace.getPivotX(), mWorkspace.getPivotY() };
dragLayer.getDescendantCoordRelativeToSelf(mWorkspace, workspacePivot);
dragLayer.mapCoordInSelfToDescendant(hotseat, workspacePivot);
hotseat.setPivotX(workspacePivot[0]);
hotseat.setPivotY(workspacePivot[1]);
}
float hotseatScale = hotseatScaleAndTranslation.scale;
propertySetter.setFloat(hotseat, SCALE_PROPERTY, hotseatScale, scaleInterpolator);