android / views-widgets-samples

Multiple samples showing the best practices in views-widgets on Android.
Apache License 2.0
5.07k stars 3.01k forks source link

MotionLayout inside a ScrollView not optimized for animation changes #216

Open abbasshah17 opened 3 years ago

abbasshah17 commented 3 years ago

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:

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.