Epoxy: Airbnb's View Architecture on Android
Article Summary
Eli Hart from Airbnb reveals how they eliminated RecyclerView boilerplate while building complex screens with 8+ view types. Their solution handles diffing, animations, and state management automatically.
Airbnb open-sourced Epoxy, their Android view architecture library that simplifies building complex RecyclerView-based UIs. The library takes a React-inspired compositional approach where developers describe what to show, and Epoxy handles the rendering details including automatic diffing and animations.
Key Takeaways
- Models define layout, binding, and span—adapter handles display complexity automatically
- Built-in diffing algorithm updates only changed views, enabling smooth animations
- Annotation processor generates hashCode and setters from @EpoxyAttribute fields
- Stable IDs and view state saving work out of the box
- Powers Airbnb's listing details page for faster loads and smoother transitions
Critical Insight
Epoxy reduces RecyclerView complexity by letting developers declare what to show while the library handles diffing, animations, and state management automatically.