diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-04-30 12:04:37 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-05-02 10:59:28 -0700 |
commit | ae6e318711239601fdd11a14c3cf8c542b808f19 (patch) | |
tree | cc648803791d551f80202267b1c05ca6f1084517 /src/com/android/launcher3/WorkspaceStateTransitionAnimation.java | |
parent | c2803ec5b272c902b6ab314d782afe852163b4ff (diff) | |
download | android_packages_apps_Trebuchet-ae6e318711239601fdd11a14c3cf8c542b808f19.tar.gz android_packages_apps_Trebuchet-ae6e318711239601fdd11a14c3cf8c542b808f19.tar.bz2 android_packages_apps_Trebuchet-ae6e318711239601fdd11a14c3cf8c542b808f19.zip |
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
Diffstat (limited to 'src/com/android/launcher3/WorkspaceStateTransitionAnimation.java')
-rw-r--r-- | src/com/android/launcher3/WorkspaceStateTransitionAnimation.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 99a880104..8d0259d05 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -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); |