Skip to content

Instantly share code, notes, and snippets.

@navczydev
Created July 29, 2021 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save navczydev/bda6b106355a9630c28ccef54b89d9e5 to your computer and use it in GitHub Desktop.
Save navczydev/bda6b106355a9630c28ccef54b89d9e5 to your computer and use it in GitHub Desktop.
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