epoxy-adapter / com.airbnb.epoxy / DiffPayload

DiffPayload

open class DiffPayload

A helper class for tracking changed models found by the com.airbnb.epoxy.DiffHelper to be included as a payload in the androidx.recyclerview.widget.RecyclerView.Adapter#notifyItemChanged(int, Object) call.

Constructors

<init>

DiffPayload(changedItem: EpoxyModel<*>!)

Functions

getModelFromPayload

open static fun getModelFromPayload(payloads: MutableList<Any!>!, modelId: Long): EpoxyModel<*>?

Looks through the payloads list and returns the first model found with the given model id. This assumes that the payloads list will only contain objects of type DiffPayload, and will throw if an unexpected type is found.