cymcsg / UltimateRecyclerView

A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.
Apache License 2.0
7.22k stars 1.43k forks source link

UltimateDifferentViewTypeAdapter is difficult to use #469

Open sandeep-voxer opened 7 years ago

sandeep-voxer commented 7 years ago

Can you please add a constructor which requires the developer to pass in the enum to data binder map? Otherwise, it's not obvious to the developer that they have to add Enum to data binder mappings for the adapter to work correctly.

UltimateDifferentViewTypeAdapter is a subclass of UltimateViewAdapter which seems to be designed only for single view type holder - so it has an abstract method onCreateViewHolder(parent) , which is not applicable at all for multiple view types! For multiple view types, unless you know the position, you don't know which type of ViewHolder to create and return, and this is only known to the DataBinder!

Also, it doesn't seem to make sense for each DataBinder to have methods like notifyItemRangeInserted() etc. That seems like something that should be part of the overall adapter and not a per-ViewType operation.