DatePicker

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

Provides a widget for selecting a date.

When the android.R.styleable#DatePicker_datePickerMode attribute is set to spinner, the date can be selected using year, month, and day spinners or a CalendarView. The set of spinners and the calendar view are automatically synchronized. The client can customize whether only the spinners, or only the calendar view, or both to be displayed.

When the android.R.styleable#DatePicker_datePickerMode attribute is set to calendar, the month and day can be selected using a calendar-style view while the year can be selected separately using a list.

See the Pickers guide.

For a dialog using this view, see android.app.DatePickerDialog.

Summary

Nested classes
abstract

The callback used to indicate the user changed the date.

XML attributes
android:startYear

android:endYear

android:maxDate

android:minDate

android:spinnersShown

android:calendarViewShown

android:dayOfWeekBackground

android:dayOfWeekTextAppearance

android:headerBackground

android:headerMonthTextAppearance

android:headerDayOfMonthTextAppearance

android:headerYearTextAppearance

android:yearListItemTextAppearance

android:yearListSelectorColor

android:calendarTextColor

android:datePickerMode

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

Sets whether the spinners are shown.

open Boolean

Returns whether the spinners are shown.

open CalendarView!

Returns the CalendarView used by this picker.

open Long

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

open Int

open Unit
setMaxDate(maxDate: Long)

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

open Unit
init(year: Int, monthOfYear: Int, dayOfMonth: Int, onDateChangedListener: DatePicker.OnDateChangedListener!)

Initialize the state.

open Int

open AutofillValue?

Gets the View's current autofill value.

open Int

Gets the first day of week.

open Unit

Dispatches creation of a ViewStructures for autofill purposes down the hierarchy, when an Assist structure is being created as part of an autofill request.

open CharSequence!

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

open Unit

Set the callback that indicates the date has been adjusted by the user.

open Unit
setFirstDayOfWeek(firstDayOfWeek: Int)

Sets the first day of week.

open Unit

Sets whether the CalendarView is shown.

open Unit

Automatically fills the content of this view with the value.

open Long

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

open Int

Describes the autofill type of this view, so an android.service.autofill.AutofillService can create the proper AutofillValue when autofilling the view.

open Unit
updateDate(year: Int, month: Int, dayOfMonth: Int)

Update the current date.

open Boolean

open Unit
setMinDate(minDate: Long)

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

open Boolean

Returns whether the CalendarView is shown.

open Unit
setEnabled(enabled: Boolean)

open Int

Protected methods
open Unit

open Unit

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

open Parcelable?

open Unit

Inherited functions