views-widgets-samples
views-widgets-samples copied to clipboard
MotionLayout inside a ScrollView not optimized for animation changes
Hi, I have a MotionLayout
inside a ScrollView
where I'm hiding and showing Views
during the Transition
from one ConstraintSet
to the next.
I'm having a couple of problems when I ad a ScrollView
as a parent:
- Animation between any two
ConstraintSet
s skips all the frames except the end. - Transitions between some
ConstraintSet
s doesn't yield the same result as without (I realize this might be because of incomplete/wrongConstraintSet
s defined in the scene, however I've searched through the code and can't find any reasonable explanation).
I can further provide a complete example for the 1st case if needed. However the problem is fairly consistent.
At first I thought the problem was due to size/bounds re-calculations of MotionLayout
(due to the newly added parent) which was changed from "android:layout_height="match_parent"
to "android:layout_height="wrap_content"
and so I reset the height to a hard-coded value to see if that would optimize the drawing. But that did not yield any difference.
I also tried motion:layoutDuringTransition="ignoreRequest"
on all the transitions but again no good result.