Created
July 21, 2021 13:00
-
-
Save hi-manshu/e141bd0cdac5cddc574ca6048b2b9be2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class CalendarController( | |
val listener: (CalendarEvent) -> Unit | |
) : TypedEpoxyController<CalendarState.Data>() { | |
override fun buildModels(data: CalendarState.Data) { | |
for (row in data.rows) { | |
calendarRow { | |
onDaySelectedListener { day -> this@CalendarController.listener(CalendarEvent.OnDaySelectedChanged(day)) } | |
onDayTouchedListener { day -> this@CalendarController.listener(CalendarEvent.OnDayTouchedChanged(day)) } | |
} | |
} | |
} | |
private fun buildBannerModel(isFreeTrialAvailable: Boolean) { | |
calendarCluePlusBanner { | |
clickListener { _ -> this@CalendarController.listener(CalendarEvent.OnCluePlusBannerClick) } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment