-
Notifications
You must be signed in to change notification settings - Fork 97
Public API
Returns the first visible date in WeekView
.
Returns the first hour that is visible on the screen.
Returns the last visible date in WeekView
.
Returns the typeface used for events, time labels and date labels.
Returns the previously set WeekView.Adapter<T>
, or null
if none was set.
Returns the number of days currently displayed in WeekView
.
Returns whether the first day of the week should be displayed at the start position when WeekView
is rendered for the first time.
Returns whether a horizontal line should be displayed at the bottom of the header row.
Returns the color of the horizontal line at the bottom of the header row.
Returns the stroke width of the horizontal line at the bottom of the header row.
Returns whether a shadow should be displayed at the bottom of the header row.
Returns the color of the shadow at the bottom of the header row.
Returns the radius of the shadow at the bottom of the header row.
Returns whether the current week number is displayed in the header.
Returns the text color of the week number.
Returns the text size of the week number.
Returns the color of the week number's background.
Returns the corner radius of the week number's background.
Returns the padding in the time column to the left and right side of the time label.
Returns the text color of the labels in the time column.
Returns the background color of the time column.
Returns the text size of the labels in the time column.
Returns whether a horizontal line is displayed for each hour in the time column.
Returns the interval in which time labels are displayed in the time column.
Returns whether a vertical line is displayed between the time column and the calendar grid.
Returns the color of the time column separator.
Returns the stroke width of the time column separator.
Returns the vertical header row padding.
Returns the header row background color.
Returns the text color used for all date labels except today.
Returns the text color used for today's date label.
Returns the text size of all date labels.
Returns the corner radius of an event chip.
Returns the text size of a single event chip.
Returns whether the text size of the event chip is adapting to the chip’s height.
Returns the text size of an all-day event chip.
Returns the default text color of an event chip.
Returns the horizontal padding within an event chip.
Returns the vertical padding within an event chip.
Returns the default background color of an event chip.
Returns the column gap at the end of each day.
Returns the horizontal gap between overlapping event chips.
Returns the vertical margin between the event chips of consecutive events.
Returns the horizontal padding used in single-day view.
Returns the background color of a day.
Returns the background color of the current date.
Returns the background color for past dates. If not explicitly set, WeekView
will use dayBackgroundColor
.
Returns the background color for past weekend dates. If not explicitly set, WeekView
will use pastBackgroundColor
.
Returns the background color for future dates. If not explicitly set, WeekView
will use dayBackgroundColor
.
Returns the background color for future weekend dates. If not explicitly set, WeekView
will use futureBackgroundColor
.
Returns the current height of an hour.
Returns the minimum height of an hour. This limits how far a user can zoom out.
Returns the maximum height of an hour. This limits how far a user can zoom in.
Returns whether the complete day should be shown. If true
, hourHeight
automatically adjusts to make sure all hours between minHour
and maxHour
are displayed.
Returns whether a horizontal line should be displayed at the current time.
Returns the color of the horizontal now line.
Returns the stroke width of the horizontal now line.
Returns whether a dot at the start of the now line is displayed. The dot is only displayed if showNowLine
is set to true
.
Returns the color of the dot at the start of the now line.
Returns the radius of the dot at the start of the now line.
Returns whether horizontal lines are displayed as separators between hours.
Returns the stroke color of the hour separators.
Returns the stroke width of the hour separators.
Returns whether vertical lines are displayed as separators between dates.
Returns the color of the separators between dates.
Returns the stroke width of the separators between dates.
Returns the minimum date that WeekView
will display, or null
if none is set. Dates before this date will not be shown.
Returns the maximum date that WeekView
will display, or null
if none is set. Dates after this date will not be shown.
Returns the minimum hour that WeekView
will display. Hours before this time will not be shown.
Returns the maximum hour that WeekView
will display. Hours after this time will not be shown.
Returns whether WeekView
can scroll horizontally. If false
, WeekView
can still scroll vertically.
Scrolls to the current date.
Scrolls to the current time.
Scrolls to the specified date.
Scrolls to the specified hour.
Sets the provided DateFormatter
as the current date formatter. DateFormatter
is of type (Calendar) -> String
.
Sets the provided TimeFormatter
as the current time formatter. TimeFormatter
is of type (Int) -> String
.
-
onCreateEntity(item: T)
: Return aWeekViewEntity
that will be rendered in theWeekView
that is associated with this adapter. -
onEventClick(data: T)
: Returns the data of theWeekViewEvent
that the user clicked on. -
onEventClick(data: T, bounds: RectF)
: Returns the data of theWeekViewEvent
that the user clicked on as well as the bounds of theEventChip
in which it is displayed. -
onEventLongClick(data: T)
: Returns the data of theWeekViewEvent
that the user long-clicked on. -
onEventLongClick(data: T, bounds: RectF)
: Returns the data of theWeekViewEvent
that the user long-clicked on as well as the bounds of the [EventChip] in which it is displayed. -
onEmptyViewClick(time: Calendar)
: Returns the date and time of the location that the user clicked on. -
onEmptyViewLongClick(time: Calendar)
: Returns the date and time of the location that the user long-clicked on. -
submit(events: List<WeekViewDisplayable<T>>)
: Submits a new list ofWeekViewDisplayable
elements to the adapter. Previously submitted events are replaced completely. -
onRangeChanged(firstVisibleDate: Calendar, lastVisibleDate: Calendar)
: Called whenever the range of dates visible inWeekView
changes.
-
onCreateEntity(item: T)
: Return aWeekViewEntity
that will be rendered in theWeekView
that is associated with this adapter. -
onEventClick(data: T)
: Returns the data of theWeekViewEvent
that the user clicked on. -
onEventClick(data: T, bounds: RectF)
: Returns the data of theWeekViewEvent
that the user clicked on as well as the bounds of theEventChip
in which it is displayed. -
onEventLongClick(data: T)
: Returns the data of theWeekViewEvent
that the user long-clicked on. -
onEventLongClick(data: T, bounds: RectF)
: Returns the data of theWeekViewEvent
that the user long-clicked on as well as the bounds of the [EventChip] in which it is displayed. -
onEmptyViewClick(time: Calendar)
: Returns the date and time of the location that the user clicked on. -
onEmptyViewLongClick(time: Calendar)
: Returns the date and time of the location that the user long-clicked on. -
submit(events: List<WeekViewDisplayable<T>>)
: Submits a new list ofWeekViewDisplayable
elements to the adapter. Previously submitted events of the same month are replaced completely. -
onLoadMore(startDate: Calendar, endDate: Calendar)
: Called wheneverWeekView
needs to fetchWeekViewDisplayable
elements of a given month in order to allow for a smooth scrolling experience. -
onRangeChanged(firstVisibleDate: Calendar, lastVisibleDate: Calendar)
: Called whenever the range of dates visible inWeekView
changes. -
refresh()
: Refreshes theWeekViewDisplayable
elements presented by this adapter. All cached elements will be removed and a call toonLoadMore
will be triggered.
Returns the minimum date that WeekView
will display as a LocalDate
, or null
if none is set. Dates before this date will not be shown.
Returns the maximum date that WeekView
will display as a LocalDate
, or null
if none is set. Dates after this date will not be shown.
Returns the first visible date as a LocalDate
Returns the last visible date as a LocalDate
.
Shows a specific date. If it is before minDate
or after maxDate
, these will be shown instead.
Sets the provided closure as the current date formatter.
Use WeekViewSimpleAdapterJodaTime<T>
and WeekViewPagingAdapterJodaTime<T>
for JodaTime-specific method overrides.
Use WeekViewSimpleAdapterJsr310<T>
and WeekViewPagingAdapterJsr310<T>
for JSR310-specific method overrides.
Use WeekViewSimpleAdapterThreeTenAbp<T>
and WeekViewPagingAdapterThreeTenAbp<T>
for ThreeTenABP-specific method overrides.