Skip to content

Instantly share code, notes, and snippets.

@StelianMorariu
Created March 30, 2019 10:31
Show Gist options
  • Save StelianMorariu/b612bb6a2df1f5157e70a65f803e046d to your computer and use it in GitHub Desktop.
Save StelianMorariu/b612bb6a2df1f5157e70a65f803e046d to your computer and use it in GitHub Desktop.
Change MotionScene
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