diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java index e5747dc711..624b3dc779 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java @@ -137,7 +137,7 @@ final class AppToOverviewAnimationProvider imple Rect targetRect = new Rect(); mHelper.getSwipeUpDestinationAndLength(mActivity.getDeviceProfile(), mActivity, targetRect); clipHelper.updateTargetRect(targetRect); - clipHelper.prepareAnimation(false /* isOpening */); + clipHelper.prepareAnimation(mActivity.getDeviceProfile(), false /* isOpening */); ClipAnimationHelper.TransformParams params = new ClipAnimationHelper.TransformParams() .setSyncTransactionApplier(new SyncRtSurfaceTransactionApplierCompat(rootView)); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java index 5b9400201f..f95f9c27e5 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java @@ -26,8 +26,11 @@ import android.content.ComponentName; import android.graphics.RectF; import android.view.View; +import com.android.launcher3.BaseActivity; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.ItemInfo; +import com.android.launcher3.Launcher; +import com.android.launcher3.LauncherAppState; import com.android.launcher3.Utilities; import com.android.quickstep.util.ClipAnimationHelper; import com.android.quickstep.util.MultiValueUpdateListener; @@ -134,7 +137,9 @@ public final class TaskViewUtils { { inOutHelper.setTaskAlphaCallback((t, alpha) -> mTaskAlpha.value); - inOutHelper.prepareAnimation(true /* isOpening */); + inOutHelper.prepareAnimation( + BaseActivity.fromContext(v.getContext()).getDeviceProfile(), + true /* isOpening */); inOutHelper.fromTaskThumbnailView(v.getThumbnail(), (RecentsView) v.getParent(), targetSet.apps.length == 0 ? null : targetSet.apps[0]); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java index 52d301ca96..030827f522 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -730,7 +730,7 @@ public class WindowTransformSwipeHandler if (runningTaskTarget != null) { mClipAnimationHelper.updateSource(overviewStackBounds, runningTaskTarget); } - mClipAnimationHelper.prepareAnimation(false /* isOpening */); + mClipAnimationHelper.prepareAnimation(dp, false /* isOpening */); initTransitionEndpoints(dp); mRecentsAnimationWrapper.setController(targetSet); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java index 1242d79dc3..cb2bf1f79d 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java @@ -81,6 +81,7 @@ public class ClipAnimationHelper { private final RectF mClipRectF = new RectF(); private final RectFEvaluator mRectFEvaluator = new RectFEvaluator(); private final Matrix mTmpMatrix = new Matrix(); + private final Rect mTmpRect = new Rect(); private final RectF mTmpRectF = new RectF(); private final RectF mCurrentRectWithInsets = new RectF(); // Corner radius of windows, in pixels @@ -89,6 +90,8 @@ public class ClipAnimationHelper { private final float mTaskCornerRadius; // If windows can have real time rounded corners. private final boolean mSupportsRoundedCornersOnWindows; + // Whether or not to actually use the rounded cornders on windows + private boolean mUseRoundedCornersOnWindows; // Corner radius currently applied to transformed window. private float mCurrentCornerRadius; @@ -103,6 +106,7 @@ public class ClipAnimationHelper { mWindowCornerRadius = getWindowCornerRadius(context.getResources()); mSupportsRoundedCornersOnWindows = supportsRoundedCornersOnWindows(context.getResources()); mTaskCornerRadius = TaskCornerRadius.get(context); + mUseRoundedCornersOnWindows = mSupportsRoundedCornersOnWindows; } private void updateSourceStack(RemoteAnimationTargetCompat target) { @@ -144,8 +148,9 @@ public class ClipAnimationHelper { mSourceRect.set(scaledTargetRect); } - public void prepareAnimation(boolean isOpening) { + public void prepareAnimation(DeviceProfile dp, boolean isOpening) { mBoostModeTargetLayers = isOpening ? MODE_OPENING : MODE_CLOSING; + mUseRoundedCornersOnWindows = mSupportsRoundedCornersOnWindows && !dp.isMultiWindowMode; } public RectF applyTransform(RemoteAnimationTargetSet targetSet, TransformParams params) { @@ -177,7 +182,9 @@ public class ClipAnimationHelper { for (int i = 0; i < targetSet.unfilteredApps.length; i++) { RemoteAnimationTargetCompat app = targetSet.unfilteredApps[i]; mTmpMatrix.setTranslate(app.position.x, app.position.y); - Rect crop = app.sourceContainerBounds; + Rect crop = mTmpRect; + crop.set(app.sourceContainerBounds); + crop.offsetTo(0, 0); float alpha = 1f; int layer = RemoteAnimationProvider.getLayer(app, mBoostModeTargetLayers); float cornerRadius = 0f; @@ -188,7 +195,9 @@ public class ClipAnimationHelper { mTmpMatrix.postTranslate(app.position.x, app.position.y); mClipRectF.roundOut(crop); if (mSupportsRoundedCornersOnWindows) { - cornerRadius = Utilities.mapRange(params.progress, mWindowCornerRadius, + float windowCornerRadius = mUseRoundedCornersOnWindows + ? mWindowCornerRadius : 0; + cornerRadius = Utilities.mapRange(params.progress, windowCornerRadius, mTaskCornerRadius); mCurrentCornerRadius = cornerRadius; }