public abstract static class GuidedAction.BuilderBase<B extends GuidedAction.BuilderBase> extends Object
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
.Constructor and Description |
---|
BuilderBase(Context context)
Creates a BuilderBase for GuidedAction or its subclass.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyValues(GuidedAction action)
Subclass of BuilderBase should call this function to apply values.
|
B |
autoSaveRestoreEnabled(boolean autoSaveRestoreEnabled)
Explicitly sets auto restore feature on the GuidedAction.
|
B |
checked(boolean checked)
Indicates whether this action is initially checked.
|
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 |
clickAction(long id)
Construct a clickable action with associated id and auto assign pre-defined title for the
action.
|
B |
description(CharSequence description)
Sets the description for this action.
|
B |
description(int descriptionResourceId)
Sets the description for this action.
|
B |
descriptionEditable(boolean editable)
Indicates whether this action's description is editable
|
B |
descriptionEditInputType(int inputType)
Sets
InputType of this action description in editing. |
B |
descriptionInputType(int inputType)
Sets
InputType of this action description not in editing. |
B |
editable(boolean editable)
Indicates whether this action title is editable.
|
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
InputType of this action title in editing. |
B |
editTitle(CharSequence editTitle)
Sets the optional title text to edit.
|
B |
editTitle(int editTitleResourceId)
Sets the optional title text to edit.
|
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. a DatePicker.
|
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)
Deprecated.
Use
icon(int) . |
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
InputType of this action title not in editing. |
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.
|
public BuilderBase(Context context)
context
- Context object used to build the GuidedAction.public Context getContext()
protected final void applyValues(GuidedAction action)
action
- GuidedAction to apply BuilderBase values.public B clickAction(long id)
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
.public B id(long id)
id
- The ID to associate with this action.public B title(CharSequence title)
title
- The title for this action.public B title(@StringRes int titleResourceId)
titleResourceId
- The resource id of title for this action.public B editTitle(CharSequence editTitle)
editTitle
- The optional title text to edit when TextView is activated.public B editTitle(@StringRes int editTitleResourceId)
editTitleResourceId
- String resource id of the optional title text to edit when
TextView is activated.public B description(CharSequence description)
description
- The description for this action.public B description(@StringRes int descriptionResourceId)
descriptionResourceId
- String resource id of the description for this action.public B editDescription(CharSequence description)
description
- The description to edit for this action.public B editDescription(@StringRes int descriptionResourceId)
descriptionResourceId
- String resource id of the description to edit for this
action.public B intent(Intent intent)
intent
- The intent associated with this action.public B icon(Drawable icon)
icon
- The drawable for the icon associated with this action.@Deprecated public B iconResourceId(@DrawableRes int iconResourceId, Context context)
icon(int)
.icon(Drawable)
.iconResourceId
- The resource ID for the icon associated with this action.context
- The context whose resource ID should be retrieved.public B icon(@DrawableRes int iconResourceId)
icon(Drawable)
.iconResourceId
- The resource ID for the icon associated with this action.public B editable(boolean editable)
editable
- Whether this action is editable.public B descriptionEditable(boolean editable)
editable
- Whether this action description is editable.public B hasEditableActivatorView(boolean editable)
editable
- Whether this action has view can be activated to edit.public B inputType(int inputType)
InputType
of this action title not in editing.inputType
- InputType for the action title not in editing.public B descriptionInputType(int inputType)
InputType
of this action description not in editing.inputType
- InputType for the action description not in editing.public B editInputType(int inputType)
InputType
of this action title in editing.inputType
- InputType for the action title in editing.public B descriptionEditInputType(int inputType)
InputType
of this action description in editing.inputType
- InputType for the action description in editing.public B checked(boolean checked)
checked
- Whether this action is checked.public B checkSetId(int checkSetId)
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 B multilineDescription(boolean multilineDescription)
multilineDescription
- Whether this action has a multiline description.public B hasNext(boolean hasNext)
hasNext
- Whether this action has a next state.public B infoOnly(boolean infoOnly)
infoOnly
- Whether this action has a next state.public B enabled(boolean enabled)
enabled
- Whether the action is enabled.public B focusable(boolean focusable)
focusable
- public B subActions(List<GuidedAction> subActions)
subActions
- public B autoSaveRestoreEnabled(boolean autoSaveRestoreEnabled)
autoSaveRestoreEnabled
- True if turn on auto save/restore of GuidedAction content,
false otherwise.GuidedAction.isAutoSaveRestoreEnabled()