Android 12 Developer Preview is here! Try it out, and give us your feedback!

DatePicker

open class DatePicker : Picker
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.FrameLayout
   ↳ androidx.leanback.widget.picker.Picker
   ↳ androidx.leanback.widget.picker.DatePicker

DatePicker is a directly subclass of Picker. This class is a widget for selecting a date. The date can be selected by a year, month, and day Columns. The "minDate" and "maxDate" from which dates to be selected can be customized. The columns can be customized by attribute "datePickerFormat" or setDatePickerFormat(String). android.R.attr#maxDate android.R.attr#minDate R.attr#datePickerFormat

Summary

Public constructors
<init>(context: Context!, attrs: AttributeSet!)

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

Public methods
open Long

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

open String!

Get format of showing dates.

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 Long

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

Unit
onColumnValueChanged(column: Int, newVal: Int)

open Unit
setDate(timeInMilliseconds: Long)

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

open Unit
setDate(year: Int, month: Int, dayOfMonth: Int, animation: Boolean)

Update the current date.

open Unit
setDatePickerFormat(datePickerFormat: String!)

Changes format of showing dates.

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
setMinDate(minDate: Long)

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

Inherited functions