Epoxy is an Android library for building complex screens in a RecyclerView. Models are automatically generated from custom views or databinding layouts via annotation processing. These models are then used in an EpoxyController to declare what items to show in the RecyclerView. This abstracts the boilerplate of view holders, diffing items and binding payload changes, item types, item ids, span counts, and more, in order to simplify building screens with multiple view types. Additionally, Epoxy adds support for saving view state and automatic diffing of item changes. We developed Epoxy at Airbnb to simplify the process of working with RecyclerViews, and to add the missing functionality we needed. We now use Epoxy for most of the main screens in our app and it has improved our developer experience greatly. If you are using layout resources in Epoxy annotations then for library projects add Butterknife's gradle plugin to your buildscript.
Features
- The EpoxyModels that describe how your views should be displayed in the RecyclerView
- The EpoxyController where the models are used to describe what items to show and with what data
- Epoxy generates models for you based on your view or layout
- Generated model classes are suffixed with an underscore (_) are used directly in your EpoxyController classes.
- If you use xml layouts without databinding you can create a model class to do the binding
- A controller defines what items should be shown in the RecyclerView, by adding the corresponding models in the desired order