ebarrenechea / header-decor

A couple of sticky header decorations for android's recycler view.
Apache License 2.0
879 stars 159 forks source link

Support different header view types #65

Closed grandstaish closed 6 years ago

grandstaish commented 7 years ago

You'll need to do is deprecate onCreateHeaderViewHolder(ViewGroup parent) and add a new method: onCreateHeaderViewHolder(ViewGroup parent, int viewType)

The viewType can be derived from the adapter like so:

mAdapter.getItemViewType(position);

This makes it consistent with the onCreateViewHolder(ViewGroup parent, int viewType) method.

(As a side note, you should really add nullability annotations. Nice implementation otherwise!)