Loading libs/WindowManager/Shell/res/values-television/config.xml +5 −6 Original line number Diff line number Diff line Loading @@ -44,12 +44,11 @@ if a custom action is present before closing it. --> <integer name="config_pipForceCloseDelay">5000</integer> <!-- Animation duration when exit starting window: fade out icon --> <integer name="starting_window_app_reveal_icon_fade_out_duration">0</integer> <!-- Animation duration when exit starting window: reveal app --> <integer name="starting_window_app_reveal_anim_delay">0</integer> <integer name="starting_window_app_reveal_anim_duration">500</integer> <!-- Animation duration when exit starting window: reveal app --> <integer name="starting_window_app_reveal_anim_duration">0</integer> <!-- Default animation type when hiding the starting window. The possible values are: - 0 for radial vanish + slide up - 1 for fade out --> <integer name="starting_window_exit_animation_type">1</integer> </resources> libs/WindowManager/Shell/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,11 @@ <!-- Animation duration when exit starting window: reveal app --> <integer name="starting_window_app_reveal_anim_duration">266</integer> <!-- Default animation type when hiding the starting window. The possible values are: - 0 for radial vanish + slide up - 1 for fade out --> <integer name="starting_window_exit_animation_type">0</integer> <!-- Default insets [LEFT/RIGHTxTOP/BOTTOM] from the screen edge for picture-in-picture windows. These values are in DPs and will be converted to pixel sizes internally. --> <string translatable="false" name="config_defaultPictureInPictureScreenEdgeInsets"> Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimation.java +32 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.view.View.GONE; import static com.android.internal.jank.InteractionJankMonitor.CUJ_SPLASHSCREEN_EXIT_ANIM; import android.animation.Animator; import android.annotation.IntDef; import android.content.Context; import android.graphics.Rect; import android.util.Slog; Loading @@ -46,6 +47,8 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { private final int mIconFadeOutDuration; private final int mAppRevealDelay; private final int mAppRevealDuration; @ExitAnimationType private final int mAnimationType; private final int mAnimationDuration; private final float mIconStartAlpha; private final float mBrandingStartAlpha; Loading @@ -55,6 +58,24 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { private Runnable mFinishCallback; /** * This splash screen exit animation type uses a radial vanish to hide * the starting window and slides up the main window content. */ private static final int TYPE_RADIAL_VANISH_SLIDE_UP = 0; /** * This splash screen exit animation type fades out the starting window * to reveal the main window content. */ private static final int TYPE_FADE_OUT = 1; @IntDef(prefix = { "TYPE_" }, value = { TYPE_RADIAL_VANISH_SLIDE_UP, TYPE_FADE_OUT, }) private @interface ExitAnimationType {} SplashScreenExitAnimation(Context context, SplashScreenView view, SurfaceControl leash, Rect frame, int mainWindowShiftLength, TransactionPool pool, Runnable handleFinish, float roundedCornerRadius) { Loading Loading @@ -91,6 +112,8 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { } mAppRevealDuration = context.getResources().getInteger( R.integer.starting_window_app_reveal_anim_duration); mAnimationType = context.getResources().getInteger( R.integer.starting_window_exit_animation_type); mAnimationDuration = Math.max(mIconFadeOutDuration, mAppRevealDelay + mAppRevealDuration); mMainWindowShiftLength = mainWindowShiftLength; mFinishCallback = handleFinish; Loading @@ -98,11 +121,16 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { } void startAnimations() { if (mAnimationType == TYPE_FADE_OUT) { SplashScreenExitAnimationUtils.startFadeOutAnimation(mSplashScreenView, mAnimationDuration, this); } else { SplashScreenExitAnimationUtils.startAnimations(mSplashScreenView, mFirstWindowSurface, mMainWindowShiftLength, mTransactionPool, mFirstWindowFrame, mAnimationDuration, mIconFadeOutDuration, mIconStartAlpha, mBrandingStartAlpha, mAppRevealDelay, mAppRevealDuration, this, mRoundedCornerRadius); } } private void reset() { if (DEBUG_EXIT_ANIMATION) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java +19 −6 Original line number Diff line number Diff line Loading @@ -71,11 +71,10 @@ public class SplashScreenExitAnimationUtils { 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); ValueAnimator animator = createRadialVanishSlideUpAnimator(splashScreenView, firstWindowSurface, mainWindowShiftLength, transactionPool, firstWindowFrame, animationDuration, iconFadeOutDuration, iconStartAlpha, brandingStartAlpha, appRevealDelay, appRevealDuration, animatorListener, roundedCornerRadius); animator.start(); } Loading @@ -99,7 +98,7 @@ public class SplashScreenExitAnimationUtils { * Creates the animator to fade out the icon, reveal the app, and shift up main window. * @hide */ private static ValueAnimator createAnimator(ViewGroup splashScreenView, private static ValueAnimator createRadialVanishSlideUpAnimator(ViewGroup splashScreenView, SurfaceControl firstWindowSurface, int mMainWindowShiftLength, TransactionPool transactionPool, Rect firstWindowFrame, int animationDuration, int iconFadeOutDuration, float iconStartAlpha, float brandingStartAlpha, Loading Loading @@ -210,6 +209,20 @@ public class SplashScreenExitAnimationUtils { return nightMode == Configuration.UI_MODE_NIGHT_YES; } static void startFadeOutAnimation(ViewGroup splashScreenView, int animationDuration, Animator.AnimatorListener animatorListener) { final ValueAnimator animator = ValueAnimator.ofFloat(1f, 0f); animator.setDuration(animationDuration); animator.setInterpolator(Interpolators.LINEAR); animator.addUpdateListener(animation -> { splashScreenView.setAlpha((float) animation.getAnimatedValue()); }); if (animatorListener != null) { animator.addListener(animatorListener); } animator.start(); } /** * View which creates a circular reveal of the underlying view. * @hide Loading Loading
libs/WindowManager/Shell/res/values-television/config.xml +5 −6 Original line number Diff line number Diff line Loading @@ -44,12 +44,11 @@ if a custom action is present before closing it. --> <integer name="config_pipForceCloseDelay">5000</integer> <!-- Animation duration when exit starting window: fade out icon --> <integer name="starting_window_app_reveal_icon_fade_out_duration">0</integer> <!-- Animation duration when exit starting window: reveal app --> <integer name="starting_window_app_reveal_anim_delay">0</integer> <integer name="starting_window_app_reveal_anim_duration">500</integer> <!-- Animation duration when exit starting window: reveal app --> <integer name="starting_window_app_reveal_anim_duration">0</integer> <!-- Default animation type when hiding the starting window. The possible values are: - 0 for radial vanish + slide up - 1 for fade out --> <integer name="starting_window_exit_animation_type">1</integer> </resources>
libs/WindowManager/Shell/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,11 @@ <!-- Animation duration when exit starting window: reveal app --> <integer name="starting_window_app_reveal_anim_duration">266</integer> <!-- Default animation type when hiding the starting window. The possible values are: - 0 for radial vanish + slide up - 1 for fade out --> <integer name="starting_window_exit_animation_type">0</integer> <!-- Default insets [LEFT/RIGHTxTOP/BOTTOM] from the screen edge for picture-in-picture windows. These values are in DPs and will be converted to pixel sizes internally. --> <string translatable="false" name="config_defaultPictureInPictureScreenEdgeInsets"> Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimation.java +32 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.view.View.GONE; import static com.android.internal.jank.InteractionJankMonitor.CUJ_SPLASHSCREEN_EXIT_ANIM; import android.animation.Animator; import android.annotation.IntDef; import android.content.Context; import android.graphics.Rect; import android.util.Slog; Loading @@ -46,6 +47,8 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { private final int mIconFadeOutDuration; private final int mAppRevealDelay; private final int mAppRevealDuration; @ExitAnimationType private final int mAnimationType; private final int mAnimationDuration; private final float mIconStartAlpha; private final float mBrandingStartAlpha; Loading @@ -55,6 +58,24 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { private Runnable mFinishCallback; /** * This splash screen exit animation type uses a radial vanish to hide * the starting window and slides up the main window content. */ private static final int TYPE_RADIAL_VANISH_SLIDE_UP = 0; /** * This splash screen exit animation type fades out the starting window * to reveal the main window content. */ private static final int TYPE_FADE_OUT = 1; @IntDef(prefix = { "TYPE_" }, value = { TYPE_RADIAL_VANISH_SLIDE_UP, TYPE_FADE_OUT, }) private @interface ExitAnimationType {} SplashScreenExitAnimation(Context context, SplashScreenView view, SurfaceControl leash, Rect frame, int mainWindowShiftLength, TransactionPool pool, Runnable handleFinish, float roundedCornerRadius) { Loading Loading @@ -91,6 +112,8 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { } mAppRevealDuration = context.getResources().getInteger( R.integer.starting_window_app_reveal_anim_duration); mAnimationType = context.getResources().getInteger( R.integer.starting_window_exit_animation_type); mAnimationDuration = Math.max(mIconFadeOutDuration, mAppRevealDelay + mAppRevealDuration); mMainWindowShiftLength = mainWindowShiftLength; mFinishCallback = handleFinish; Loading @@ -98,11 +121,16 @@ public class SplashScreenExitAnimation implements Animator.AnimatorListener { } void startAnimations() { if (mAnimationType == TYPE_FADE_OUT) { SplashScreenExitAnimationUtils.startFadeOutAnimation(mSplashScreenView, mAnimationDuration, this); } else { SplashScreenExitAnimationUtils.startAnimations(mSplashScreenView, mFirstWindowSurface, mMainWindowShiftLength, mTransactionPool, mFirstWindowFrame, mAnimationDuration, mIconFadeOutDuration, mIconStartAlpha, mBrandingStartAlpha, mAppRevealDelay, mAppRevealDuration, this, mRoundedCornerRadius); } } private void reset() { if (DEBUG_EXIT_ANIMATION) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java +19 −6 Original line number Diff line number Diff line Loading @@ -71,11 +71,10 @@ public class SplashScreenExitAnimationUtils { 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); ValueAnimator animator = createRadialVanishSlideUpAnimator(splashScreenView, firstWindowSurface, mainWindowShiftLength, transactionPool, firstWindowFrame, animationDuration, iconFadeOutDuration, iconStartAlpha, brandingStartAlpha, appRevealDelay, appRevealDuration, animatorListener, roundedCornerRadius); animator.start(); } Loading @@ -99,7 +98,7 @@ public class SplashScreenExitAnimationUtils { * Creates the animator to fade out the icon, reveal the app, and shift up main window. * @hide */ private static ValueAnimator createAnimator(ViewGroup splashScreenView, private static ValueAnimator createRadialVanishSlideUpAnimator(ViewGroup splashScreenView, SurfaceControl firstWindowSurface, int mMainWindowShiftLength, TransactionPool transactionPool, Rect firstWindowFrame, int animationDuration, int iconFadeOutDuration, float iconStartAlpha, float brandingStartAlpha, Loading Loading @@ -210,6 +209,20 @@ public class SplashScreenExitAnimationUtils { return nightMode == Configuration.UI_MODE_NIGHT_YES; } static void startFadeOutAnimation(ViewGroup splashScreenView, int animationDuration, Animator.AnimatorListener animatorListener) { final ValueAnimator animator = ValueAnimator.ofFloat(1f, 0f); animator.setDuration(animationDuration); animator.setInterpolator(Interpolators.LINEAR); animator.addUpdateListener(animation -> { splashScreenView.setAlpha((float) animation.getAnimatedValue()); }); if (animatorListener != null) { animator.addListener(animatorListener); } animator.start(); } /** * View which creates a circular reveal of the underlying view. * @hide Loading