drakeet / MultiType

Flexible multiple types for Android RecyclerView.
Apache License 2.0
5.76k stars 749 forks source link

Add ItemViewDelegate & onCreateViewHolder(context, _) #292

Closed drakeet closed 4 years ago

drakeet commented 4 years ago

This PR adds a new ItemViewDelegate which is renamed from the old ItemViewBinder, and the old ItemViewBinder now inherits from ItemViewDelegate and provides a compatible LayoutInflater version of ItemViewDelegate implementation.

This change is compatible with the old API, so all projects using MultiType can be upgraded without any changes. But if you need to use a better ItemViewDelegate with a Context parameter, you need to change to inherit ItemViewDelegate by yourself.