Skip to content

Instantly share code, notes, and snippets.

@tmaxxdd
Last active March 23, 2020 21:04
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 tmaxxdd/9aab8da82ecf1e68409b4315d5d249cd to your computer and use it in GitHub Desktop.
Save tmaxxdd/9aab8da82ecf1e68409b4315d5d249cd to your computer and use it in GitHub Desktop.
class MotionProgressListener(private val progressListener: (Float) -> Unit) :
MotionLayout.TransitionListener {
override fun onTransitionTrigger(layout: MotionLayout?, triggerId: Int, positive: Boolean, progress: Float) {}
override fun onTransitionStarted(layout: MotionLayout?, startId: Int, endId: Int) {}
override fun onTransitionChange(layout: MotionLayout?, startId: Int, endId: Int, progress: Float) {
progressListener.invoke(progress)
}
override fun onTransitionCompleted(layout: MotionLayout?, currentId: Int) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment