I don't like code like this in `RecyclerView`'s `A...
# announcements
m
I don't like code like this in `RecyclerView`'s
Adapter
tho. Prefer to have each case as a class.
1
p
What do you mean by that? Can you give an example?
m
I usually notice threads, but didn't this time 🙂
Yet...
So to answer your question: I have made a very simple abstraction layer called
ItemAdapter
, which looks like https://github.com/elpassion/android-commons/blob/develop/recycler/src/main/java/com/elpassion/android/commons/recycler/components/base/ItemAdapter.kt
You could not find my original idea in that code anymore, cause my ex-coworkers changed it too much since then, but to complete this
ItemAdapter
there was
BaseRecyclerViewAdapter
, which had a list of `ItemAdapter`s and would delegate all work to item at position.
Blame @kasper.kondzielski @karolkowalski @jozzi @langara or whoever for making (or allowing to make) it too complex 😉
p
I don't get it. When do you bind the actual data?
m
Actual data is passed as constructor argument to subclasses of
ItemAdapter
.
l
I've removed ItemAdapters - now it's simpler 😛
👍 1