Android APIs
public static class

GuidedAction.Builder

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

Class Overview

Builds a GuidedAction object.

Summary

Public Constructors
GuidedAction.Builder()
Public Methods
GuidedAction build()
Builds the GuidedAction corresponding to this Builder.
GuidedAction.Builder checkSetId(int checkSetId)
Indicates whether this action is part of a single-select group similar to radio buttons.
GuidedAction.Builder checked(boolean checked)
Indicates whether this action is initially checked.
GuidedAction.Builder description(String description)
Sets the description for this action.
GuidedAction.Builder enabled(boolean enabled)
Indicates whether this action is enabled.
GuidedAction.Builder hasNext(boolean hasNext)
Indicates whether this action has a next state and should display a chevron.
GuidedAction.Builder icon(Drawable icon)
Sets the action's icon drawable.
GuidedAction.Builder iconResourceId(int iconResourceId, Context context)
Sets the action's icon drawable by retrieving it by resource ID from the specified context.
GuidedAction.Builder id(long id)
Sets the ID associated with this action.
GuidedAction.Builder infoOnly(boolean infoOnly)
Indicates whether this action is for information purposes only and cannot be clicked.
GuidedAction.Builder intent(Intent intent)
Sets the intent associated with this action.
GuidedAction.Builder multilineDescription(boolean multilineDescription)
Indicates whether the title and description are long, and should be displayed appropriately.
GuidedAction.Builder title(String title)
Sets the title for this action.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GuidedAction.Builder ()

Public Methods

public GuidedAction build ()

Builds the GuidedAction corresponding to this Builder.

Returns
  • the GuidedAction as configured through this Builder.

public GuidedAction.Builder checkSetId (int checkSetId)

Indicates whether this action is part of a single-select group similar to radio buttons. When one item in a check set is checked, all others with the same check set ID will be unchecked automatically.

Parameters
checkSetId The check set ID, or {@link #NO_CHECK_SET) to indicate no check set.

public GuidedAction.Builder checked (boolean checked)

Indicates whether this action is initially checked.

Parameters
checked Whether this action is checked.

public GuidedAction.Builder description (String description)

Sets the description for this action. The description is typically a longer string providing extra information on what the action will do.

Parameters
description The description for this action.

public GuidedAction.Builder enabled (boolean enabled)

Indicates whether this action is enabled. If not enabled, an action cannot be clicked.

Parameters
enabled Whether the action is enabled.

public GuidedAction.Builder hasNext (boolean hasNext)

Indicates whether this action has a next state and should display a chevron.

Parameters
hasNext Whether this action has a next state.

public GuidedAction.Builder icon (Drawable icon)

Sets the action's icon drawable.

Parameters
icon The drawable for the icon associated with this action.

public GuidedAction.Builder iconResourceId (int iconResourceId, Context context)

Sets the action's icon drawable by retrieving it by resource ID from the specified context. This is a convenience function that simply looks up the drawable and calls icon(Drawable).

Parameters
iconResourceId The resource ID for the icon associated with this action.
context The context whose resource ID should be retrieved.

public GuidedAction.Builder id (long id)

Sets the ID associated with this action. The ID can be any value the client wishes; it is typically used to determine what to do when an action is clicked.

Parameters
id The ID to associate with this action.

public GuidedAction.Builder infoOnly (boolean infoOnly)

Indicates whether this action is for information purposes only and cannot be clicked.

Parameters
infoOnly Whether this action has a next state.

public GuidedAction.Builder intent (Intent intent)

Sets the intent associated with this action. Clients would typically fire this intent directly when the action is clicked.

Parameters
intent The intent associated with this action.

public GuidedAction.Builder multilineDescription (boolean multilineDescription)

Indicates whether the title and description are long, and should be displayed appropriately.

Parameters
multilineDescription Whether this action has a multiline description.

public GuidedAction.Builder title (String title)

Sets the title for this action. The title is typically a short string indicating the action to be taken on click, e.g. "Continue" or "Cancel".

Parameters
title The title for this action.