Skip to content

Instantly share code, notes, and snippets.

@EmmanuelGuther
Created December 15, 2017 12:22
Show Gist options
  • Select an option

  • Save EmmanuelGuther/2de5c9ea0d54af325f13a7d4d4e8058b to your computer and use it in GitHub Desktop.

Select an option

Save EmmanuelGuther/2de5c9ea0d54af325f13a7d4d4e8058b to your computer and use it in GitHub Desktop.
Animate appbar
fun animationAppBarDown(appBar: AppBarLayout) {
object : CountDownTimer(300, 1) {
override fun onTick(millisUntilFinished: Long) {
appBar.translationY = (-appBar.height).toFloat()
}
override fun onFinish() {
appBar.animate()
.translationY(0f)
.setDuration(500).start()
}
}.start()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment