public abstract class

GuidedAction.BuilderBase<B extends GuidedAction.BuilderBase>

extends java.lang.Object

 java.lang.Object

↳androidx.leanback.widget.GuidedAction.BuilderBase<B>

Subclasses:

GuidedAction.Builder, GuidedDatePickerAction.BuilderBase<B>, GuidedDatePickerAction.Builder

Overview

Base builder class to build a GuidedAction object. When subclass GuidedAction, you can override this BuilderBase class, implements your build() method which should call GuidedAction.BuilderBase.applyValues(GuidedAction). When using GuidedAction directly, use GuidedAction.Builder.

Summary

Constructors
publicBuilderBase(Context context)

Creates a BuilderBase for GuidedAction or its subclass.

Methods
protected final voidapplyValues(GuidedAction action)

Subclass of BuilderBase should call this function to apply values.

public GuidedAction.BuilderBase<B>autofillHints(java.lang.String hints[])

Sets autofill hints.

public GuidedAction.BuilderBase<B>autoSaveRestoreEnabled(boolean autoSaveRestoreEnabled)

Explicitly sets auto restore feature on the GuidedAction.

public GuidedAction.BuilderBase<B>checked(boolean checked)

Indicates whether this action is initially checked.

public GuidedAction.BuilderBase<B>checkSetId(int checkSetId)

Indicates whether this action is part of a single-select group similar to radio buttons or this action is a checkbox.

public GuidedAction.BuilderBase<B>clickAction(long id)

Construct a clickable action with associated id and auto assign pre-defined title for the action.

public GuidedAction.BuilderBase<B>description(java.lang.CharSequence description)

Sets the description for this action.

public GuidedAction.BuilderBase<B>description(int descriptionResourceId)

Sets the description for this action.

public GuidedAction.BuilderBase<B>descriptionEditable(boolean editable)

Indicates whether this action's description is editable

public GuidedAction.BuilderBase<B>descriptionEditInputType(int inputType)

Sets of this action description in editing.

public GuidedAction.BuilderBase<B>descriptionInputType(int inputType)

Sets of this action description not in editing.

public GuidedAction.BuilderBase<B>editable(boolean editable)

Indicates whether this action title is editable.

public GuidedAction.BuilderBase<B>editDescription(java.lang.CharSequence description)

Sets the optional description text to edit.

public GuidedAction.BuilderBase<B>editDescription(int descriptionResourceId)

Sets the optional description text to edit.

public GuidedAction.BuilderBase<B>editInputType(int inputType)

Sets of this action title in editing.

public GuidedAction.BuilderBase<B>editTitle(java.lang.CharSequence editTitle)

Sets the optional title text to edit.

public GuidedAction.BuilderBase<B>editTitle(int editTitleResourceId)

Sets the optional title text to edit.

public GuidedAction.BuilderBase<B>enabled(boolean enabled)

Indicates whether this action is enabled.

public GuidedAction.BuilderBase<B>focusable(boolean focusable)

Indicates whether this action can take focus.

public ContextgetContext()

Returns Context of this Builder.

public GuidedAction.BuilderBase<B>hasEditableActivatorView(boolean editable)

Indicates whether this action has a view can be activated to edit, e.g.

public GuidedAction.BuilderBase<B>hasNext(boolean hasNext)

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

public GuidedAction.BuilderBase<B>icon(Drawable icon)

Sets the action's icon drawable.

public GuidedAction.BuilderBase<B>iconResourceId(int iconResourceId, Context context)

Sets the action's icon drawable by retrieving it by resource ID from the specified context.

public GuidedAction.BuilderBase<B>id(long id)

Sets the ID associated with this action.

public GuidedAction.BuilderBase<B>infoOnly(boolean infoOnly)

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

public GuidedAction.BuilderBase<B>inputType(int inputType)

Sets of this action title not in editing.

public GuidedAction.BuilderBase<B>intent(Intent intent)

Sets the intent associated with this action.

public GuidedAction.BuilderBase<B>multilineDescription(boolean multilineDescription)

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

public GuidedAction.BuilderBase<B>subActions(java.util.List<GuidedAction> subActions)

Sets sub actions list.

public GuidedAction.BuilderBase<B>title(java.lang.CharSequence title)

Sets the title for this action.

public GuidedAction.BuilderBase<B>title(int titleResourceId)

Sets the title for this action.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public BuilderBase(Context context)

Creates a BuilderBase for GuidedAction or its subclass.

Parameters:

context: Context object used to build the GuidedAction.

Methods

public Context getContext()

Returns Context of this Builder.

Returns:

Context of this Builder.

protected final void applyValues(GuidedAction action)

Subclass of BuilderBase should call this function to apply values.

Parameters:

action: GuidedAction to apply BuilderBase values.

public GuidedAction.BuilderBase<B> clickAction(long id)

Construct a clickable action with associated id and auto assign pre-defined title for the action. If the id is not supported, the method simply does nothing.

