I have two RecyclerView.Adapters that are using exactly the same RecyclerView.ViewHolders as inner classes.
I wanted to get rid of code duplication and made these ViewHolders free, separate class so the brand new class now can be used by any RecyclerView.Adapters.
However I faced lots of troubles for example difficulty in accessing the adapter objects. getAdapterPosition() always returns -1.
So I changed my mind and made a super RecyclerView.Adapter class which is extended by those adapters and put the ViewHolder in the superclass so those adapters can use it from subclass.
But I want to know if ViewHolder does have to be an inner class. This makes me annoyed. Please do NOT advice me to combine the Adapter classes, they are completely different as the ViewHolder is just a special viewType that can be appear in any RecyclerView
I am waiting for your better approaches which make me feel better.
Regards.