CalendarPageLoader

class CalendarPageLoader(coroutineScope: CoroutineScope, val calendarPageSource: CalendarPageSource)

Handles loading data from CalendarPageSource, caching and prefetching entries. Platform UIs should make use of this class for their data loading. If the page source or focus mode change, it is expected a new instance will be created and the existing instance discarded. Prefetch and cache operations are handled asynchronously via coroutineScope.

Constructors

Link copied to clipboard
fun CalendarPageLoader(coroutineScope: CoroutineScope, calendarPageSource: CalendarPageSource)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun getDateRangeFor(page: Int): ClosedRange<LocalDate>

Gets the range of focused dates displayed on the given page. If no dates are in focus on the given page, falls back to the full range of dates displayed.

Link copied to clipboard
fun getPageData(page: Int): CalendarPage

Gets the data to display for the given page. If necessary, a cache load operation will be started to ensure there's enough data available ahead of time.

Properties

Link copied to clipboard
val calendarPageSource: CalendarPageSource

Sources

Link copied to clipboard