You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fun ModelCollector.refreshableCarouselNoSnapBuilder(builder: EpoxyCarouselNoSnapRefreshableBuilder.() -> Unit): CarouselNoSnapRefreshableModel_ {
val carouselBuilder = EpoxyCarouselNoSnapRefreshableBuilder().apply { builder() }
add(carouselBuilder.carouselNoSnapRefreshableModel)
return carouselBuilder.carouselNoSnapRefreshableModel
}
class EpoxyCarouselNoSnapRefreshableBuilder(
internal val carouselNoSnapRefreshableModel: CarouselNoSnapRefreshableModel_ = CarouselNoSnapRefreshableModel_()
) : ModelCollector, CarouselNoSnapRefreshableModelBuilder by carouselNoSnapRefreshableModel {
private val models = mutableListOf<EpoxyModel<*>>()
override fun add(model: EpoxyModel<*>) {
models.add(model)
// Set models list every time a model is added so that it can run debug validations to
// ensure it is still valid to mutate the carousel model.
carouselNoSnapRefreshableModel.models(models)
}
Just started using the framework My code :
fun ModelCollector.refreshableCarouselNoSnapBuilder(builder: EpoxyCarouselNoSnapRefreshableBuilder.() -> Unit): CarouselNoSnapRefreshableModel_ {
val carouselBuilder = EpoxyCarouselNoSnapRefreshableBuilder().apply { builder() }
add(carouselBuilder.carouselNoSnapRefreshableModel)
return carouselBuilder.carouselNoSnapRefreshableModel
}
class EpoxyCarouselNoSnapRefreshableBuilder(
internal val carouselNoSnapRefreshableModel: CarouselNoSnapRefreshableModel_ = CarouselNoSnapRefreshableModel_()
) : ModelCollector, CarouselNoSnapRefreshableModelBuilder by carouselNoSnapRefreshableModel {
private val models = mutableListOf<EpoxyModel<*>>()
}
refreshableCarouselNoSnapBuilder {
id("refreshableCarouselNoSnapBuilder")
loadMoreListener(this@SMineController.loadMoreHistoryListener)
refreshAble(false)
height((horizontalItemHeight + marginDP2Top).toFloat())
data?.histories?.forEachIndexed { index, elementAt ->
elementAt.feedFrom = "play_history"
elementAt.routeSource = this@SMineController.fragment.mRouteSource ?: ""
sItemContentView {
id("id_history_$index")
width(horizontalItemWidth)
height(horizontalItemHeight)
marginTop(DensityUtil.dp2px(14f))
marginLeft(if (index == 0) marginDP2Start else marginDP2Left)
marginRight(0)
elementAt.contentCoverUrl?.let { url -> cover(url) }
elementAt.contentName?.let { name -> name(name) }
onItemClickListener { _ ->
this@SMineController.historyItemClickListener.onResponse(index)
}
totalCount(data.totalHistoryCount)
onVisibilityStateChanged { model, view, visibilityState ->
SDebugLog.d(
"vis",
"onVisibilityStateChanged = ${View.VISIBLE == visibilityState}"
)
}
onVisibilityChanged { model, view, percentVisibleHeight, percentVisibleWidth, heightVisible, widthVisible ->
SDebugLog.d("vis", "height = ${View.VISIBLE == heightVisible}")
SDebugLog.d("vis", "width = ${View.VISIBLE == widthVisible}")
}
// itemTag(elementAt.toTraceTag())
}
if (index + 1 == data.totalHistoryCount) {
sWSItemGap {
id("itemGap_end")
height(horizontalItemHeight.toFloat())
width(24f)
color(R.color.s_transparent)
}
isEnableLoadMore(false)
loadMoreListener(null)
}
}
}
The text was updated successfully, but these errors were encountered: