-
Notifications
You must be signed in to change notification settings - Fork 727
EpoxyRecyclerView
Since 2.6.0. This is in Beta, please leave feedback by opening an issue!
Epoxy provides the EpoxyRecyclerView
class to enable easy integration between Epoxy and RecyclerView. The goal of this class is to reduce boilerplate in setting up a RecyclerView by applying common defaults. Additionally, several performance optimizations are made.
-
A single view pool is automatically shared between all
EpoxyRecyclerView
instances in the same activity. This should increase view recycling potential and increase performance. -
A layout manager is automatically added with sane defaults.
-
Fixed size is enabled if this view's size is MATCH_PARENT
-
If a GridLayoutManager is used this will automatically sync the span count with the EpoxyController.
-
Helper methods to set models without needing to create a EpoxyController class.
-
Set an EpoxyController and build models in one step with
setEpoxyControllerAndBuildModels
-
Defaults for usage as a nested recyclerview are provided in Carousel.
If you are using a GridLayoutManager you normally have to let Epoxy know what the grid span count is and set up the grid span size look up (as detailed here). With EpoxyRecyclerView this span size synchronization is done automatically when you add a GridLayoutManager to the RecyclerView.