Created
June 1, 2020 15:24
-
-
Save LiewJunTung/bb5b9c02c4080eef17809fa73d1b1a06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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