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 types |
|---|
public final class GuidedDatePickerAction.Builder extends GuidedDatePickerAction.BuilderBaseBuilder class to build a GuidedDatePickerAction. |
public abstract class GuidedDatePickerAction.BuilderBase<B extends GuidedDatePickerAction.BuilderBase> extends GuidedAction.BuilderBaseBase Builder class to build GuidedDatePickerAction. |
Public constructors |
|---|
Public methods |
|
|---|---|
long |
getDate()Get current value of DatePicker in milliseconds since January 1, 1970 00:00:00 in |
@Nullable 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 |
long |
Get minimal value of DatePicker in milliseconds since January 1, 1970 00:00:00 in |
void |
onRestoreInstanceState(@NonNull Bundle bundle, @Nullable String key)Restore action from a bundle using a given key. |
void |
onSaveInstanceState(@NonNull Bundle bundle, @Nullable 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 Constants |
||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||
|
Inherited methods |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
Public methods
getDate
public long getDate()
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
public @Nullable 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.
getMaxDate
public long getMaxDate()
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
public long getMinDate()
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
public void onRestoreInstanceState(@NonNull Bundle bundle, @Nullable String key)
Restore action from a bundle using a given key. When isAutoRestore() is true:
isEditableis true: save text ofgetTitleisDescriptionEditableis true: save text ofgetDescriptiongetCheckSetIdis notNO_CHECK_SET: saveisChecked}GuidedDatePickerActionwill be saved
onSaveInstanceState
public void onSaveInstanceState(@NonNull Bundle bundle, @Nullable String key)
Save action into a bundle using a given key. When isAutoRestoreEna() is true:
isEditableis true: save text ofgetTitleisDescriptionEditableis true: save text ofgetDescriptiongetCheckSetIdis notNO_CHECK_SET: saveisChecked}GuidedDatePickerActionwill be saved
setDate
public void setDate(long date)
Sets current value of DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault time zone.
| Parameters | |
|---|---|
long date |
New value to update current value of DatePicker Action. |