Added in API level 11

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.

Summary

Nested classes
abstract

The callback used to indicate the user changes the date.

XML attributes
android:dateTextAppearance The text appearance for the day numbers in the calendar grid.
android:firstDayOfWeek The first day of week according to java.
android:focusedMonthDateColor
android:maxDate The maximal date shown by this calendar view in mm/dd/yyyy format.
android:minDate The minimal date shown by this calendar view in mm/dd/yyyy format.
android:selectedDateVerticalBar
android:selectedWeekBackgroundColor
android:showWeekNumber
android:shownWeekCount
android:unfocusedMonthDateColor
android:weekDayTextAppearance The text appearance for the week day abbreviation in the calendar header.
android:weekNumberColor
android:weekSeparatorLineColor
Inherited XML attributes
Inherited constants
Public constructors

CalendarView(context: Context, attrs: AttributeSet?)

CalendarView(context: Context, attrs: AttributeSet?, defStyleAttr: Int)

CalendarView(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int)

Public methods
open CharSequence!

open Long

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

open Int

Gets the text appearance for the calendar dates.

open Int

Gets the first day of week.

open Int

Gets the color for the dates in the focused month.

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 Long

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

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 background color for the selected week.

open Boolean

Gets whether to show the week number.

open Int

Gets the number of weeks to be shown.

open Int

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

open Int

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

open Int

Gets the color for the week numbers.

open Int

Gets the color for the separator line between weeks.

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 Unit

Sets the text appearance for the calendar dates.

open Unit
setFirstDayOfWeek(firstDayOfWeek: Int)

Sets the first day of week.

open Unit

Sets the color for the dates of the focused month.

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
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 Unit

Sets the listener to be notified upon selected date change.

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 Unit

Sets the background color for the selected week.

open Unit
setShowWeekNumber(showWeekNumber: Boolean)

Sets whether to show the week number.

open Unit

Sets the number of weeks to be shown.

open Unit

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

open Unit

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

open Unit

Sets the color for the week numbers.

open Unit

Sets the color for the separator line between weeks.

Protected methods
open Unit

Inherited functions