GuidedDatePickerAction


class GuidedDatePickerAction : GuidedAction


Subclass of GuidedAction that can choose a date. The Action is editable by default; to make it read only, call hasEditableActivatorView(false) on the Builder.

Summary

Nested types

Builder class to build a GuidedDatePickerAction.

Base Builder class to build GuidedDatePickerAction.

Public constructors

Public functions

Long

Get current value of DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.

String?

Returns format of date Picker or null if not specified.

Long

Get maximum value of DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.

Long

Get minimal value of DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone. -1 if not set.

Unit

Restore action from a bundle using a given key.

Unit
onSaveInstanceState(bundle: Bundle, key: String?)

Save action into a bundle using a given key.

Unit
setDate(date: Long)

Sets current value of DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.

Inherited Constants

From androidx.leanback.widget.Action
const Long
NO_ID = -1

Indicates that an id has not been set.

From androidx.leanback.widget.GuidedAction
const Long

Id of standard Cancel action.

const Long

Id of standard Finish action.

const Long

When finishing editing, stay on current action.

const Long

Id of standard Finish action.

const Long

When finishing editing, goes to next action.

const Long

Id of standard No action.

const Long

Id of standard OK action.

const Long

Id of standard Yes action.

const Int

Checkset Id for checkbox.

const Int

Default checkset Id for radio.

const Int

Special check set Id that is neither checkbox nor radio.

Inherited functions

From androidx.leanback.widget.Action
Unit
addKeyCode(keyCode: Int)

Adds a keycode used to invoke this Action.

Drawable?

Returns the icon drawable for this Action.

Long

Returns the id for this Action.

CharSequence?

Returns the first line label for this Action.

CharSequence?

Returns the second line label for this Action.

Unit
removeKeyCode(keyCode: Int)

Removes a keycode used to invoke this Action.

Boolean

Returns true if the Action should respond to the given keycode.

Unit
setIcon(icon: Drawable?)

Sets the icon drawable for this Action.

Unit
setId(id: Long)

Sets the id for this Action.

Unit

Sets the first line label for this Action.

Unit

Sets the second line label for this Action.

String
From androidx.leanback.widget.GuidedAction
Array<String!>!

Returns autofill hints, see setAutofillHints.

Int

Returns the check set id this action is a part of.

CharSequence?

Returns the description of this action.

Int

Returns InputType of action description in editing; only valid when isDescriptionEditable is true.

Int

Returns InputType of action description not in editing.

CharSequence?

Returns the optional description text to edit.

Int

Returns InputType of action title in editing; only valid when isEditable is true.

CharSequence?

Returns the optional title text to edit.

Int

Returns InputType of action title not in editing.

Intent?

Returns the intent associated with this action.

(Mutable)List<GuidedAction!>?
CharSequence?

Returns the title of this action.

Boolean

Returns whether this action can be activated to edit, e.g. a DatePicker.

Boolean

Returns whether this action is has a multiline description.

Boolean

Returns whether this action will request further user input when selected, such as showing another GuidedStepFragment or launching a new activity.

Boolean
Boolean

Returns if this action has editable title or editable description.

Boolean

Returns whether the action will only display information and is thus not clickable.

Boolean

Returns true if Action will be saved to instanceState and restored later, false otherwise.

Boolean

Returns whether this action is checked.

Boolean

Returns whether this action description is editable.

Boolean

Returns true if getEditTitle is not null.

Boolean

Returns whether this action title is editable.

Boolean

Returns whether this action is enabled.

Boolean

Returns whether this action is focusable.

Unit
setChecked(checked: Boolean)

Sets whether this action is checked.

Unit

Sets the description of this action.

Unit
setEditDescription(editDescription: CharSequence?)

Sets the optional description text to edit instead of setDescription.

Unit

Sets the optional title text to edit instead of setTitle.

Unit
setEnabled(enabled: Boolean)

Sets whether this action is enabled.

Unit
setFocusable(focusable: Boolean)

Sets whether this action is focusable.

Unit
setIntent(intent: Intent?)

Sets the intent of this action.

Unit

Change sub actions list.

Unit

Sets the title of this action.

Public constructors

GuidedDatePickerAction

Added in 1.1.0
GuidedDatePickerAction()

Public functions

getDate

Added in 1.1.0
fun getDate(): Long

Get current value of DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.

Returns
Long

Current value of DatePicker Action.

getDatePickerFormat

Added in 1.1.0
fun getDatePickerFormat(): String?

Returns format of date Picker or null if not specified. The format is a case insensitive String containing the * day ('d'), month ('m'), and year ('y'). When the format is not specified, a default format of current locale will be used.

Returns
String?

Format of showing Date, e.g. "YMD". Returns null if using current locale's default.

getMaxDate

Added in 1.1.0
fun getMaxDate(): Long

Get maximum value of DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.

Returns
Long

Maximum value of DatePicker Action or Long.MAX_VALUE if not set.

getMinDate

Added in 1.1.0
fun getMinDate(): Long

Get minimal value of DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone. -1 if not set.

Returns
Long

Minimal value of DatePicker Action or Long.MIN_VALUE if not set.

onRestoreInstanceState

fun onRestoreInstanceState(bundle: Bundle, key: String?): Unit

Restore action from a bundle using a given key. When isAutoRestore() is true:

Subclass may override this method.
Parameters
bundle: Bundle

Bundle to restore the Action from.

key: String?

Key used to restore the Action.

onSaveInstanceState

fun onSaveInstanceState(bundle: Bundle, key: String?): Unit

Save action into a bundle using a given key. When isAutoRestoreEna() is true:

Subclass may override this method.
Parameters
bundle: Bundle

Bundle to save the Action.

key: String?

Key used to save the Action.

setDate

Added in 1.1.0
fun setDate(date: Long): Unit

Sets current value of DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.

Parameters
date: Long

New value to update current value of DatePicker Action.