Android APIs
public class

GuidedAction

extends Action
java.lang.Object
   ↳ android.support.v17.leanback.widget.Action
     ↳ android.support.v17.leanback.widget.GuidedAction

Class Overview

A data class which represents an action within a GuidedStepFragment. GuidedActions contain at minimum a title and a description, and typically also an icon.

A GuidedAction typically represents a single action a user may take, but may also represent a possible choice out of a group of mutually exclusive choices (similar to radio buttons), or an information-only label (in which case the item cannot be clicked).

GuidedActions may optionally be checked. They may also indicate that they will request further user input on selection, in which case they will be displayed with a chevron indicator.

Summary

Nested Classes
class GuidedAction.Builder Builds a GuidedAction object. 
Constants
int DEFAULT_CHECK_SET_ID
int NO_CHECK_SET
int NO_DRAWABLE
Public Methods
int getCheckSetId()
Returns the check set id this action is a part of.
CharSequence getDescription()
Returns the description of this action.
Intent getIntent()
Returns the intent associated with this action.
CharSequence getTitle()
Returns the title of this action.
boolean hasMultilineDescription()
Returns whether this action is has a multiline description.
boolean hasNext()
Returns whether this action will request further user input when selected, such as showing another GuidedStepFragment or launching a new activity.
boolean infoOnly()
Returns whether the action will only display information and is thus not clickable.
boolean isChecked()
Returns whether this action is checked.
boolean isEnabled()
Returns whether this action is enabled.
void setChecked(boolean checked)
Sets whether this action is checked.
void setEnabled(boolean enabled)
Sets whether this action is enabled.
[Expand]
Inherited Methods
From class android.support.v17.leanback.widget.Action
From class java.lang.Object

Constants

public static final int DEFAULT_CHECK_SET_ID

Constant Value: 1 (0x00000001)

public static final int NO_CHECK_SET

Constant Value: 0 (0x00000000)

public static final int NO_DRAWABLE

Constant Value: 0 (0x00000000)

Public Methods

public int getCheckSetId ()

Returns the check set id this action is a part of. All actions in the same list with the same check set id are considered linked. When one of the actions within that set is selected, that action becomes checked, while all the other actions become unchecked.

Returns
  • an integer representing the check set this action is a part of, or NO_CHECK_SET if this action isn't a part of a check set.

public CharSequence getDescription ()

Returns the description of this action.

Returns
  • The description set when this action was built.

public Intent getIntent ()

Returns the intent associated with this action.

Returns
  • The intent set when this action was built.

public CharSequence getTitle ()

Returns the title of this action.

Returns
  • The title set when this action was built.

public boolean hasMultilineDescription ()

Returns whether this action is has a multiline description.

Returns
  • true if the action was constructed as having a multiline description, false otherwise.

public boolean hasNext ()

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

Returns
  • true if the action will request further user input when selected, false otherwise.

public boolean infoOnly ()

Returns whether the action will only display information and is thus not clickable. If both this and hasNext() are true, infoOnly takes precedence. The default is false. For example, this might represent e.g. the amount of storage a document uses, or the cost of an app.

Returns
  • true if will only display information, false otherwise.

public boolean isChecked ()

Returns whether this action is checked.

Returns
  • true if the action is currently checked, false otherwise.

public boolean isEnabled ()

Returns whether this action is enabled.

Returns
  • true if the action is currently enabled, false otherwise.

public void setChecked (boolean checked)

Sets whether this action is checked.

Parameters
checked Whether this action should be checked.

public void setEnabled (boolean enabled)

Sets whether this action is enabled.

Parameters
enabled Whether this action should be enabled.