views-widgets-samples icon indicating copy to clipboard operation
views-widgets-samples copied to clipboard

MotionLayout inside a ScrollView not optimized for animation changes

Open abbasshah17 opened this issue 3 years ago • 0 comments

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 ConstraintSets skips all the frames except the end.
  • Transitions between some ConstraintSets doesn't yield the same result as without (I realize this might be because of incomplete/wrong ConstraintSets 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.

abbasshah17 avatar Jun 17 '21 06:06 abbasshah17