Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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