Created
April 3, 2020 20:42
-
-
Save FarshadTahmasbi/59c02ab5ee4439725667a8bc03d2d5af 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
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