ebarrenechea / header-decor

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

Naming collision with adapters extending thefuntasty/infinity #67

Open vpratfr opened 7 years ago

vpratfr commented 7 years ago

A very useful complement to your library is https://github.com/thefuntasty/infinity

To use it, we need to extend from an adapter class of their own.

When we want to use both libraries, there is a name collision for the functions. The easy way to fix it would be to simply be more specific in the function names for your interface:

long getStickyHeaderId(int position);
T onCreateStickyHeaderViewHolder(ViewGroup parent);
void onBindStickyHeaderViewHolder(T viewholder, int position);

Would that be possible?

The current workaround is to use a generic ViewHolder as the template parameter for the interface, but that defeats the purpose of having a generic interface and forces you to make some ugly casts in code.

starkej2 commented 7 years ago

Definitely possible - I'll look into it, thanks!

oshamahue commented 6 years ago

I this would be a breaking change on upgrade. So we should be careful if we want to do this.