Most visited

Recently visited

GuidedDatePickerAction

public class GuidedDatePickerAction
extends GuidedAction

java.lang.Object
   ↳ android.support.v17.leanback.widget.Action
     ↳ android.support.v17.leanback.widget.GuidedAction
       ↳ android.support.v17.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

From class android.support.v17.leanback.widget.GuidedAction
From class android.support.v17.leanback.widget.Action

Public constructors

GuidedDatePickerAction()

Public methods

long getDate()

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

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 getDefault() time zone.

long getMinDate()

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

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 getDefault() time zone.

Inherited methods

From class android.support.v17.leanback.widget.GuidedAction
From class android.support.v17.leanback.widget.Action
From class java.lang.Object

Public constructors

GuidedDatePickerAction

GuidedDatePickerAction ()

Public methods

getDate

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

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

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

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

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 saved
  • Subclass may override this method.

    Parameters
    bundle Bundle: Bundle to restore the Action from.
    key String: Key used to restore the Action.

    onSaveInstanceState

    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 saved
  • Subclass may override this method.

    Parameters
    bundle Bundle: Bundle to save the Action.
    key String: Key used to save the Action.

    setDate

    void setDate (long date)

    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.

    Hooray!