https://kotlinlang.org logo
#announcements
Title
# announcements
m

mg6maciej

04/19/2017, 9:36 AM
I don't like code like this in `RecyclerView`'s
Adapter
tho. Prefer to have each case as a class.
1
p

Paul Woitaschek

04/19/2017, 9:39 AM
What do you mean by that? Can you give an example?
m

mg6maciej

04/19/2017, 9:44 AM
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

Paul Woitaschek

04/19/2017, 9:52 AM
I don't get it. When do you bind the actual data?
m

mg6maciej

04/19/2017, 9:53 AM
Actual data is passed as constructor argument to subclasses of
ItemAdapter
.
l

langara

04/19/2017, 11:48 AM
I've removed ItemAdapters - now it's simpler 😛
👍 1