GuidedAction.BuilderBase


abstract class GuidedAction.BuilderBase<B : GuidedAction.BuilderBase?>

Known direct subclasses
GuidedAction.Builder

Builds a GuidedAction object.

GuidedDatePickerAction.BuilderBase

Base Builder class to build GuidedDatePickerAction.

Known indirect subclasses
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 : GuidedAction.BuilderBase?>

the type of BuilderBase

Summary

Public constructors

BuilderBase(context: Context)

Creates a BuilderBase for GuidedAction or its subclass.

Public functions

B!
autoSaveRestoreEnabled(autoSaveRestoreEnabled: Boolean)

Explicitly sets auto restore feature on the GuidedAction.

B!

Sets autofill hints.

B!
checkSetId(checkSetId: Int)

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

B!
checked(checked: Boolean)

Indicates whether this action is initially checked.

B!

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

B!
description(description: CharSequence?)

Sets the description for this action.

B!
description(descriptionResourceId: @StringRes Int)

Sets the description for this action.

B!

Sets InputType of this action description in editing.

B!

Indicates whether this action's description is editable

B!

Sets InputType of this action description not in editing.

B!

Sets the optional description text to edit.

B!
editDescription(descriptionResourceId: @StringRes Int)

Sets the optional description text to edit.

B!
editInputType(inputType: Int)

Sets InputType of this action title in editing.

B!
editTitle(editTitle: CharSequence?)

Sets the optional title text to edit.

B!
editTitle(editTitleResourceId: @StringRes Int)

Sets the optional title text to edit.

B!
editable(editable: Boolean)

Indicates whether this action title is editable.

B!
enabled(enabled: Boolean)

Indicates whether this action is enabled.

B!
focusable(focusable: Boolean)

Indicates whether this action can take focus.

Context

Returns Context of this Builder.

B!

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

B!
hasNext(hasNext: Boolean)

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

B!
icon(icon: Drawable?)

Sets the action's icon drawable.

B!
icon(iconResourceId: @DrawableRes Int)

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

B!
iconResourceId(iconResourceId: @DrawableRes Int, context: Context!)

This function is deprecated.

Use icon.

B!
id(id: Long)

Sets the ID associated with this action.

B!
infoOnly(infoOnly: Boolean)

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

B!
inputType(inputType: Int)

Sets InputType of this action title not in editing.

B!
intent(intent: Intent?)

Sets the intent associated with this action.

B!
multilineDescription(multilineDescription: Boolean)

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

B!

Sets sub actions list.

B!

Sets the title for this action.

B!
title(titleResourceId: @StringRes Int)

Sets the title for this action.

Protected functions

Unit

Subclass of BuilderBase should call this function to apply values.

Public constructors

BuilderBase

Added in 1.1.0
BuilderBase(context: Context)

Creates a BuilderBase for GuidedAction or its subclass.

Parameters
context: Context

Context object used to build the GuidedAction.

Public functions

autoSaveRestoreEnabled

Added in 1.1.0
fun autoSaveRestoreEnabled(autoSaveRestoreEnabled: Boolean): B!

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

Parameters
autoSaveRestoreEnabled: Boolean

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

Returns
B!

The same BuilderBase object.

autofillHints

fun autofillHints(hints: Array<String!>?): B!

Sets autofill hints. See setAutofillHints

Parameters
hints: Array<String!>?

List of hints for autofill.

Returns
B!

The same BuilderBase object.

checkSetId

Added in 1.1.0
fun checkSetId(checkSetId: Int): B!

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.

checked

Added in 1.1.0
fun checked(checked: Boolean): B!

Indicates whether this action is initially checked.

Parameters
checked: Boolean

Whether this action is checked.

clickAction

Added in 1.1.0
fun clickAction(id: Long): B!

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.

Returns
B!

The same BuilderBase object.

description

Added in 1.1.0
fun description(description: CharSequence?): B!

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.

description

Added in 1.1.0
fun description(descriptionResourceId: @StringRes Int): B!

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

Parameters
descriptionResourceId: @StringRes Int

String resource id of the description for this action.

descriptionEditInputType

Added in 1.1.0
fun descriptionEditInputType(inputType: Int): B!

Sets InputType of this action description in editing.

Parameters
inputType: Int

InputType for the action description in editing.

descriptionEditable

Added in 1.1.0
fun descriptionEditable(editable: Boolean): B!

Indicates whether this action's description is editable

Parameters
editable: Boolean

Whether this action description is editable.

descriptionInputType

Added in 1.1.0
fun descriptionInputType(inputType: Int): B!

Sets InputType of this action description not in editing.

Parameters
inputType: Int

InputType for the action description not in editing.

editDescription

Added in 1.1.0
fun editDescription(description: CharSequence?): B!

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.

editDescription

Added in 1.1.0
fun editDescription(descriptionResourceId: @StringRes Int): B!

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

Parameters
descriptionResourceId: @StringRes Int

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

editInputType

Added in 1.1.0
fun editInputType(inputType: Int): B!

Sets InputType of this action title in editing.

Parameters
inputType: Int

InputType for the action title in editing.

editTitle

Added in 1.1.0
fun editTitle(editTitle: CharSequence?): B!

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.

editTitle

Added in 1.1.0
fun editTitle(editTitleResourceId: @StringRes Int): B!

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

Parameters
editTitleResourceId: @StringRes Int

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

editable

Added in 1.1.0
fun editable(editable: Boolean): B!

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.

enabled

Added in 1.1.0
fun enabled(enabled: Boolean): B!

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

Parameters
enabled: Boolean

Whether the action is enabled.

focusable

Added in 1.1.0
fun focusable(focusable: Boolean): B!

Indicates whether this action can take focus.

Parameters
focusable: Boolean
Returns
B!

The same BuilderBase object.

getContext

Added in 1.1.0
fun getContext(): Context

Returns Context of this Builder.

Returns
Context

Context of this Builder.

hasEditableActivatorView

Added in 1.1.0
fun hasEditableActivatorView(editable: Boolean): B!

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.

hasNext

Added in 1.1.0
fun hasNext(hasNext: Boolean): B!

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

Parameters
hasNext: Boolean

Whether this action has a next state.

icon

Added in 1.1.0
fun icon(icon: Drawable?): B!

Sets the action's icon drawable.

Parameters
icon: Drawable?

The drawable for the icon associated with this action.

icon

Added in 1.1.0
fun icon(iconResourceId: @DrawableRes Int): B!

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
iconResourceId: @DrawableRes Int

The resource ID for the icon associated with this action.

iconResourceId

Added in 1.1.0
Deprecated in 1.1.0
fun iconResourceId(iconResourceId: @DrawableRes Int, context: Context!): B!

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
iconResourceId: @DrawableRes Int

The resource ID for the icon associated with this action.

context: Context!

The context whose resource ID should be retrieved.

id

Added in 1.1.0
fun id(id: Long): B!

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.

infoOnly

Added in 1.1.0
fun infoOnly(infoOnly: Boolean): B!

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

Parameters
infoOnly: Boolean

Whether this action has a next state.

inputType

Added in 1.1.0
fun inputType(inputType: Int): B!

Sets InputType of this action title not in editing.

Parameters
inputType: Int

InputType for the action title not in editing.

intent

Added in 1.1.0
fun intent(intent: Intent?): B!

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.

multilineDescription

Added in 1.1.0
fun multilineDescription(multilineDescription: Boolean): B!

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

Parameters
multilineDescription: Boolean

Whether this action has a multiline description.

subActions

Added in 1.1.0
fun subActions(subActions: (Mutable)List<GuidedAction!>?): B!

Sets sub actions list.

Parameters
subActions: (Mutable)List<GuidedAction!>?
Returns
B!

The same BuilderBase object.

title

Added in 1.1.0
fun title(title: CharSequence?): B!

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.

title

Added in 1.1.0
fun title(titleResourceId: @StringRes Int): B!

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: @StringRes Int

The resource id of title for this action.

Protected functions

applyValues

Added in 1.1.0
protected fun applyValues(action: GuidedAction): Unit

Subclass of BuilderBase should call this function to apply values.

Parameters
action: GuidedAction

GuidedAction to apply BuilderBase values.