# SplashScreenViewProvider

Artifact: [androidx.core:core-splashscreen](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/splashscreen/SplashScreenViewProvider.kt+class:androidx.core.splashscreen.SplashScreenViewProvider) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

*** ** * ** ***


```
public final class SplashScreenViewProvider
```

<br />

*** ** * ** ***

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 `https://developer.android.com/reference/androidx/core/splashscreen/SplashScreenViewProvider#view()` and the view containing the icon using `https://developer.android.com/reference/androidx/core/splashscreen/SplashScreenViewProvider#iconView()`.

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

The application always needs to call `https://developer.android.com/reference/androidx/core/splashscreen/SplashScreenViewProvider#remove()` once it's done with it.

## Summary

| ### Public methods |
|---|---|
| `final long` | `https://developer.android.com/reference/androidx/core/splashscreen/SplashScreenViewProvider#getIconAnimationDurationMillis()()` Duration of the icon animation as provided in \[R.attr. |
| `final long` | `https://developer.android.com/reference/androidx/core/splashscreen/SplashScreenViewProvider#getIconAnimationStartMillis()()` Start time of the icon animation. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html` | `https://developer.android.com/reference/androidx/core/splashscreen/SplashScreenViewProvider#getIconView()()` The view containing the splashscreen icon as defined by `https://developer.android.com/reference/androidx/core/splashscreen/R.attr#windowSplashScreenAnimatedIcon()` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html` | `https://developer.android.com/reference/androidx/core/splashscreen/SplashScreenViewProvider#getView()()` The splash screen view, copied into this application process. |
| `final void` | `https://developer.android.com/reference/androidx/core/splashscreen/SplashScreenViewProvider#remove()()` Remove the SplashScreen's view from the view hierarchy. |

## Public methods

### getIconAnimationDurationMillis

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
public final long getIconAnimationDurationMillis()
```

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

### getIconAnimationStartMillis

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
public final long getIconAnimationStartMillis()
```

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.

### getIconView

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
public final @NonNull View getIconView()
```

The view containing the splashscreen icon as defined by `https://developer.android.com/reference/androidx/core/splashscreen/R.attr#windowSplashScreenAnimatedIcon()`

### getView

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
public final @NonNull View getView()
```

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

### remove

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
public final void remove()
```

Remove the SplashScreen's view from the view hierarchy.

This always needs to be called when an `https://developer.android.com/reference/androidx/core/splashscreen/SplashScreen.OnExitAnimationListener` is set.