epoxy-adapter / com.airbnb.epoxy / EpoxyRecyclerView / buildModelsWith

buildModelsWith

fun buildModelsWith(callback: EpoxyRecyclerView.ModelBuilderCallback): Unit

Allows you to build models via a callback instead of needing to create a new EpoxyController class. This is useful if your models are simple and you would like to simply declare them in your activity/fragment.

Multiple calls to this will reuse the same underlying EpoxyController so views in the RecyclerView will be reused.

Another useful pattern is having your Activity or Fragment implement ModelBuilderCallback.

If you're using Kotlin, prefer withModels.

See Also

setController

setControllerAndBuildModels

setModels