Skip to content

Instantly share code, notes, and snippets.

@LiewJunTung
Created June 1, 2020 15:24
Show Gist options
  • Save LiewJunTung/bb5b9c02c4080eef17809fa73d1b1a06 to your computer and use it in GitHub Desktop.
Save LiewJunTung/bb5b9c02c4080eef17809fa73d1b1a06 to your computer and use it in GitHub Desktop.
animation_button.setOnClickListener {
it.apply {
val transition = ChangeBounds()
transition.duration = 2000L
TransitionManager.beginDelayedTransition(constraint_parent_view, transition)
when {
translationX == 0f -> translationX = 450f
translationX < 0f -> translationX = 0f
translationX > 0f -> translationX = -450f
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment