public
static
abstract
class
GuidedAction.BuilderBase
extends Object
| java.lang.Object | |
| ↳ | android.support.v17.leanback.widget.GuidedAction.BuilderBase<B extends android.support.v17.leanback.widget.GuidedAction.BuilderBase> |
|
|
|
|
Base builder class to build a GuidedAction object. When subclass GuidedAction, you
can override this BuilderBase class, implements your build() method which should call
applyValues(GuidedAction). When using GuidedAction directly, use GuidedAction.Builder.
Public constructors | |
|---|---|
GuidedAction.BuilderBase(Context context)
Creates a BuilderBase for GuidedAction or its subclass. |
|
Public methods | |
|---|---|
B
|
autoSaveRestoreEnabled(boolean autoSaveRestoreEnanbled)
Explicitly sets auto restore feature on the GuidedAction. |
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. |
B
|
checked(boolean checked)
Indicates whether this action is initially checked. |
B
|
clickAction(long id)
Construct a clickable action with associated id and auto assign pre-defined title for the action. |
B
|
description(int descriptionResourceId)
Sets the description for this action. |
B
|
description(CharSequence description)
Sets the description for this action. |
B
|
descriptionEditInputType(int inputType)
Sets |
B
|
descriptionEditable(boolean editable)
Indicates whether this action's description is editable |
B
|
descriptionInputType(int inputType)
Sets |
B
|
editDescription(CharSequence description)
Sets the optional description text to edit. |
B
|
editDescription(int descriptionResourceId)
Sets the optional description text to edit. |
B
|
editInputType(int inputType)
Sets |
B
|
editTitle(CharSequence editTitle)
Sets the optional title text to edit. |
B
|
editTitle(int editTitleResourceId)
Sets the optional title text to edit. |
B
|
editable(boolean editable)
Indicates whether this action title is editable. |
B
|
enabled(boolean enabled)
Indicates whether this action is enabled. |
B
|
focusable(boolean focusable)
Indicates whether this action can take focus. |
Context
|
getContext()
Returns Context of this Builder. |
B
|
hasEditableActivatorView(boolean editable)
Indicates whether this action has a view can be activated to edit, e.g. |
B
|
hasNext(boolean hasNext)
Indicates whether this action has a next state and should display a chevron. |
B
|
icon(Drawable icon)
Sets the action's icon drawable. |
B
|
icon(int iconResourceId)
Sets the action's icon drawable by retrieving it by resource ID from Builder's context. |
B
|
iconResourceId(int iconResourceId, Context context)
This method is deprecated.
Use |
B
|
id(long id)
Sets the ID associated with this action. |
B
|
infoOnly(boolean infoOnly)
Indicates whether this action is for information purposes only and cannot be clicked. |
B
|
inputType(int inputType)
Sets |
B
|
intent(Intent intent)
Sets the intent associated with this action. |
B
|
multilineDescription(boolean multilineDescription)
Indicates whether the title and description are long, and should be displayed appropriately. |
B
|
subActions(List<GuidedAction> subActions)
Sets sub actions list. |
B
|
title(CharSequence title)
Sets the title for this action. |
B
|
title(int titleResourceId)
Sets the title for this action. |
Protected methods | |
|---|---|
final
void
|
applyValues(GuidedAction action)
Subclass of BuilderBase should call this function to apply values. |
Inherited methods | |
|---|---|
java.lang.Object
| |
GuidedAction.BuilderBase (Context context)
Creates a BuilderBase for GuidedAction or its subclass.
| Parameters | |
|---|---|
context |
Context:
Context object used to build the GuidedAction.
|
B autoSaveRestoreEnabled (boolean autoSaveRestoreEnanbled)
Explicitly sets auto restore feature on the GuidedAction. It's by default true.
| Parameters | |
|---|---|
autoSaveRestoreEnanbled |
boolean:
True if turn on auto save/restore of GuidedAction content,
false otherwise. |
| Returns | |
|---|---|
B |
The same BuilderBase object. |
See also:
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 |
int:
The check set ID, or NO_CHECK_SET to indicate not
radio or checkbox, or CHECKBOX_CHECK_SET_ID to indicate a checkbox.
|
| Returns | |
|---|---|
B |
|
B checked (boolean checked)
Indicates whether this action is initially checked.
| Parameters | |
|---|---|
checked |
boolean:
Whether this action is checked.
|
| Returns | |
|---|---|
B |
|
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 |
long:
One of ACTION_ID_OK ACTION_ID_CANCEL
ACTION_ID_FINISH ACTION_ID_CONTINUE
ACTION_ID_YES ACTION_ID_NO. |
| Returns | |
|---|---|
B |
The same BuilderBase object. |
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 |
int:
String resource id of the description for this action.
|
| Returns | |
|---|---|
B |
|
B description (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 |
CharSequence:
The description for this action.
|
| Returns | |
|---|---|
B |
|
B descriptionEditInputType (int inputType)
Sets InputType of this action description in editing.
| Parameters | |
|---|---|
inputType |
int:
InputType for the action description in editing.
|
| Returns | |
|---|---|
B |
|
B descriptionEditable (boolean editable)
Indicates whether this action's description is editable
| Parameters | |
|---|---|
editable |
boolean:
Whether this action description is editable.
|
| Returns | |
|---|---|
B |
|
B descriptionInputType (int inputType)
Sets InputType of this action description not in editing.
| Parameters | |
|---|---|
inputType |
int:
InputType for the action description not in editing.
|
| Returns | |
|---|---|
B |
|
B editDescription (CharSequence description)
Sets the optional description text to edit. When TextView is activated, the edit description replaces the string of description.
| Parameters | |
|---|---|
description |
CharSequence:
The description to edit for this action.
|
| Returns | |
|---|---|
B |
|
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 |
int:
String resource id of the description to edit for this
action.
|
| Returns | |
|---|---|
B |
|
B editInputType (int inputType)
Sets InputType of this action title in editing.
| Parameters | |
|---|---|
inputType |
int:
InputType for the action title in editing.
|
| Returns | |
|---|---|
B |
|
B editTitle (CharSequence editTitle)
Sets the optional title text to edit. When TextView is activated, the edit title replaces the string of title.
| Parameters | |
|---|---|
editTitle |
CharSequence:
The optional title text to edit when TextView is activated.
|
| Returns | |
|---|---|
B |
|
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 |
int:
String resource id of the optional title text to edit when
TextView is activated.
|
| Returns | |
|---|---|
B |
|
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 |
boolean:
Whether this action is editable.
|
| Returns | |
|---|---|
B |
|
B enabled (boolean enabled)
Indicates whether this action is enabled. If not enabled, an action cannot be clicked.
| Parameters | |
|---|---|
enabled |
boolean:
Whether the action is enabled.
|
| Returns | |
|---|---|
B |
|
B focusable (boolean focusable)
Indicates whether this action can take focus.
| Returns | |
|---|---|
B |
The same BuilderBase object. |
Context getContext ()
Returns Context of this Builder.
| Returns | |
|---|---|
Context |
Context of this Builder. |
B hasEditableActivatorView (boolean editable)
Indicates whether this action has a view can be activated to edit, e.g. a DatePicker.
| Parameters | |
|---|---|
editable |
boolean:
Whether this action has view can be activated to edit.
|
| Returns | |
|---|---|
B |
|
B hasNext (boolean hasNext)
Indicates whether this action has a next state and should display a chevron.
| Parameters | |
|---|---|
hasNext |
boolean:
Whether this action has a next state.
|
| Returns | |
|---|---|
B |
|
B icon (Drawable icon)
Sets the action's icon drawable.
| Parameters | |
|---|---|
icon |
Drawable:
The drawable for the icon associated with this action.
|
| Returns | |
|---|---|
B |
|
B icon (int iconResourceId)
Sets the action's icon drawable by retrieving it by resource ID from Builder's
context. This is a convenience function that simply looks up the drawable and calls
icon(Drawable).
| Parameters | |
|---|---|
iconResourceId |
int:
The resource ID for the icon associated with this action.
|
| Returns | |
|---|---|
B |
|
B iconResourceId (int iconResourceId,
Context context)
This method is deprecated.
Use icon(int).
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 |
int:
The resource ID for the icon associated with this action. |
context |
Context:
The context whose resource ID should be retrieved. |
| Returns | |
|---|---|
B |
|
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 |
long:
The ID to associate with this action.
|
| Returns | |
|---|---|
B |
|
B infoOnly (boolean infoOnly)
Indicates whether this action is for information purposes only and cannot be clicked.
| Parameters | |
|---|---|
infoOnly |
boolean:
Whether this action has a next state.
|
| Returns | |
|---|---|
B |
|
B inputType (int inputType)
Sets InputType of this action title not in editing.
| Parameters | |
|---|---|
inputType |
int:
InputType for the action title not in editing.
|
| Returns | |
|---|---|
B |
|
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 |
Intent:
The intent associated with this action.
|
| Returns | |
|---|---|
B |
|
B multilineDescription (boolean multilineDescription)
Indicates whether the title and description are long, and should be displayed appropriately.
| Parameters | |
|---|---|
multilineDescription |
boolean:
Whether this action has a multiline description.
|
| Returns | |
|---|---|
B |
|
B subActions (List<GuidedAction> subActions)
Sets sub actions list.
| Returns | |
|---|---|
B |
The same BuilderBase object. |
B title (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 |
CharSequence:
The title for this action.
|
| Returns | |
|---|---|
B |
|
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 |
int:
The resource id of title for this action.
|
| Returns | |
|---|---|
B |
|
void applyValues (GuidedAction action)
Subclass of BuilderBase should call this function to apply values.
| Parameters | |
|---|---|
action |
GuidedAction:
GuidedAction to apply BuilderBase values.
|