Created
March 30, 2019 10:31
-
-
Save StelianMorariu/b612bb6a2df1f5157e70a65f803e046d to your computer and use it in GitHub Desktop.
Change MotionScene
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
motionLayout.setTransitionListener(object:MotionLayout.TransitionListener{ | |
override fun onTransitionTrigger(p0: MotionLayout?, p1: Int, p2: Boolean, p3: Float) { | |
} | |
override fun onTransitionStarted(p0: MotionLayout?, p1: Int, p2: Int) { | |
} | |
override fun onTransitionChange(p0: MotionLayout?, p1: Int, p2: Int, progress: Float) { | |
} | |
override fun onTransitionCompleted(p0: MotionLayout?, currentStateId: Int) { | |
if(!loaded){ | |
loaded = true | |
postDelayed(Handler(), { | |
motionLayout.loadLayoutDescription(R.xml.collapsing_motion_scene) | |
motionLayout.rebuildMotion() | |
},null ,100L) | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment