RecyclerTreeView icon indicating copy to clipboard operation
RecyclerTreeView copied to clipboard

LayoutItemType.getLayoutID() should by LayoutItemType.getViewType()

Open MarcusWolschon opened this issue 5 years ago • 0 comments

LayoutItemType must implement a "fun getLayoutID() : Int".

a) Most of the time, it is not used as a layout ID but just as a convenient value for itemViewType b) Hardcoding layout IDs prevents the use of ViewBinding to instantiate layouts.

Instead we could give the TreeViewBinder a function to instantiate a new view with a default implementation that inflates a layout.

This way the provideViewHolder() method can be given a view of a specific type and thus increase type safety and null safety.

MarcusWolschon avatar Jun 18 '20 06:06 MarcusWolschon