diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml index e0c4e4baa1..8d62ab8e19 100644 --- a/quickstep/res/values/dimens.xml +++ b/quickstep/res/values/dimens.xml @@ -20,6 +20,8 @@ 12dp 48dp 8dp + + 2dp 10dp 70dp 20dp diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java index a1cee82c39..11b5feaded 100644 --- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java @@ -629,9 +629,12 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag // Animate window corner radius from 100% to windowCornerRadius. float windowCornerRadius = RecentsModel.INSTANCE.get(mLauncher) .getWindowCornerRadius(); - float circleRadius = iconWidth / 2f; - float windowRadius = Utilities.mapRange(easePercent, circleRadius, - windowCornerRadius); + float windowRadius = 0; + if (RecentsModel.INSTANCE.get(mLauncher).supportsRoundedCornersOnWindows()) { + float circleRadius = iconWidth / 2f; + windowRadius = Utilities.mapRange(easePercent, circleRadius, + windowCornerRadius); + } // Animate the window crop so that it starts off as a square, and then reveals // horizontally. diff --git a/quickstep/src/com/android/quickstep/RecentsModel.java b/quickstep/src/com/android/quickstep/RecentsModel.java index 75ccba6183..21da566d57 100644 --- a/quickstep/src/com/android/quickstep/RecentsModel.java +++ b/quickstep/src/com/android/quickstep/RecentsModel.java @@ -66,6 +66,7 @@ public class RecentsModel extends TaskStackChangeListener { private final TaskThumbnailCache mThumbnailCache; private float mWindowCornerRadius = -1; + private Boolean mSupportsRoundedCornersOnWindows; private RecentsModel(Context context) { @@ -200,6 +201,26 @@ public class RecentsModel extends TaskStackChangeListener { return mWindowCornerRadius; } + public boolean supportsRoundedCornersOnWindows() { + if (mSupportsRoundedCornersOnWindows == null) { + if (mSystemUiProxy != null) { + try { + mSupportsRoundedCornersOnWindows = + mSystemUiProxy.supportsRoundedCornersOnWindows(); + } catch (RemoteException e) { + Log.w(TAG, "Connection to ISystemUIProxy was lost, ignoring window corner " + + "radius"); + return false; + } + } else { + Log.w(TAG, "ISystemUIProxy is null, ignoring window corner radius"); + return false; + } + } + + return mSupportsRoundedCornersOnWindows; + } + public void onTrimMemory(int level) { if (level == ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) { mThumbnailCache.getHighResLoadingState().setVisible(false); diff --git a/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java index aa269db6a7..64fbe96119 100644 --- a/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java +++ b/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java @@ -87,6 +87,8 @@ public class ClipAnimationHelper { private final float mWindowCornerRadius; // Corner radius of windows when they're in overview mode. private final float mTaskCornerRadius; + // If windows can have real time rounded corners. + private final boolean mSupportsRoundedCornersOnWindows; // Corner radius currently applied to transformed window. private float mCurrentCornerRadius; @@ -103,8 +105,12 @@ public class ClipAnimationHelper { (t, a1) -> a1; public ClipAnimationHelper(Context context) { - mTaskCornerRadius = context.getResources().getDimension(R.dimen.task_corner_radius); - mWindowCornerRadius = RecentsModel.INSTANCE.get(context).getWindowCornerRadius(); + mWindowCornerRadius = RecentsModel.INSTANCE.get(context).getWindowCornerRadius(); + mSupportsRoundedCornersOnWindows = RecentsModel.INSTANCE.get(context) + .supportsRoundedCornersOnWindows(); + int taskCornerRadiusRes = mSupportsRoundedCornersOnWindows ? + R.dimen.task_corner_radius : R.dimen.task_corner_radius_small; + mTaskCornerRadius = context.getResources().getDimension(taskCornerRadiusRes); } private void updateSourceStack(RemoteAnimationTargetCompat target) { @@ -186,8 +192,10 @@ public class ClipAnimationHelper { mTmpMatrix.setRectToRect(mSourceRect, currentRect, ScaleToFit.FILL); mTmpMatrix.postTranslate(app.position.x, app.position.y); mClipRectF.roundOut(crop); - cornerRadius = Utilities.mapRange(progress, mWindowCornerRadius, - mTaskCornerRadius); + if (mSupportsRoundedCornersOnWindows) { + cornerRadius = Utilities.mapRange(progress, mWindowCornerRadius, + mTaskCornerRadius); + } mCurrentCornerRadius = cornerRadius; }