RecyclerView’s Powerful Companions
summary
Three concrete APIs: DiffUtil computes precise insert remove move/change operations (detectMoves is true by default, can be expensive for huge lists and must run without mutating the backing data), SnapHelper provides paging-like snapping (LinearSnapHelper snaps to center, requires match_parent sizing for correct behavior), and ItemTouchHelper implements drag, swipe, startDrag/startSwipe, thresholds and drop hooks while requiring the adapter to be updated; using DiffUtil across lists reduces boilerplate and works reliably.
AI-written summary · about
chapters (24)
- 0:00Intro
- 3:40Structural Changes
- 5:30Diffutil API
- 6:04Items
- 7:29Content Graph
- 8:11Calculate Diff
- 9:00Dispatch Diff
- 9:59Order of Operations
- 11:05UI Thread
- 12:49Snap Helper
- 13:46Linear Snap Helper
- 14:16Pagers Snap Helper
- 15:16Item Touch Listener
- 16:06Item Touch Helper
- 16:25Make Movement Flags
- 16:59Update Adapter
- 17:26Longpressing
- 18:14CanDrag
- 18:51Swipe
- 19:15Start Swipe
- 19:43Attach State
- 20:15Velocity
- 20:46ItemTouchHelper
- 22:29Outro
related talks
45mGraywater: A Framework for Fast Scroll Performance
55mModern Android Development
42mAdvanced Scrolling Techniques on Android (en)
39mView performance deep dive
25mHow Hard Can a List Be? A Tale of APIs, Perf, and People
33mAndroid Jetpack: Manage infinite lists with RecyclerView and Paging
34mData Binding -- Write Apps Faster
38mImplementing That Common UI in Jetpack Compose: X Ways
