Skip to content

Instantly share code, notes, and snippets.

@enginebai
Created December 8, 2020 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enginebai/89b6cb85a7b79f7d089033374e63fb9e to your computer and use it in GitHub Desktop.
Save enginebai/89b6cb85a7b79f7d089033374e63fb9e to your computer and use it in GitHub Desktop.
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