Loading quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +12 −1 Original line number Diff line number Diff line Loading @@ -1254,12 +1254,23 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, } } private int calculateWindowRotation(RemoteAnimationTargetCompat runningTaskTarget, RecentsOrientedState orientationState) { if (runningTaskTarget.rotationChange != 0 && TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) { return Math.abs(runningTaskTarget.rotationChange) == ROTATION_90 ? ROTATION_270 : ROTATION_90; } else { return orientationState.getDisplayRotation(); } } private SwipePipToHomeAnimator createWindowAnimationToPip(HomeAnimationFactory homeAnimFactory, RemoteAnimationTargetCompat runningTaskTarget, float startProgress) { // Directly animate the app to PiP (picture-in-picture) mode final ActivityManager.RunningTaskInfo taskInfo = mGestureState.getRunningTask(); final RecentsOrientedState orientationState = mTaskViewSimulator.getOrientationState(); final int windowRotation = orientationState.getDisplayRotation(); final int windowRotation = calculateWindowRotation(runningTaskTarget, orientationState); final int homeRotation = orientationState.getRecentsActivityRotation(); final Matrix homeToWindowPositionMap = new Matrix(); Loading quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java +29 −11 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.util.Themes; import com.android.quickstep.TaskAnimationManager; import com.android.systemui.shared.pip.PipSurfaceTransactionHelper; import com.android.systemui.shared.system.InteractionJankMonitorWrapper; Loading Loading @@ -278,6 +279,21 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim { private RotatedPosition getRotatedPosition(float progress) { final float degree, positionX, positionY; if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) { if (mFromRotation == Surface.ROTATION_90) { degree = -90 * (1 - progress); positionX = progress * (mDestinationBoundsTransformed.left - mStartBounds.left) + mStartBounds.left; positionY = progress * (mDestinationBoundsTransformed.top - mStartBounds.top) + mStartBounds.top + mStartBounds.bottom * (1 - progress); } else { degree = 90 * (1 - progress); positionX = progress * (mDestinationBoundsTransformed.left - mStartBounds.left) + mStartBounds.left + mStartBounds.right * (1 - progress); positionY = progress * (mDestinationBoundsTransformed.top - mStartBounds.top) + mStartBounds.top; } } else { if (mFromRotation == Surface.ROTATION_90) { degree = -90 * progress; positionX = progress * (mDestinationBoundsTransformed.left - mStartBounds.left) Loading @@ -291,6 +307,8 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim { positionY = progress * (mDestinationBoundsTransformed.top - mStartBounds.top) + mStartBounds.top; } } return new RotatedPosition(degree, positionX, positionY); } Loading Loading
quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +12 −1 Original line number Diff line number Diff line Loading @@ -1254,12 +1254,23 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, } } private int calculateWindowRotation(RemoteAnimationTargetCompat runningTaskTarget, RecentsOrientedState orientationState) { if (runningTaskTarget.rotationChange != 0 && TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) { return Math.abs(runningTaskTarget.rotationChange) == ROTATION_90 ? ROTATION_270 : ROTATION_90; } else { return orientationState.getDisplayRotation(); } } private SwipePipToHomeAnimator createWindowAnimationToPip(HomeAnimationFactory homeAnimFactory, RemoteAnimationTargetCompat runningTaskTarget, float startProgress) { // Directly animate the app to PiP (picture-in-picture) mode final ActivityManager.RunningTaskInfo taskInfo = mGestureState.getRunningTask(); final RecentsOrientedState orientationState = mTaskViewSimulator.getOrientationState(); final int windowRotation = orientationState.getDisplayRotation(); final int windowRotation = calculateWindowRotation(runningTaskTarget, orientationState); final int homeRotation = orientationState.getRecentsActivityRotation(); final Matrix homeToWindowPositionMap = new Matrix(); Loading
quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java +29 −11 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.util.Themes; import com.android.quickstep.TaskAnimationManager; import com.android.systemui.shared.pip.PipSurfaceTransactionHelper; import com.android.systemui.shared.system.InteractionJankMonitorWrapper; Loading Loading @@ -278,6 +279,21 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim { private RotatedPosition getRotatedPosition(float progress) { final float degree, positionX, positionY; if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) { if (mFromRotation == Surface.ROTATION_90) { degree = -90 * (1 - progress); positionX = progress * (mDestinationBoundsTransformed.left - mStartBounds.left) + mStartBounds.left; positionY = progress * (mDestinationBoundsTransformed.top - mStartBounds.top) + mStartBounds.top + mStartBounds.bottom * (1 - progress); } else { degree = 90 * (1 - progress); positionX = progress * (mDestinationBoundsTransformed.left - mStartBounds.left) + mStartBounds.left + mStartBounds.right * (1 - progress); positionY = progress * (mDestinationBoundsTransformed.top - mStartBounds.top) + mStartBounds.top; } } else { if (mFromRotation == Surface.ROTATION_90) { degree = -90 * progress; positionX = progress * (mDestinationBoundsTransformed.left - mStartBounds.left) Loading @@ -291,6 +307,8 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim { positionY = progress * (mDestinationBoundsTransformed.top - mStartBounds.top) + mStartBounds.top; } } return new RotatedPosition(degree, positionX, positionY); } Loading