Michael P
Michael P

Reputation: 245

How can I get AnimateLayoutChanges on a MotionLayout working?

I want to have my view positions auto-animate using animateLayoutChanges with the LayoutTransition.CHANGING flag on my MotionLayout. Unfortunately I can't get it to work, the views just jump around. I've tried changing the MotionLayout to a ConstraintLayout, and that works just fine. This makes me think it might be an issue with MotionLayout itself, but I'm sure there's got to be some workaround. I need to use a MotionLayout specifically for the rest of my app so any help is greatly appreciated!

Upvotes: 0

Views: 152

Answers (1)

hoford
hoford

Reputation: 5323

Animatelayoutchanges and MotionLayout are not related and do not work together.

Most animation systems do not work together as each tries to control the movement of objects.

Almost every effect achievable with animateLayoutChanges can be done with MotionLayout.

Upvotes: 1

Related Questions