CalendarView

open class CalendarView : FrameLayout
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.FrameLayout
   ↳ android.widget.CalendarView

This class is a calendar widget for displaying and selecting dates. The range of dates supported by this calendar is configurable.

The exact appearance and interaction model of this widget may vary between OS versions and themes (e.g. Holo versus Material), but in general a user can select a date by tapping on it and can scroll or fling the calendar to a desired date.
Requires API level 11 (Android 3.0, Honeycomb)

Summary

Nested classes
abstract

The callback used to indicate the user changes the date.

XML attributes
android:showWeekNumber

android:firstDayOfWeek

android:minDate

android:maxDate

android:shownWeekCount

android:selectedWeekBackgroundColor

android:focusedMonthDateColor

android:unfocusedMonthDateColor

android:weekNumberColor

android:weekSeparatorLineColor

android:selectedDateVerticalBar

android:weekDayTextAppearance

android:dateTextAppearance

Inherited XML attributes
Inherited constants
Public constructors
<init>(context: Context)

<init>(context: Context, attrs: AttributeSet?)

<init>(context: Context, attrs: AttributeSet?, defStyleAttr: Int)

<init>(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int)

Public methods
open Unit
setDate(date: Long)

Sets the selected date in milliseconds since January 1, 1970 00:00:00 in TimeZone#getDefault() time zone.

open Unit
setDate(date: Long, animate: Boolean, center: Boolean)

Sets the selected date in milliseconds since January 1, 1970 00:00:00 in TimeZone#getDefault() time zone.

open Long

Gets the selected date in milliseconds since January 1, 1970 00:00:00 in TimeZone#getDefault() time zone.

open Unit

Sets the color for the dates of a not focused month.

open Long

Gets the minimal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone#getDefault() time zone.

open Unit

Sets the color for the week numbers.

open Unit

Sets the drawable for the vertical bar shown at the beginning and at the end of the selected date.

open Unit

Sets the drawable for the vertical bar shown at the beginning and at the end of the selected date.

open Int

Gets the text appearance for the calendar dates.

open Unit
setMaxDate(maxDate: Long)

Sets the maximal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone#getDefault() time zone.

open Unit

Sets the color for the dates of the focused month.

open Int

Gets the first day of week.

open Unit

Sets the number of weeks to be shown.

open Int

Gets the color for the separator line between weeks.

open Unit
setShowWeekNumber(showWeekNumber: Boolean)

Sets whether to show the week number.

open Int

Gets the text appearance for the week day abbreviation of the calendar header.

open CharSequence!

Return the class name of this object to be used for accessibility purposes.

open Unit
setFirstDayOfWeek(firstDayOfWeek: Int)

Sets the first day of week.

open Long

Gets the maximal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone#getDefault() time zone.

open Unit

Sets the background color for the selected week.

open Int

Gets the background color for the selected week.

open Int

Gets the number of weeks to be shown.

open Unit

Sets the text appearance for the calendar dates.

open Unit
setMinDate(minDate: Long)

Sets the minimal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone#getDefault() time zone.

open Boolean

Gets whether to show the week number.

open Unit

Sets the color for the separator line between weeks.

open Unit

Sets the listener to be notified upon selected date change.

open Int

Gets the color for the dates in the focused month.

open Drawable!

Gets the drawable for the vertical bar shown at the beginning and at the end of the selected date.

open Int

Gets the color for the week numbers.

open Int

Gets the color for the dates in a not focused month.

open Unit

Sets the text appearance for the week day abbreviation of the calendar header.

Protected methods
open Unit

Called when the current configuration of the resources being used by the application have changed.

Inherited functions