Kiel
Kiel is a RecyclerView.Adapter with a minimalist and convenient Kotlin DSL which provides utility on top of Android's normal RecyclerView.Adapter.
Most of time:
- We found ourselves repeating same boiler plate codes for
RecyclerView.Adapter
. - We have difficulty in handling
RecyclerView.Adapter
when there are manyviewTypes
.
But now, Kiel may help us to get rid of these problems.
Usage:
Basic Usage:
Different View Types:
You may register different ViewHolder
s.
Handling Events:
As ViewHolder
instance is accessible in:
onViewHolderCreated
onViewHolderBound
onViewHolderBoundWithPayload
You can handle the events in the same way how you did it before.
DiffUtil:
You may provide your custom DiffUtil.ItemCallback
by extending RecyclerDiffUtilCallback
with diffUtilCallback
: