# SplashScreen.KeepOnScreenCondition

# SplashScreen.KeepOnScreenCondition

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/SplashScreen.kt+class:androidx.core.splashscreen.SplashScreen.KeepOnScreenCondition)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/splashscreen/SplashScreen.KeepOnScreenCondition "View this page in Java")

<br />

```
fun interface SplashScreen.KeepOnScreenCondition
```

<br />

*** ** * ** ***

Condition evaluated to check if the splash screen should remain on screen

The splash screen will stay visible until the condition isn't met anymore. The condition is evaluated before each request to draw the application, so it needs to be fast to avoid blocking the UI.

## Summary

|                                ### Public functions                                 |
|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | `@`[MainThread](https://developer.android.com/reference/kotlin/androidx/annotation/MainThread) [shouldKeepOnScreen](https://developer.android.com/reference/kotlin/androidx/core/splashscreen/SplashScreen.KeepOnScreenCondition#shouldKeepOnScreen())`()` Callback evaluated before every requests to draw the Activity. |

## Public functions

### shouldKeepOnScreen

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

```
@MainThread
fun shouldKeepOnScreen(): Boolean
```

Callback evaluated before every requests to draw the Activity. If it returns`true`, the splash screen will be kept visible to hide the Activity below.

This callback is evaluated in the main thread.