You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could leverage the power of kotlin DSL even more to add support for DiffUtils. Something like that:
funcatAdapterDelegate() = adapterDelegate<Cat, Animal>(R.layout.item_cat) {
val name :TextView= findViewById(R.id.name)
bind { diffPayloads ->// diffPayloads is a List<Any> containing the Payload from your DiffUtils
name.text = item.name // Item is of type Cat and is the current bound item.
}
diff {
itemsTheSame { old, new -> old == new } // returns true if they are the same
contentTheSame {
same { old, new ->false } // returns true if content is the same
changePayload { old, new ->... } // returns the payload
}
}
}
The text was updated successfully, but these errors were encountered:
We could leverage the power of kotlin DSL even more to add support for
DiffUtils
. Something like that:The text was updated successfully, but these errors were encountered: