GuidedAction.BuilderBase
public abstract class GuidedAction.BuilderBase<B extends GuidedAction.BuilderBase>
GuidedAction.Builder |
Builds a |
GuidedDatePickerAction.BuilderBase |
Base Builder class to build GuidedDatePickerAction. |
GuidedDatePickerAction.Builder |
Builder class to build a GuidedDatePickerAction. |
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. When using GuidedAction directly, use Builder.
| Parameters | |
|---|---|
<B extends GuidedAction.BuilderBase> |
the type of BuilderBase |
Summary
Public constructors |
|---|
BuilderBase(@NonNull Context context)Creates a BuilderBase for GuidedAction or its subclass. |
Public methods |
|
|---|---|
B |
autoSaveRestoreEnabled(boolean autoSaveRestoreEnabled)Explicitly sets auto restore feature on the GuidedAction. |
B |
autofillHints(@Nullable String[] hints)Sets autofill hints. |
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(@Nullable CharSequence description)Sets the description for this action. |
B |
description(@StringRes int descriptionResourceId)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(@Nullable CharSequence description)Sets the optional description text to edit. |
B |
editDescription(@StringRes int descriptionResourceId)Sets the optional description text to edit. |
B |
editInputType(int inputType)Sets |
B |
editTitle(@Nullable CharSequence editTitle)Sets the optional title text to edit. |
B |
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. |
@NonNull Context |
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 |
Sets the action's icon drawable. |
B |
icon(@DrawableRes int iconResourceId)Sets the action's icon drawable by retrieving it by resource ID from Builder's context. |
B |
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 |
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(@Nullable List<GuidedAction> subActions)Sets sub actions list. |
B |
title(@Nullable CharSequence title)Sets the title for this action. |
B |
Sets the title for this action. |
Protected methods |
|
|---|---|
final void |
applyValues(@NonNull GuidedAction action)Subclass of BuilderBase should call this function to apply values. |
Public constructors
Public methods
autoSaveRestoreEnabled
public B autoSaveRestoreEnabled(boolean autoSaveRestoreEnabled)
Explicitly sets auto restore feature on the GuidedAction. It's by default true.
| Parameters | |
|---|---|
boolean autoSaveRestoreEnabled |
True if turn on auto save/restore of GuidedAction content, false otherwise. |
| Returns | |
|---|---|
B |
The same BuilderBase object. |
| See also | |
|---|---|
isAutoSaveRestoreEnabled |
autofillHints
public B autofillHints(@Nullable String[] hints)
Sets autofill hints. See setAutofillHints
| Parameters | |
|---|---|
@Nullable String[] hints |
List of hints for autofill. |
| Returns | |
|---|---|
B |
The same BuilderBase object. |
checkSetId
public 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 | |
|---|---|
int checkSetId |
The check set ID, or |
checked
public B checked(boolean checked)
Indicates whether this action is initially checked.
| Parameters | |
|---|---|
boolean checked |
Whether this action is checked. |
clickAction
public 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 | |
|---|---|
long id |
One of |
| Returns | |
|---|---|
B |
The same BuilderBase object. |
description
public B description(@Nullable 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 | |
|---|---|
@Nullable CharSequence description |
The description for this action. |
description
public B description(@StringRes 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 | |
|---|---|
@StringRes int descriptionResourceId |
String resource id of the description for this action. |
descriptionEditInputType
public B descriptionEditInputType(int inputType)
Sets InputType of this action description in editing.
| Parameters | |
|---|---|
int inputType |
InputType for the action description in editing. |
descriptionEditable
public B descriptionEditable(boolean editable)
Indicates whether this action's description is editable
| Parameters | |
|---|---|
boolean editable |
Whether this action description is editable. |
descriptionInputType
public B descriptionInputType(int inputType)
Sets InputType of this action description not in editing.
| Parameters | |
|---|---|
int inputType |
InputType for the action description not in editing. |
editDescription
public B editDescription(@Nullable CharSequence description)
Sets the optional description text to edit. When TextView is activated, the edit description replaces the string of description.
| Parameters | |
|---|---|
@Nullable CharSequence description |
The description to edit for this action. |
editDescription
public B editDescription(@StringRes int descriptionResourceId)
Sets the optional description text to edit. When TextView is activated, the edit description replaces the string of description.
| Parameters | |
|---|---|
@StringRes int descriptionResourceId |
String resource id of the description to edit for this action. |
editInputType
public B editInputType(int inputType)
Sets InputType of this action title in editing.
| Parameters | |
|---|---|
int inputType |
InputType for the action title in editing. |
editTitle
public B editTitle(@Nullable CharSequence editTitle)
Sets the optional title text to edit. When TextView is activated, the edit title replaces the string of title.
| Parameters | |
|---|---|
@Nullable CharSequence editTitle |
The optional title text to edit when TextView is activated. |
editTitle
public B editTitle(@StringRes int editTitleResourceId)
Sets the optional title text to edit. When TextView is activated, the edit title replaces the string of title.
| Parameters | |
|---|---|
@StringRes int editTitleResourceId |
String resource id of the optional title text to edit when TextView is activated. |
editable
public 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 | |
|---|---|
boolean editable |
Whether this action is editable. |
enabled
public B enabled(boolean enabled)
Indicates whether this action is enabled. If not enabled, an action cannot be clicked.
| Parameters | |
|---|---|
boolean enabled |
Whether the action is enabled. |
focusable
public B focusable(boolean focusable)
Indicates whether this action can take focus.
| Parameters | |
|---|---|
boolean focusable |
| Returns | |
|---|---|
B |
The same BuilderBase object. |
hasEditableActivatorView
public B hasEditableActivatorView(boolean editable)
Indicates whether this action has a view can be activated to edit, e.g. a DatePicker.
| Parameters | |
|---|---|
boolean editable |
Whether this action has view can be activated to edit. |
hasNext
public B hasNext(boolean hasNext)
Indicates whether this action has a next state and should display a chevron.
| Parameters | |
|---|---|
boolean hasNext |
Whether this action has a next state. |
icon
public B icon(@DrawableRes 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.
| Parameters | |
|---|---|
@DrawableRes int iconResourceId |
The resource ID for the icon associated with this action. |
public BiconResourceId(@DrawableRes 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.
| Parameters | |
|---|---|
@DrawableRes int iconResourceId |
The resource ID for the icon associated with this action. |
Context context |
The context whose resource ID should be retrieved. |
id
public 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 | |
|---|---|
long id |
The ID to associate with this action. |
infoOnly
public B infoOnly(boolean infoOnly)
Indicates whether this action is for information purposes only and cannot be clicked.
| Parameters | |
|---|---|
boolean infoOnly |
Whether this action has a next state. |
inputType
public B inputType(int inputType)
Sets InputType of this action title not in editing.
| Parameters | |
|---|---|
int inputType |
InputType for the action title not in editing. |
intent
public B intent(@Nullable Intent intent)
Sets the intent associated with this action. Clients would typically fire this intent directly when the action is clicked.
multilineDescription
public B multilineDescription(boolean multilineDescription)
Indicates whether the title and description are long, and should be displayed appropriately.
| Parameters | |
|---|---|
boolean multilineDescription |
Whether this action has a multiline description. |
subActions
public B subActions(@Nullable List<GuidedAction> subActions)
Sets sub actions list.
| Parameters | |
|---|---|
@Nullable List<GuidedAction> subActions |
| Returns | |
|---|---|
B |
The same BuilderBase object. |
title
public B title(@Nullable 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 | |
|---|---|
@Nullable CharSequence title |
The title for this action. |
Protected methods
applyValues
protected final void applyValues(@NonNull GuidedAction action)
Subclass of BuilderBase should call this function to apply values.
| Parameters | |
|---|---|
@NonNull GuidedAction action |
GuidedAction to apply BuilderBase values. |