public ItemIdRes
Maps a field in the data class to a view id present in the layout resource for the view holder. Annotate this to a field in the data class used for your recycler view
@ItemLayoutRes(layoutID = R.layout.my_text_view)
data class MyData(
@ItemIdRes(viewID = R.id.textView) val name: String,
@ItemIdRes(viewID = R.id.imageView, itemType = ItemType.IMAGE) val imageResource: Int,
@ItemIdRes(viewID = R.id.button1) val btn1: String = "Add")
interface ItemLayoutRes
,
enum ItemType
Modifier and Type | Method and Description |
---|---|
ItemType |
itemType()
Specify the type of this field.
|
int |
viewID()
The view resource id to map this field to.
|
int viewID()
The view resource id to map this field to.
Must be present in the layout specified by @ItemLayoutRes
ItemType itemType()
Specify the type of this field.
Text type and Image types are supported. Default to Text