Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
// custom exit on splashScreen
splashScreen.setOnExitAnimationListener { splashScreenView ->
// custom animation.
ObjectAnimator.ofFloat(
splashScreenView,
View.TRANSLATION_X,
0f,
splashScreenView.width.toFloat()
).apply {
duration = 1000
// Call SplashScreenView.remove at the end of your custom animation.
doOnEnd {
splashScreenView.remove()
}
}.also {
// Run your animation.
it.start()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment