epoxy-adapter / com.airbnb.epoxy / ModelCollector

ModelCollector

interface ModelCollector

Interface used to collect models. Used by EpoxyController. It is also convenient to build DSL helpers for carousel: @link https://github.com/airbnb/epoxy/issues/847.

Functions

add

abstract fun add(model: EpoxyModel<*>): Unit

Extension Functions

carousel

fun ModelCollector.carousel(modelInitializer: CarouselModelBuilder.() -> Unit): Unit

group

fun ModelCollector.group(modelInitializer: GroupModelBuilder.() -> Unit): Unit
fun ModelCollector.group(layoutRes: Int, modelInitializer: GroupModelBuilder.() -> Unit): Unit

Inheritors

EpoxyController

abstract class EpoxyController : ModelCollector, StickyHeaderCallbacks

A controller for easily combining EpoxyModel instances in a RecyclerView.Adapter. Simply implement #buildModels() to declare which models should be used, and in which order. Call #requestModelBuild() whenever your data changes, and the controller will call #buildModels(), update the adapter with the new models, and notify any changes between the new and old models.

GroupModel

abstract class GroupModel : EpoxyModelGroup, ModelCollector

An EpoxyModelGroup usable in a DSL manner via the group extension.

GroupModelBuilder

interface GroupModelBuilder : ModelCollector