Loading core/java/android/window/StartingWindowRemovalInfo.java +9 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,12 @@ public final class StartingWindowRemovalInfo implements Parcelable { */ public boolean deferRemoveForIme; /** * The rounded corner radius * @hide */ public float roundedCornerRadius; public StartingWindowRemovalInfo() { } Loading @@ -80,6 +86,7 @@ public final class StartingWindowRemovalInfo implements Parcelable { mainFrame = source.readTypedObject(Rect.CREATOR); playRevealAnimation = source.readBoolean(); deferRemoveForIme = source.readBoolean(); roundedCornerRadius = source.readFloat(); } @Override Loading @@ -89,6 +96,7 @@ public final class StartingWindowRemovalInfo implements Parcelable { dest.writeTypedObject(mainFrame, flags); dest.writeBoolean(playRevealAnimation); dest.writeBoolean(deferRemoveForIme); dest.writeFloat(roundedCornerRadius); } @Override Loading @@ -96,6 +104,7 @@ public final class StartingWindowRemovalInfo implements Parcelable { return "StartingWindowRemovalInfo{taskId=" + taskId + " frame=" + mainFrame + " playRevealAnimation=" + playRevealAnimation + " roundedCornerRadius=" + roundedCornerRadius + " deferRemoveForIme=" + deferRemoveForIme + "}"; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimation.java +6 −2 Original line number Diff line number Diff line Loading @@ -50,13 +50,17 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { private final float mIconStartAlpha; private final float mBrandingStartAlpha; private final TransactionPool mTransactionPool; // TODO(b/261167708): Clean enter animation code after moving Letterbox code to Shell private final float mRoundedCornerRadius; private Runnable mFinishCallback; SplashScreenExitAnimation(Context context, SplashScreenView view, SurfaceControl leash, Rect frame, int mainWindowShiftLength, TransactionPool pool, Runnable handleFinish) { Rect frame, int mainWindowShiftLength, TransactionPool pool, Runnable handleFinish, float roundedCornerRadius) { mSplashScreenView = view; mFirstWindowSurface = leash; mRoundedCornerRadius = roundedCornerRadius; if (frame != null) { mFirstWindowFrame.set(frame); } Loading Loading @@ -97,7 +101,7 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { SplashScreenExitAnimationUtils.startAnimations(mSplashScreenView, mFirstWindowSurface, mMainWindowShiftLength, mTransactionPool, mFirstWindowFrame, mAnimationDuration, mIconFadeOutDuration, mIconStartAlpha, mBrandingStartAlpha, mAppRevealDelay, mAppRevealDuration, this); mAppRevealDuration, this, mRoundedCornerRadius); } private void reset() { Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java +26 −9 Original line number Diff line number Diff line Loading @@ -61,6 +61,24 @@ public class SplashScreenExitAnimationUtils { new PathInterpolator(0f, 0f, 0.4f, 1f); private static final Interpolator SHIFT_UP_INTERPOLATOR = new PathInterpolator(0f, 0f, 0f, 1f); /** * Creates and starts the animator to fade out the icon, reveal the app, and shift up main * window with rounded corner radius. */ static void startAnimations(ViewGroup splashScreenView, SurfaceControl firstWindowSurface, int mainWindowShiftLength, TransactionPool transactionPool, Rect firstWindowFrame, int animationDuration, int iconFadeOutDuration, float iconStartAlpha, float brandingStartAlpha, int appRevealDelay, int appRevealDuration, Animator.AnimatorListener animatorListener, float roundedCornerRadius) { ValueAnimator animator = createAnimator(splashScreenView, firstWindowSurface, mainWindowShiftLength, transactionPool, firstWindowFrame, animationDuration, iconFadeOutDuration, iconStartAlpha, brandingStartAlpha, appRevealDelay, appRevealDuration, animatorListener, roundedCornerRadius); animator.start(); } /** * Creates and starts the animator to fade out the icon, reveal the app, and shift up main * window. Loading @@ -71,12 +89,10 @@ public class SplashScreenExitAnimationUtils { TransactionPool transactionPool, Rect firstWindowFrame, int animationDuration, int iconFadeOutDuration, float iconStartAlpha, float brandingStartAlpha, int appRevealDelay, int appRevealDuration, Animator.AnimatorListener animatorListener) { ValueAnimator animator = createAnimator(splashScreenView, firstWindowSurface, mainWindowShiftLength, startAnimations(splashScreenView, firstWindowSurface, mainWindowShiftLength, transactionPool, firstWindowFrame, animationDuration, iconFadeOutDuration, iconStartAlpha, brandingStartAlpha, appRevealDelay, appRevealDuration, animatorListener); animator.start(); animatorListener, 0f /* roundedCornerRadius */); } /** Loading @@ -87,7 +103,8 @@ public class SplashScreenExitAnimationUtils { SurfaceControl firstWindowSurface, int mMainWindowShiftLength, TransactionPool transactionPool, Rect firstWindowFrame, int animationDuration, int iconFadeOutDuration, float iconStartAlpha, float brandingStartAlpha, int appRevealDelay, int appRevealDuration, Animator.AnimatorListener animatorListener) { int appRevealDelay, int appRevealDuration, Animator.AnimatorListener animatorListener, float roundedCornerRadius) { // reveal app final float transparentRatio = 0.8f; final int globalHeight = splashScreenView.getHeight(); Loading Loading @@ -124,7 +141,7 @@ public class SplashScreenExitAnimationUtils { shiftUpAnimation = new ShiftUpAnimation(0, -mMainWindowShiftLength, occludeHoleView, firstWindowSurface, splashScreenView, transactionPool, firstWindowFrame, mMainWindowShiftLength); mMainWindowShiftLength, roundedCornerRadius); } ValueAnimator animator = ValueAnimator.ofFloat(0f, 1f); Loading Loading @@ -289,8 +306,8 @@ public class SplashScreenExitAnimationUtils { public ShiftUpAnimation(float fromYDelta, float toYDelta, View occludeHoleView, SurfaceControl firstWindowSurface, ViewGroup splashScreenView, TransactionPool transactionPool, Rect firstWindowFrame, int mainWindowShiftLength) { mFromYDelta = fromYDelta; int mainWindowShiftLength, float roundedCornerRadius) { mFromYDelta = fromYDelta - roundedCornerRadius; mToYDelta = toYDelta; mOccludeHoleView = occludeHoleView; mApplier = new SyncRtSurfaceTransactionApplier(occludeHoleView); Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java +3 −2 Original line number Diff line number Diff line Loading @@ -993,10 +993,11 @@ public class SplashscreenContentDrawer { * Create and play the default exit animation for splash screen view. */ void applyExitAnimation(SplashScreenView view, SurfaceControl leash, Rect frame, Runnable finishCallback, long createTime) { Rect frame, Runnable finishCallback, long createTime, float roundedCornerRadius) { final Runnable playAnimation = () -> { final SplashScreenExitAnimation animation = new SplashScreenExitAnimation(mContext, view, leash, frame, mMainWindowShiftLength, mTransactionPool, finishCallback); view, leash, frame, mMainWindowShiftLength, mTransactionPool, finishCallback, roundedCornerRadius); animation.startAnimations(); }; if (view.getIconView() == null) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java +1 −1 Original line number Diff line number Diff line Loading @@ -645,7 +645,7 @@ public class StartingSurfaceDrawer { mSplashscreenContentDrawer.applyExitAnimation(record.mContentView, removalInfo.windowAnimationLeash, removalInfo.mainFrame, () -> removeWindowInner(record.mDecorView, true), record.mCreateTime); record.mCreateTime, removalInfo.roundedCornerRadius); } else { // the SplashScreenView has been copied to client, hide the view to skip // default exit animation Loading Loading
core/java/android/window/StartingWindowRemovalInfo.java +9 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,12 @@ public final class StartingWindowRemovalInfo implements Parcelable { */ public boolean deferRemoveForIme; /** * The rounded corner radius * @hide */ public float roundedCornerRadius; public StartingWindowRemovalInfo() { } Loading @@ -80,6 +86,7 @@ public final class StartingWindowRemovalInfo implements Parcelable { mainFrame = source.readTypedObject(Rect.CREATOR); playRevealAnimation = source.readBoolean(); deferRemoveForIme = source.readBoolean(); roundedCornerRadius = source.readFloat(); } @Override Loading @@ -89,6 +96,7 @@ public final class StartingWindowRemovalInfo implements Parcelable { dest.writeTypedObject(mainFrame, flags); dest.writeBoolean(playRevealAnimation); dest.writeBoolean(deferRemoveForIme); dest.writeFloat(roundedCornerRadius); } @Override Loading @@ -96,6 +104,7 @@ public final class StartingWindowRemovalInfo implements Parcelable { return "StartingWindowRemovalInfo{taskId=" + taskId + " frame=" + mainFrame + " playRevealAnimation=" + playRevealAnimation + " roundedCornerRadius=" + roundedCornerRadius + " deferRemoveForIme=" + deferRemoveForIme + "}"; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimation.java +6 −2 Original line number Diff line number Diff line Loading @@ -50,13 +50,17 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { private final float mIconStartAlpha; private final float mBrandingStartAlpha; private final TransactionPool mTransactionPool; // TODO(b/261167708): Clean enter animation code after moving Letterbox code to Shell private final float mRoundedCornerRadius; private Runnable mFinishCallback; SplashScreenExitAnimation(Context context, SplashScreenView view, SurfaceControl leash, Rect frame, int mainWindowShiftLength, TransactionPool pool, Runnable handleFinish) { Rect frame, int mainWindowShiftLength, TransactionPool pool, Runnable handleFinish, float roundedCornerRadius) { mSplashScreenView = view; mFirstWindowSurface = leash; mRoundedCornerRadius = roundedCornerRadius; if (frame != null) { mFirstWindowFrame.set(frame); } Loading Loading @@ -97,7 +101,7 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { SplashScreenExitAnimationUtils.startAnimations(mSplashScreenView, mFirstWindowSurface, mMainWindowShiftLength, mTransactionPool, mFirstWindowFrame, mAnimationDuration, mIconFadeOutDuration, mIconStartAlpha, mBrandingStartAlpha, mAppRevealDelay, mAppRevealDuration, this); mAppRevealDuration, this, mRoundedCornerRadius); } private void reset() { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java +26 −9 Original line number Diff line number Diff line Loading @@ -61,6 +61,24 @@ public class SplashScreenExitAnimationUtils { new PathInterpolator(0f, 0f, 0.4f, 1f); private static final Interpolator SHIFT_UP_INTERPOLATOR = new PathInterpolator(0f, 0f, 0f, 1f); /** * Creates and starts the animator to fade out the icon, reveal the app, and shift up main * window with rounded corner radius. */ static void startAnimations(ViewGroup splashScreenView, SurfaceControl firstWindowSurface, int mainWindowShiftLength, TransactionPool transactionPool, Rect firstWindowFrame, int animationDuration, int iconFadeOutDuration, float iconStartAlpha, float brandingStartAlpha, int appRevealDelay, int appRevealDuration, Animator.AnimatorListener animatorListener, float roundedCornerRadius) { ValueAnimator animator = createAnimator(splashScreenView, firstWindowSurface, mainWindowShiftLength, transactionPool, firstWindowFrame, animationDuration, iconFadeOutDuration, iconStartAlpha, brandingStartAlpha, appRevealDelay, appRevealDuration, animatorListener, roundedCornerRadius); animator.start(); } /** * Creates and starts the animator to fade out the icon, reveal the app, and shift up main * window. Loading @@ -71,12 +89,10 @@ public class SplashScreenExitAnimationUtils { TransactionPool transactionPool, Rect firstWindowFrame, int animationDuration, int iconFadeOutDuration, float iconStartAlpha, float brandingStartAlpha, int appRevealDelay, int appRevealDuration, Animator.AnimatorListener animatorListener) { ValueAnimator animator = createAnimator(splashScreenView, firstWindowSurface, mainWindowShiftLength, startAnimations(splashScreenView, firstWindowSurface, mainWindowShiftLength, transactionPool, firstWindowFrame, animationDuration, iconFadeOutDuration, iconStartAlpha, brandingStartAlpha, appRevealDelay, appRevealDuration, animatorListener); animator.start(); animatorListener, 0f /* roundedCornerRadius */); } /** Loading @@ -87,7 +103,8 @@ public class SplashScreenExitAnimationUtils { SurfaceControl firstWindowSurface, int mMainWindowShiftLength, TransactionPool transactionPool, Rect firstWindowFrame, int animationDuration, int iconFadeOutDuration, float iconStartAlpha, float brandingStartAlpha, int appRevealDelay, int appRevealDuration, Animator.AnimatorListener animatorListener) { int appRevealDelay, int appRevealDuration, Animator.AnimatorListener animatorListener, float roundedCornerRadius) { // reveal app final float transparentRatio = 0.8f; final int globalHeight = splashScreenView.getHeight(); Loading Loading @@ -124,7 +141,7 @@ public class SplashScreenExitAnimationUtils { shiftUpAnimation = new ShiftUpAnimation(0, -mMainWindowShiftLength, occludeHoleView, firstWindowSurface, splashScreenView, transactionPool, firstWindowFrame, mMainWindowShiftLength); mMainWindowShiftLength, roundedCornerRadius); } ValueAnimator animator = ValueAnimator.ofFloat(0f, 1f); Loading Loading @@ -289,8 +306,8 @@ public class SplashScreenExitAnimationUtils { public ShiftUpAnimation(float fromYDelta, float toYDelta, View occludeHoleView, SurfaceControl firstWindowSurface, ViewGroup splashScreenView, TransactionPool transactionPool, Rect firstWindowFrame, int mainWindowShiftLength) { mFromYDelta = fromYDelta; int mainWindowShiftLength, float roundedCornerRadius) { mFromYDelta = fromYDelta - roundedCornerRadius; mToYDelta = toYDelta; mOccludeHoleView = occludeHoleView; mApplier = new SyncRtSurfaceTransactionApplier(occludeHoleView); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java +3 −2 Original line number Diff line number Diff line Loading @@ -993,10 +993,11 @@ public class SplashscreenContentDrawer { * Create and play the default exit animation for splash screen view. */ void applyExitAnimation(SplashScreenView view, SurfaceControl leash, Rect frame, Runnable finishCallback, long createTime) { Rect frame, Runnable finishCallback, long createTime, float roundedCornerRadius) { final Runnable playAnimation = () -> { final SplashScreenExitAnimation animation = new SplashScreenExitAnimation(mContext, view, leash, frame, mMainWindowShiftLength, mTransactionPool, finishCallback); view, leash, frame, mMainWindowShiftLength, mTransactionPool, finishCallback, roundedCornerRadius); animation.startAnimations(); }; if (view.getIconView() == null) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java +1 −1 Original line number Diff line number Diff line Loading @@ -645,7 +645,7 @@ public class StartingSurfaceDrawer { mSplashscreenContentDrawer.applyExitAnimation(record.mContentView, removalInfo.windowAnimationLeash, removalInfo.mainFrame, () -> removeWindowInner(record.mDecorView, true), record.mCreateTime); record.mCreateTime, removalInfo.roundedCornerRadius); } else { // the SplashScreenView has been copied to client, hide the view to skip // default exit animation Loading