Parameters:

id: One of GuidedAction.ACTION_ID_OK GuidedAction.ACTION_ID_CANCEL GuidedAction.ACTION_ID_FINISH GuidedAction.ACTION_ID_CONTINUE GuidedAction.ACTION_ID_YES GuidedAction.ACTION_ID_NO.

Returns:

The same BuilderBase object.

public GuidedAction.BuilderBase<B> 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.BuilderBase<B> title(java.lang.CharSequence 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.

public GuidedAction.BuilderBase<B> title(int titleResourceId)

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:

titleResourceId: The resource id of title for this action.

public GuidedAction.BuilderBase<B> editTitle(java.lang.CharSequence editTitle)

Sets the optional title text to edit. When TextView is activated, the edit title replaces the string of title.

Parameters:

editTitle: The optional title text to edit when TextView is activated.

public GuidedAction.BuilderBase<B> editTitle(int editTitleResourceId)

Sets the optional title text to edit. When TextView is activated, the edit title replaces the string of title.

Parameters:

editTitleResourceId: String resource id of the optional title text to edit when TextView is activated.

public GuidedAction.BuilderBase<B> description(java.lang.CharSequence 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.BuilderBase<B> description(int descriptionResourceId)

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

Parameters:

descriptionResourceId: String resource id of the description for this action.

public GuidedAction.BuilderBase<B> editDescription(java.lang.CharSequence description)

Sets the optional description text to edit. When TextView is activated, the edit description replaces the string of description.

Parameters:

description: The description to edit for this action.

public GuidedAction.BuilderBase<B> editDescription(int descriptionResourceId)

Sets the optional description text to edit. When TextView is activated, the edit description replaces the string of description.

Parameters:

descriptionResourceId: String resource id of the description to edit for this action.

public GuidedAction.BuilderBase<B> 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.BuilderBase<B> icon(Drawable icon)

Sets the action's icon drawable.

Parameters:

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

public GuidedAction.BuilderBase<B> iconResourceId(int iconResourceId, Context context)

Deprecated: Use GuidedAction.BuilderBase.

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 GuidedAction.BuilderBase.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.BuilderBase<B> editable(boolean editable)

Indicates whether this action title is editable. Note: Editable actions cannot also be checked, or belong to a check set.

Parameters:

editable: Whether this action is editable.

public GuidedAction.BuilderBase<B> descriptionEditable(boolean editable)

Indicates whether this action's description is editable

Parameters:

editable: Whether this action description is editable.

public GuidedAction.BuilderBase<B> hasEditableActivatorView(boolean editable)

Indicates whether this action has a view can be activated to edit, e.g. a DatePicker.

Parameters:

editable: Whether this action has view can be activated to edit.

public GuidedAction.BuilderBase<B> inputType(int inputType)

Sets of this action title not in editing.

Parameters:

inputType: InputType for the action title not in editing.

public GuidedAction.BuilderBase<B> descriptionInputType(int inputType)

Sets of this action description not in editing.

Parameters:

inputType: InputType for the action description not in editing.

public GuidedAction.BuilderBase<B> editInputType(int inputType)

Sets of this action title in editing.

Parameters:

inputType: InputType for the action title in editing.

public GuidedAction.BuilderBase<B> descriptionEditInputType(int inputType)

Sets of this action description in editing.

Parameters:

inputType: InputType for the action description in editing.

public GuidedAction.BuilderBase<B> checked(boolean checked)

Indicates whether this action is initially checked.

Parameters:

checked: Whether this action is checked.

public GuidedAction.BuilderBase<B> checkSetId(int checkSetId)

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

Parameters:

checkSetId: The check set ID, or GuidedAction.NO_CHECK_SET to indicate not radio or checkbox, or GuidedAction.CHECKBOX_CHECK_SET_ID to indicate a checkbox.

public GuidedAction.BuilderBase<B> 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.BuilderBase<B> 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.BuilderBase<B> 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.BuilderBase<B> 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.BuilderBase<B> focusable(boolean focusable)

Indicates whether this action can take focus.

Parameters:

focusable:

Returns:

The same BuilderBase object.

public GuidedAction.BuilderBase<B> subActions(java.util.List<GuidedAction> subActions)

Sets sub actions list.

Parameters:

subActions:

Returns:

The same BuilderBase object.

public GuidedAction.BuilderBase<B> autoSaveRestoreEnabled(boolean autoSaveRestoreEnabled)

Explicitly sets auto restore feature on the GuidedAction. It's by default true.

Parameters:

autoSaveRestoreEnabled: True if turn on auto save/restore of GuidedAction content, false otherwise.

Returns:

The same BuilderBase object.

See also: GuidedAction.isAutoSaveRestoreEnabled()

public GuidedAction.BuilderBase<B> autofillHints(java.lang.String hints[])

Sets autofill hints. See android.view.View

Parameters:

hints: List of hints for autofill.

Returns:

The same BuilderBase object.