GuidedDatePickerAction
public
class
GuidedDatePickerAction
extends GuidedAction
java.lang.Object | |||
↳ | androidx.leanback.widget.Action | ||
↳ | androidx.leanback.widget.GuidedAction | ||
↳ | androidx.leanback.widget.GuidedDatePickerAction |
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 classes | |
---|---|
class |
GuidedDatePickerAction.Builder
Builder class to build a GuidedDatePickerAction. |
class |
GuidedDatePickerAction.BuilderBase<B extends BuilderBase>
Base Builder class to build GuidedDatePickerAction. |
Inherited constants |
---|
Public constructors | |
---|---|
GuidedDatePickerAction()
|
Public methods | |
---|---|
long
|
getDate()
Get current value of DatePicker in milliseconds since January 1, 1970 00:00:00 in
|
String
|
getDatePickerFormat()
Returns format of date Picker or null if not specified. |
long
|
getMaxDate()
Get maximum value of DatePicker in milliseconds since January 1, 1970 00:00:00 in
|
long
|
getMinDate()
Get minimal value of DatePicker in milliseconds since January 1, 1970 00:00:00 in
|
void
|
onRestoreInstanceState(Bundle bundle, String key)
Restore action from a bundle using a given key. |
void
|
onSaveInstanceState(Bundle bundle, String key)
Save action into a bundle using a given key. |
void
|
setDate(long date)
Sets current value of DatePicker in milliseconds since January 1, 1970 00:00:00 in
|
Inherited methods | |
---|---|
Public constructors
GuidedDatePickerAction
public GuidedDatePickerAction ()
Public methods
getDate
public long getDate ()
Get current value of DatePicker in milliseconds since January 1, 1970 00:00:00 in
TimeZone.getDefault()
time zone.
Returns | |
---|---|
long |
Current value of DatePicker Action. |
getDatePickerFormat
public String getDatePickerFormat ()
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
public long getMaxDate ()
Get maximum value of DatePicker in milliseconds since January 1, 1970 00:00:00 in
TimeZone.getDefault()
time zone.
Returns | |
---|---|
long |
Maximum value of DatePicker Action or Long.MAX_VALUE if not set. |
getMinDate
public long getMinDate ()
Get minimal value of DatePicker in milliseconds since January 1, 1970 00:00:00 in
TimeZone.getDefault()
time zone. -1 if not set.
Returns | |
---|---|
long |
Minimal value of DatePicker Action or Long.MIN_VALUE if not set. |
onRestoreInstanceState
public void onRestoreInstanceState (Bundle bundle, String key)
Restore action from a bundle using a given key. When isAutoRestore() is true:
isEditable()
is true: save text of getTitle()
isDescriptionEditable()
is true: save text of getDescription()
getCheckSetId()
is not NO_CHECK_SET
: save isChecked()
}GuidedDatePickerAction
will be savedParameters | |
---|---|
bundle |
Bundle : Bundle to restore the Action from. |
key |
String : Key used to restore the Action.
|
onSaveInstanceState
public void onSaveInstanceState (Bundle bundle, String key)
Save action into a bundle using a given key. When isAutoRestoreEna() is true:
isEditable()
is true: save text of getTitle()
isDescriptionEditable()
is true: save text of getDescription()
getCheckSetId()
is not NO_CHECK_SET
: save isChecked()
}GuidedDatePickerAction
will be savedParameters | |
---|---|
bundle |
Bundle : Bundle to save the Action. |
key |
String : Key used to save the Action.
|
setDate
public void setDate (long date)
Sets current value of DatePicker in milliseconds since January 1, 1970 00:00:00 in
TimeZone.getDefault()
time zone.
Parameters | |
---|---|
date |
long : New value to update current value of DatePicker Action.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-24 UTC.