I use a ViewPager have 3 pages. How to reset MotionLayout and re-run animation when a page is re-selected?
Currently, I call method transitionToStart()
when a page replaced by another. But if user swipe back too quickly, animation transitionToStart()
won't finish.
Is there a better method?
You can do the following:
You can manually set the progress by calling
.setProgress(0)
or.setProgress(1)
Based on
.setTransition(R.id.transition)
you can define start and end constraint (in case you have more than two constraintSets).