Created
February 24, 2019 10:43
-
-
Save ShoMasegi/a41ebd7a0b390ed71829862f5192f9f7 to your computer and use it in GitHub Desktop.
Epoxy_Layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline fun EpoxyController.carousel(modelInitializer: CarouselModelBuilder.() -> Unit) { | |
CarouselModel_().apply { | |
modelInitializer() | |
}.addTo(this) | |
} | |
inline fun <T> CarouselModelBuilder.withModelsFrom( | |
items: List<T>, | |
modelBuilder: (T) -> EpoxyModel<*> | |
) { | |
models(items.map { modelBuilder(it) }) | |
} | |
inline fun <T> HorizontalCarouselModelBuilder.withModelsFrom( | |
items: List<T>, | |
modelBuilder: (T) -> EpoxyModel<*> | |
) { | |
models(items.map { modelBuilder(it) }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment