Added in API level 31

SplashScreenView


class SplashScreenView : FrameLayout
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.FrameLayout
   ↳ android.window.SplashScreenView

The view which allows an activity to customize its splash screen exit animation.

Activities will receive this view as a parameter of SplashScreen.OnExitAnimationListener#onSplashScreenExit if they set SplashScreen#setOnExitAnimationListener. When this callback is called, this view will be on top of the activity.

This view is composed of a view containing the splashscreen icon (see windowSplashscreenAnimatedIcon) and a background. Developers can use getIconView to get this view and replace the drawable or add animation to it. The background of this view is filled with a single color, which can be edited during the animation by View#setBackground or View#setBackgroundColor.

Summary

Inherited XML attributes
Inherited constants
Public methods
Duration?

Returns the duration of the icon animation if icon is animatable.

Instant?

If the replaced icon is animatable, return the animation start time based on system clock.

View?

Get the view containing the Splash Screen icon and its background.

Unit

Remove this view and release its resource.

Unit
setAlpha(alpha: Float)

Protected methods
Unit
onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int)

Inherited functions
Inherited properties

Public methods

getIconAnimationDuration

Added in API level 31
fun getIconAnimationDuration(): Duration?

Returns the duration of the icon animation if icon is animatable. Note the return value can be null or 0 if the android.R.attr#windowSplashScreenAnimatedIcon is not android.graphics.drawable.AnimationDrawable or android.graphics.drawable.AnimatedVectorDrawable.

getIconAnimationStart

Added in API level 31
fun getIconAnimationStart(): Instant?

If the replaced icon is animatable, return the animation start time based on system clock.

Return
Instant? This value may be null.

getIconView

Added in API level 31
fun getIconView(): View?

Get the view containing the Splash Screen icon and its background.

Return
View? This value may be null.

remove

Added in API level 31
fun remove(): Unit

Remove this view and release its resource.

Do not invoke this method from a drawing method (onDraw(android.graphics.Canvas) for instance).


This method must be called on the thread that originally created this UI element. This is typically the main thread of your app.

setAlpha

Added in API level 31
fun setAlpha(alpha: Float): Unit
Parameters
alpha Float: The opacity of the view. Value is between 0.0 and 1.0 inclusive

Protected methods

onLayout

Added in API level 31
protected fun onLayout(
    changed: Boolean,
    l: Int,
    t: Int,
    r: Int,
    b: Int
): Unit
Parameters
changed Boolean: This is a new size or position for this view
left Left position, relative to parent
top Top position, relative to parent
right Right position, relative to parent
bottom Bottom position, relative to parent