epoxy-adapter / com.airbnb.epoxy / EpoxyRecyclerView / <init>
<init>
EpoxyRecyclerView(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)
A RecyclerView implementation that makes for easier integration with Epoxy. The goal of this
class is to reduce boilerplate in setting up a RecyclerView by applying common defaults.
Additionally, several performance optimizations are made.
Improvements in this class are:
- A single view pool is automatically shared between all EpoxyRecyclerView instances in
the same activity. This should increase view recycling potential and increase performance when
nested RecyclerViews are used. See .initViewPool.
- A layout manager is automatically added with assumed defaults. See createLayoutManager
- 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. See syncSpanCount
- Helper methods like withModels, setModels, buildModelsWith
make it simpler to set up simple RecyclerViews.
- Set an EpoxyController and build models in one step -
setControllerAndBuildModels or withModels
- Support for automatic item spacing. See .setItemSpacingPx
- Defaults for usage as a nested recyclerview are provided in Carousel.
- setClipToPadding is set to false by default since that behavior is commonly
desired in a scrolling list