Open ahmadmssm opened 3 years ago
Thanks, I will wait for this feature.
@ahmadmssm try version 1.3.4-alpha for implementation without data-binding.
val dummyList = listOf<Any>(1, "Test Item 2", 4.5, 7, 5.8, "Dummy Item 3")
LiveAdapter(dummyList)
.map<Int>(R.layout.item_rv) {
onBind {
it.binding.getViewById<TextView>(R.id.text_item_label)?.text = "Int Item ${it.binding.data}"
}
}
.map<Double>(R.layout.item_rv) {
onBind {
it.binding.getViewById<TextView>(R.id.text_item_label)?.text = "Float Item ${it.binding.data}"
}
}
.map<String>(R.layout.item_rv) {
onBind {
it.binding.getViewById<TextView>(R.id.text_item_label)?.text = it.binding.data
}
}
.into(findViewById(R.id.rv_dummy))
If you are using kotlin, Don't forget to add apply plugin: 'kotlin-kapt'
at the top section and
kapt 'com.android.databinding:compiler:GRADLE_PLUGIN_VERSION'
in dependencies block of the module's build.gradle file.
@ahmadmssm let me know if you face any issues with it. I will move this version to stable and close this issue after a week from now.
@ahmadmssm I will try to add it in the next version and release it soon.