MovieHunt blog part5. epoxy model and controller sample
class LargeEpoxyModel : EpoxyModel { | |
override fun bind() { | |
// binding implementation | |
} | |
} | |
class NormalEpoxyModel : EpoxyModel { | |
override fun bind() { | |
// binding implementation | |
} | |
} | |
class ModelController(private val movieList: List<MovieModel>): EpoxyController() { | |
override fun buildModels() { | |
movieList.orEachIndexed { index, movie -> | |
if (index == 0) { | |
LargeEpoxyModel_() | |
.addTo(this) | |
} else { | |
NormalEpoxyModel_() | |
.addTo(this) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment