How to use SimpleEpoxyModel
- Dominant language
- Java
- Stars
- 8.6k
- Forks
- 734
- PR merge metrics
- No merged PRs in 30d
Description
I found this file which is supposed to give a sample for SimpleEpoxyModel but, well, it doesn't.
https://github.com/airbnb/epoxy/blob/master/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/ColorModel.kt
~I can't figure out why SimpleExpoyModel is not working for me. My usage is this.~
```
fun EpoxyController.divider(addIf: Boolean = true) {
SimpleEpoxyModel(R.layout.list_item_vertical_divider).addIf(addIf, this)
}
```
```
```
```
override fun buildModels(list: List) {
list.forEachIndexed { index, item ->
// list stuff
divider(addIf = index < list.lastIndex)
}
}
```
~I get a blank recyclerView with nothing on it.~
~If I remove the divider line, everything works fine, but without any divider, of course.~
Contributor guide
Research direction
Open epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/ColorModel.kt and compare its contents with the issue's SimpleEpoxyModel divider example. Use the provided snippets as the reproduction case; done means the sample clearly demonstrates a working SimpleEpoxyModel usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- documentation, mobile
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100