Loading quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java +16 −22 Original line number Diff line number Diff line Loading @@ -451,13 +451,6 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> { } } if (mLauncherTransitionController != null) { Runnable runOnUi = () -> { if (mLauncherTransitionController == null) { return; } mLauncherTransitionController.setPlayFraction(shift); if (mRecentsAnimationWrapper.controller != null) { // TODO: This logic is spartanic! boolean passedThreshold = shift > 0.12f; Loading @@ -467,14 +460,15 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> { .setSplitScreenMinimizedForTransaction(passedThreshold); } } }; if (Looper.getMainLooper() == Looper.myLooper()) { runOnUi.run(); } else { // The fling operation completed even before the launcher was drawn mMainExecutor.execute(runOnUi); mMainExecutor.execute(this::updateFinalShiftUi); } private void updateFinalShiftUi() { if (mLauncherTransitionController == null) { return; } mLauncherTransitionController.setPlayFraction(mCurrentShift.value); } public void onRecentsAnimationStart(RecentsAnimationControllerCompat controller, Loading quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java +10 −14 Original line number Diff line number Diff line Loading @@ -50,8 +50,6 @@ public class ClipAnimationHelper { private final RectF mSourceRect = new RectF(); // The bounds of the task view in launcher window coordinates private final RectF mTargetRect = new RectF(); // Doesn't change after initialized, used as an anchor when changing mTargetOffset private final PointF mInitialTargetOffset = new PointF(); // Set when the final window destination is changed, such as offsetting for quick scrub private final PointF mTargetOffset = new PointF(); // The insets to be used for clipping the app window, which can be larger than mSourceInsets Loading Loading @@ -84,9 +82,8 @@ public class ClipAnimationHelper { mSourceStackBounds.width() - mSourceInsets.right, mSourceStackBounds.height() - mSourceInsets.bottom); mTargetRect.set(targetRect); mInitialTargetOffset.set(mHomeStackBounds.left - mSourceStackBounds.left, mTargetRect.offset(mHomeStackBounds.left - mSourceStackBounds.left, mHomeStackBounds.top - mSourceStackBounds.top); mTargetOffset.set(mInitialTargetOffset); // Calculate the clip based on the target rect (since the content insets and the // launcher insets may differ, so the aspect ratio of the target rect can differ Loading @@ -109,6 +106,7 @@ public class ClipAnimationHelper { mTmpRectF.set(mTargetRect); Utilities.scaleRectFAboutCenter(mTmpRectF, mTargetScale); currentRect = mRectFEvaluator.evaluate(progress, mSourceRect, mTmpRectF); synchronized (mTargetOffset) { // Stay lined up with the center of the target, since it moves for quick scrub. currentRect.offset(mTargetOffset.x * SCROLL.getInterpolation(progress), Loading Loading @@ -144,8 +142,7 @@ public class ClipAnimationHelper { public void offsetTarget(float scale, float offsetX, float offsetY) { synchronized (mTargetOffset) { mTargetScale = scale; mTargetOffset.set(mInitialTargetOffset); mTargetOffset.offset(offsetX, offsetY); mTargetOffset.set(offsetX, offsetY); } } Loading Loading @@ -199,11 +196,10 @@ public class ClipAnimationHelper { public void drawForProgress(TaskThumbnailView ttv, Canvas canvas, float progress) { RectF currentRect = mRectFEvaluator.evaluate(progress, mSourceRect, mTargetRect); synchronized (mTargetOffset) { canvas.translate(-mTargetOffset.x, -mTargetOffset.y); } canvas.translate(mSourceStackBounds.left - mHomeStackBounds.left, mSourceStackBounds.top - mHomeStackBounds.top); mTmpMatrix.setRectToRect(mTargetRect, currentRect, ScaleToFit.FILL); canvas.concat(mTmpMatrix); canvas.translate(mTargetRect.left, mTargetRect.top); Loading Loading
quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java +16 −22 Original line number Diff line number Diff line Loading @@ -451,13 +451,6 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> { } } if (mLauncherTransitionController != null) { Runnable runOnUi = () -> { if (mLauncherTransitionController == null) { return; } mLauncherTransitionController.setPlayFraction(shift); if (mRecentsAnimationWrapper.controller != null) { // TODO: This logic is spartanic! boolean passedThreshold = shift > 0.12f; Loading @@ -467,14 +460,15 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> { .setSplitScreenMinimizedForTransaction(passedThreshold); } } }; if (Looper.getMainLooper() == Looper.myLooper()) { runOnUi.run(); } else { // The fling operation completed even before the launcher was drawn mMainExecutor.execute(runOnUi); mMainExecutor.execute(this::updateFinalShiftUi); } private void updateFinalShiftUi() { if (mLauncherTransitionController == null) { return; } mLauncherTransitionController.setPlayFraction(mCurrentShift.value); } public void onRecentsAnimationStart(RecentsAnimationControllerCompat controller, Loading
quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java +10 −14 Original line number Diff line number Diff line Loading @@ -50,8 +50,6 @@ public class ClipAnimationHelper { private final RectF mSourceRect = new RectF(); // The bounds of the task view in launcher window coordinates private final RectF mTargetRect = new RectF(); // Doesn't change after initialized, used as an anchor when changing mTargetOffset private final PointF mInitialTargetOffset = new PointF(); // Set when the final window destination is changed, such as offsetting for quick scrub private final PointF mTargetOffset = new PointF(); // The insets to be used for clipping the app window, which can be larger than mSourceInsets Loading Loading @@ -84,9 +82,8 @@ public class ClipAnimationHelper { mSourceStackBounds.width() - mSourceInsets.right, mSourceStackBounds.height() - mSourceInsets.bottom); mTargetRect.set(targetRect); mInitialTargetOffset.set(mHomeStackBounds.left - mSourceStackBounds.left, mTargetRect.offset(mHomeStackBounds.left - mSourceStackBounds.left, mHomeStackBounds.top - mSourceStackBounds.top); mTargetOffset.set(mInitialTargetOffset); // Calculate the clip based on the target rect (since the content insets and the // launcher insets may differ, so the aspect ratio of the target rect can differ Loading @@ -109,6 +106,7 @@ public class ClipAnimationHelper { mTmpRectF.set(mTargetRect); Utilities.scaleRectFAboutCenter(mTmpRectF, mTargetScale); currentRect = mRectFEvaluator.evaluate(progress, mSourceRect, mTmpRectF); synchronized (mTargetOffset) { // Stay lined up with the center of the target, since it moves for quick scrub. currentRect.offset(mTargetOffset.x * SCROLL.getInterpolation(progress), Loading Loading @@ -144,8 +142,7 @@ public class ClipAnimationHelper { public void offsetTarget(float scale, float offsetX, float offsetY) { synchronized (mTargetOffset) { mTargetScale = scale; mTargetOffset.set(mInitialTargetOffset); mTargetOffset.offset(offsetX, offsetY); mTargetOffset.set(offsetX, offsetY); } } Loading Loading @@ -199,11 +196,10 @@ public class ClipAnimationHelper { public void drawForProgress(TaskThumbnailView ttv, Canvas canvas, float progress) { RectF currentRect = mRectFEvaluator.evaluate(progress, mSourceRect, mTargetRect); synchronized (mTargetOffset) { canvas.translate(-mTargetOffset.x, -mTargetOffset.y); } canvas.translate(mSourceStackBounds.left - mHomeStackBounds.left, mSourceStackBounds.top - mHomeStackBounds.top); mTmpMatrix.setRectToRect(mTargetRect, currentRect, ScaleToFit.FILL); canvas.concat(mTmpMatrix); canvas.translate(mTargetRect.left, mTargetRect.top); Loading