Skip to content

Instantly share code, notes, and snippets.

@FarshadTahmasbi
Created April 3, 2020 20:42
Show Gist options
  • Save FarshadTahmasbi/59c02ab5ee4439725667a8bc03d2d5af to your computer and use it in GitHub Desktop.
Save FarshadTahmasbi/59c02ab5ee4439725667a8bc03d2d5af to your computer and use it in GitHub Desktop.
setTransitionListener(object : MotionLayout.TransitionListener {
override fun onTransitionTrigger(
p0: MotionLayout?,
p1: Int,
p2: Boolean,
p3: Float
) {
}
override fun onTransitionStarted(p0: MotionLayout?, start: Int, end: Int) {
if (start == startState) {
img.alpha = 0.0f
img_motion.alpha = 1.0f
}
}
override fun onTransitionChange(p0: MotionLayout?, p1: Int, p2: Int, p3: Float) {
}
override fun onTransitionCompleted(p0: MotionLayout?, state: Int) {
if (state == startState) {
img.alpha = 1.0f
img_motion.alpha = 0.0f
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment