Codewaves / Sticky-Header-Grid

Sticky header grid layout manager for RecycleView
MIT License
116 stars 33 forks source link

How to change item view type? #8

Closed mgefimov closed 6 years ago

mgefimov commented 6 years ago

Hello, great work! How i can change item view type? I want use in 3 first items different view. How i can do it?

Codewaves commented 6 years ago

Override getSectionItemViewType and return item type, onCreateItemViewHolder's itemType will be your custom item type.

mgefimov commented 6 years ago

I override this method inside my item holder, but onCreateItemViewHolder's itemType is 0 for every time (

mgefimov commented 6 years ago

oh, sorry, i had override getSectionItemViewType(int section, int offset) method. Thank you for help 👍

Konrad-Morawski commented 6 years ago

Note that due to the bitmask tricks with externalType and internalType, viewType values greater than 255 won't work correctly! So, using eg. R.layout.my_layout as a view type is not a good idea.