CalendarPageSource

interface CalendarPageSource

The core calendar page source interface. Calendar page sources are used to provide a layout to calendar pages. See CalendarMonthPageSource and CalendarWeekPageSource for default implementations.

Functions

Link copied to clipboard
abstract fun getPageFor(date: LocalDate): Int

Get the page number for the given date. This function should be as lightweight as possible, as no results here are cached.

Link copied to clipboard
abstract fun loadPageData(page: Int): CalendarPage

Takes a page number and a DisplayDate producer, and returns a set of rows to display in the calendar UI. This should not implement any caching itself, caching is handled by consumers.

Link copied to clipboard
open fun mapInternalPositionToPage(position: Int): Int

Maps the given internal position of a zero-based pager to the page number. Note this is not necessary if we have a pager that supports negative numbers in the first place.

Link copied to clipboard
open fun mapPageToInternalPosition(page: Int): Int

Maps the given page number to an internal zero-based position. Note this is not necessary if we have a pager that supports negative numbers in the first place.

Properties

Link copied to clipboard
abstract val hasOverlappingDates: Boolean

Whether this page source has dates that may overlap from one page to the next. Ephemeris may use this to determine whether additional updates are necessary when changing a date.

Link copied to clipboard
abstract val maxPageRange: IntRange

Defines the maximum number of pages to be displayed. Pages are zero-based, therefore negative values represent pages before the start page, and positive values represent pages after the start page. Note the total number of pages should not exceed Int.MAX_VALUE.

Inheritors

Link copied to clipboard
Link copied to clipboard

Sources

Link copied to clipboard