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:

  1. 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.
  2. A layout manager is automatically added with assumed defaults. See createLayoutManager
  3. Fixed size is enabled if this view's size is MATCH_PARENT
  4. If a GridLayoutManager is used this will automatically sync the span count with the EpoxyController. See syncSpanCount
  5. Helper methods like withModels, setModels, buildModelsWith make it simpler to set up simple RecyclerViews.
  6. Set an EpoxyController and build models in one step - setControllerAndBuildModels or withModels
  7. Support for automatic item spacing. See .setItemSpacingPx
  8. Defaults for usage as a nested recyclerview are provided in Carousel.
  9. setClipToPadding is set to false by default since that behavior is commonly desired in a scrolling list