BuilderBase
abstract class BuilderBase<B : GuidedAction.BuilderBase<GuidedAction.BuilderBase<*>>!>
kotlin.Any | |
↳ | androidx.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 Builder
.
Summary
Public constructors | |
---|---|
Creates a BuilderBase for GuidedAction or its subclass. |
Public methods | |
---|---|
open B |
autoSaveRestoreEnabled(autoSaveRestoreEnabled: Boolean) Explicitly sets auto restore feature on the GuidedAction. |
open B |
autofillHints(vararg hints: String!) Sets autofill hints. |
open 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. |
open B |
Indicates whether this action is initially checked. |
open B |
clickAction(id: Long) Construct a clickable action with associated id and auto assign pre-defined title for the action. |
open B |
description(description: CharSequence!) Sets the description for this action. |
open B |
description(@StringRes descriptionResourceId: Int) Sets the description for this action. |
open B |
descriptionEditInputType(inputType: Int) Sets |
open B |
descriptionEditable(editable: Boolean) Indicates whether this action's description is editable |
open B |
descriptionInputType(inputType: Int) Sets |
open B |
editDescription(description: CharSequence!) Sets the optional description text to edit. |
open B |
editDescription(@StringRes descriptionResourceId: Int) Sets the optional description text to edit. |
open B |
editInputType(inputType: Int) Sets |
open B |
editTitle(editTitle: CharSequence!) Sets the optional title text to edit. |
open B |
Sets the optional title text to edit. |
open B |
Indicates whether this action title is editable. |
open B |
Indicates whether this action is enabled. |
open B |
Indicates whether this action can take focus. |
open Context! |
Returns Context of this Builder. |
open B |
hasEditableActivatorView(editable: Boolean) Indicates whether this action has a view can be activated to edit, e. |
open B |
Indicates whether this action has a next state and should display a chevron. |
open B |
Sets the action's icon drawable. |
open B |
Sets the action's icon drawable by retrieving it by resource ID from Builder's context. |
open B |
iconResourceId(@DrawableRes iconResourceId: Int, context: Context!) Sets the action's icon drawable by retrieving it by resource ID from the specified context. |
open B |
Sets the ID associated with this action. |
open B |
Indicates whether this action is for information purposes only and cannot be clicked. |
open B |
Sets |
open B |
Sets the intent associated with this action. |
open B |
multilineDescription(multilineDescription: Boolean) Indicates whether the title and description are long, and should be displayed appropriately. |
open B |
subActions(subActions: MutableList<GuidedAction!>!) Sets sub actions list. |
open B |
title(title: CharSequence!) Sets the title for this action. |
open B |
Sets the title for this action. |
Protected methods | |
---|---|
Unit |
applyValues(action: GuidedAction!) Subclass of BuilderBase should call this function to apply values. |
Public constructors
<init>
BuilderBase(context: Context!)
Creates a BuilderBase for GuidedAction or its subclass.
Parameters | |
---|---|
context |
Context!: Context object used to build the GuidedAction. |
Public methods
autoSaveRestoreEnabled
open 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. |
Return | |
---|---|
B |
The same BuilderBase object. |
autofillHints
open fun autofillHints(vararg hints: String!): B
Sets autofill hints. See android.view.View#setAutofillHints
Parameters | |
---|---|
hints |
String!: List of hints for autofill. |
Return | |
---|---|
B |
The same BuilderBase object. |
checkSetId
open 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 GuidedAction#NO_CHECK_SET to indicate not radio or checkbox, or GuidedAction#CHECKBOX_CHECK_SET_ID to indicate a checkbox. |
checked
open fun checked(checked: Boolean): B
Indicates whether this action is initially checked.
Parameters | |
---|---|
checked |
Boolean: Whether this action is checked. |
clickAction
open 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.
Parameters | |
---|---|
id |
Long: 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 . |
Return | |
---|---|
B |
The same BuilderBase object. |
description
open 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
open fun description(@StringRes descriptionResourceId: Int): B
Sets the description for this action. The description is typically a longer string providing extra information on what the action will do.