SplashScreenViewProvider

public final class SplashScreenViewProvider


Contains a copy of the splash screen used to create a custom animation from the splash screen to the application.

The splashscreen is accessible using SplashScreenViewProvider.view and the view containing the icon using SplashScreenViewProvider.iconView.

This class also contains time information about the animated icon (for API 31+).

The application always needs to call SplashScreenViewProvider.remove once it's done with it.

Summary

Public fields

final long

Duration of the icon animation as provided in [R.attr.

final long

Start time of the icon animation.

final @NonNull View

The view containing the splashscreen icon as defined by R.attr.windowSplashScreenAnimatedIcon

final @NonNull View

The splash screen view, copied into this application process.

Public methods

final void

Remove the SplashScreen's view from the view hierarchy.

Public fields

iconAnimationDurationMillis

@NonNull
public final long iconAnimationDurationMillis

Duration of the icon animation as provided in [R.attr.

iconAnimationStartMillis

@NonNull
public final long iconAnimationStartMillis

Start time of the icon animation.

On API 31+, returns the number of millisecond since the Epoch time (1970-1-1T00:00:00Z)

Below API 31, returns 0 because the icon cannot be animated.

iconView

@NonNull
public final @NonNull View iconView

The view containing the splashscreen icon as defined by R.attr.windowSplashScreenAnimatedIcon

view

@NonNull
public final @NonNull View view

The splash screen view, copied into this application process.

This view can be used to create custom animation from the splash screen to the application

Public methods

remove

@NonNull
public final void remove()

Remove the SplashScreen's view from the view hierarchy.

This always needs to be called when an androidx.core.splashscreen.SplashScreen.OnExitAnimationListener is set.