A universal RecyclerView.Adapter based on Android's DataBinding
A simple universal RecyclerView.Adapter
based on Android's DataBinding. Created to support the following series on Medium:
Step 0. Make sure that your project is DataBinding-ready. Double check that kotlin-kapt
plugin is applied to the target module.
Step 1. Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation "com.github.fraggjkee:databinding-recycler-adapter:0.2"
}
/sample
folder contains the following examples:
RecyclerView
.Q: What about click handlig? How can I implement it without direct access to ViewHolders
?
A: Refer to the Dynamic List and Dynamic Items samples.
Q: How do I add, remove or reorder elements?
A: Refer to the Dynamic List sample.
Q: How do I update content within individual cells without updating the entire adapter's dataset?
A: Refer to the Dynamic Items sample.
Apache 2.0