MotionLayout & RecyclerView
summary
Uses MotionLayout to animate RecyclerView items as a replacement for shared element transitions, building a clickable overlay placeholder overlay that copies a clicked ViewHolder into a MotionScene and animates between list and detail constraint sets. Code uses Kotlin ViewBinding, channels and extension functions like apply binding to placeholder to handle offscreen or differently sized viewholders, avoids bitmaps by copying view attributes, uses setTransitionListener, ships to production with lower delay and better performance than shared element transitions.
AI-written summary · about
chapters (24)
- 0:00Introduction to MotionLayout
- 1:16Past animation challenges
- 3:04Discovering MotionLayout
- 5:56Requirements for RecyclerView
- 7:19Initial placeholder approach
- 9:05Converting ConstraintLayout
- 11:58Detail view constraints
- 14:08Running the transition
- 15:14Kotlin setup and clicks
- 17:45Bitmap vs attribute copying
- 20:40Production rollout issues
- 21:01Alternative approaches
- 22:48MotionLayout internals idea
- 23:30Attribute copying demo
- 25:13Benefits of new approach
- 25:55MotionLayout power
- 27:17Q&A session begins
- 33:44Learning MotionLayout
- 34:27Keyframe animations
- 35:51Handling visible views
- 37:37Animation callbacks
- 39:24Performance comparison
- 40:10Designing slides
- 41:17Closing remarks
