DatePicker
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. maxDateminDatedatePickerFormat
Summary
Public constructors |
|---|
DatePicker(context: Context!, attrs: AttributeSet!) |
DatePicker(context: Context!, attrs: AttributeSet!, defStyleAttr: Int) |
Public functions |
|
|---|---|
Long |
getDate()Gets current date value in milliseconds since January 1, 1970 00:00:00 in |
String! |
Get format of showing dates. |
Long |
Gets the maximal date supported by this |
Long |
Gets the minimal date supported by this |
Unit |
onColumnValueChanged(columnIndex: Int, newValue: Int)Classes extending |
Unit |
Update the current date in milliseconds since January 1, 1970 00:00:00 in |
Unit |
Update the current date. |
Unit |
setDatePickerFormat(datePickerFormat: String!)Changes format of showing dates. |
Unit |
setMaxDate(maxDate: Long)Sets the maximal date supported by this |
Unit |
setMinDate(minDate: Long)Sets the minimal date supported by this |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
Public functions
getDate
fun getDate(): Long
Gets current date value in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.
| Returns | |
|---|---|
Long |
Current date values. |
getDatePickerFormat
fun getDatePickerFormat(): String!
Get format of showing dates. For example "YMD". Default value is from getDateFormatOrder.
| Returns | |
|---|---|
String! |
Format of showing dates. |
getMaxDate
fun getMaxDate(): Long
Gets the maximal date supported by this DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.
Note: The default maximal date is 12/31/2100.
| Returns | |
|---|---|
Long |
The maximal supported date. |
getMinDate
fun getMinDate(): Long
Gets the minimal date supported by this DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.
Note: The default minimal date is 01/01/1900.
| Returns | |
|---|---|
Long |
The minimal supported date. |
onColumnValueChanged
fun onColumnValueChanged(columnIndex: Int, newValue: Int): Unit
Classes extending Picker can override this function to supply the behavior when a list has been scrolled. Subclass may call setColumnValue and or setColumnAt. Subclass should not directly call setCurrentValue which does not update internal state or notify listeners.
setDate
fun setDate(timeInMilliseconds: Long): Unit
Update the current date in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.
| Parameters | |
|---|---|
timeInMilliseconds: Long |
current date value in milliseconds. |
setDate
fun setDate(year: Int, month: Int, dayOfMonth: Int, animation: Boolean): Unit
Update the current date.
setDatePickerFormat
fun setDatePickerFormat(datePickerFormat: String!): Unit
Changes format of showing dates. For example "YMD".
| Parameters | |
|---|---|
datePickerFormat: String! |
Format of showing dates. |
setMaxDate
fun setMaxDate(maxDate: Long): Unit
Sets the maximal date supported by this DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.
| Parameters | |
|---|---|
maxDate: Long |
The maximal supported date. |
setMinDate
fun setMinDate(minDate: Long): Unit
Sets the minimal date supported by this DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.
| Parameters | |
|---|---|
minDate: Long |
The minimal supported date. |