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> | |
| |
| |
基础构建器类构建一个GuidedAction对象。 当子类GuidedAction,你可以重写这个BuilderBase类,实现你的build()方法,该方法应该调用applyValues(GuidedAction) 。 直接使用GuidedAction.Builder ,请使用GuidedAction.Builder 。
Public constructors |
|
|---|---|
GuidedAction.BuilderBase(Context context) 为GuidedAction或其子类创建一个BuilderBase。 |
|
公共方法(Public methods) |
|
|---|---|
B |
autoSaveRestoreEnabled(boolean autoSaveRestoreEnanbled) 在GuidedAction上显式设置自动恢复功能。 |
B |
checkSetId(int checkSetId) 指示此操作是否与单选按钮类似的单选组的一部分,或者此操作是复选框。 |
B |
checked(boolean checked) 指示是否最初检查此操作。 |
B |
clickAction(long id) 使用关联的ID构建可点击的动作并为动作自动分配预定义的标题。 |
B |
description(int descriptionResourceId) 设置此操作的描述。 |
B |
description(CharSequence description) 设置此操作的描述。 |
B |
descriptionEditInputType(int inputType) 在编辑中设置此操作说明的 |
B |
descriptionEditable(boolean editable) 指示此操作的描述是否可编辑 |
B |
descriptionInputType(int inputType) 此操作说明的 |
B |
editDescription(CharSequence description) 设置可选的描述文本进行编辑。 |
B |
editDescription(int descriptionResourceId) 设置可选的描述文本进行编辑。 |
B |
editInputType(int inputType) 在编辑中设置此动作标题的 |
B |
editTitle(CharSequence editTitle) 设置要编辑的可选标题文本。 |
B |
editTitle(int editTitleResourceId) 设置要编辑的可选标题文本。 |
B |
editable(boolean editable) 指示此操作标题是否可编辑。 |
B |
enabled(boolean enabled) 指示是否启用此操作。 |
B |
focusable(boolean focusable) 指示此操作是否可以关注。 |
Context |
getContext() 返回此Builder的上下文。 |
B |
hasEditableActivatorView(boolean editable) 指示此动作是否具有可以被激活以进行编辑的视图,例如 |
B |
hasNext(boolean hasNext) 指示此操作是否具有下一个状态并应显示V形符号。 |
B |
icon(Drawable icon) 设置动作的图标可绘制。 |
B |
icon(int iconResourceId) 通过从Builder的上下文中通过资源ID检索它来设置可绘制的动作图标。 |
B |
iconResourceId(int iconResourceId, Context context) 此方法已弃用。 使用 |
B |
id(long id) 设置与此操作关联的ID。 |
B |
infoOnly(boolean infoOnly) 指示此操作是仅用于信息目的并且不能单击。 |
B |
inputType(int inputType) 此操作标题的 |
B |
intent(Intent intent) 设置与此操作关联的意图。 |
B |
multilineDescription(boolean multilineDescription) 指示标题和描述是否很长,并且应该适当地显示。 |
B |
subActions(List<GuidedAction> subActions) 设置子动作列表。 |
B |
title(CharSequence title) 设置此操作的标题。 |
B |
title(int titleResourceId) 设置此操作的标题。 |
Protected methods |
|
|---|---|
final void |
applyValues(GuidedAction action) BuilderBase的子类应该调用这个函数来应用值。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
GuidedAction.BuilderBase (Context context)
为GuidedAction或其子类创建一个BuilderBase。
| 参数(Parameters) | |
|---|---|
context |
Context: Context object used to build the GuidedAction. |
B autoSaveRestoreEnabled (boolean autoSaveRestoreEnanbled)
在GuidedAction上显式设置自动恢复功能。 这是默认的。
| 参数(Parameters) | |
|---|---|
autoSaveRestoreEnanbled |
boolean: True if turn on auto save/restore of GuidedAction content, false otherwise. |
| 返回(Returns) | |
|---|---|
B |
The same BuilderBase object. |
也可以看看:
B checkSetId (int checkSetId)
指示此操作是否与单选按钮类似的单选组的一部分,或者此操作是复选框。 当检查集中的一个项目被选中时,具有相同检查集标识符的所有其他项将被自动检查。
| 参数(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)
指示是否最初检查此操作。
| 参数(Parameters) | |
|---|---|
checked |
boolean: Whether this action is checked. |
| 返回(Returns) | |
|---|---|
B |
|
B clickAction (long id)
使用关联的ID构建可点击的动作并为动作自动分配预定义的标题。 如果该ID不受支持,则该方法不会执行任何操作。
| 参数(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)
设置此操作的描述。 描述通常是一个较长的字符串,提供有关该操作将执行的额外信息。
| 参数(Parameters) | |
|---|---|
descriptionResourceId |
int: String resource id of the description for this action. |
| 返回(Returns) | |
|---|---|
B |
|
B description (CharSequence description)
设置此操作的描述。 描述通常是一个较长的字符串,提供有关该操作将执行的额外信息。
| 参数(Parameters) | |
|---|---|
description |
CharSequence: The description for this action. |
| 返回(Returns) | |
|---|---|
B |
|
B descriptionEditInputType (int inputType)
在编辑中设置此操作说明的 InputType 。
| 参数(Parameters) | |
|---|---|
inputType |
int: InputType for the action description in editing. |
| 返回(Returns) | |
|---|---|
B |
|
B descriptionEditable (boolean editable)
指示此操作的描述是否可编辑
| 参数(Parameters) | |
|---|---|
editable |
boolean: Whether this action description is editable. |
| 返回(Returns) | |
|---|---|
B |
|
B descriptionInputType (int inputType)
此操作说明的 InputType设置不在编辑中。
| 参数(Parameters) | |
|---|---|
inputType |
int: InputType for the action description not in editing. |
| 返回(Returns) | |
|---|---|
B |
|
B editDescription (CharSequence description)
设置可选的描述文本进行编辑。 当TextView被激活时,编辑描述会替换描述字符串。
| 参数(Parameters) | |
|---|---|
description |
CharSequence: The description to edit for this action. |
| 返回(Returns) | |
|---|---|
B |
|
B editDescription (int descriptionResourceId)
设置可选的描述文本进行编辑。 当TextView被激活时,编辑描述会替换描述字符串。
| 参数(Parameters) | |
|---|---|
descriptionResourceId |
int: String resource id of the description to edit for this action. |
| 返回(Returns) | |
|---|---|
B |
|
B editInputType (int inputType)
在编辑中设置此动作标题的 InputType 。
| 参数(Parameters) | |
|---|---|
inputType |
int: InputType for the action title in editing. |
| 返回(Returns) | |
|---|---|
B |
|
B editTitle (CharSequence editTitle)
设置要编辑的可选标题文本。 当TextView被激活时,编辑标题将替换标题字符串。
| 参数(Parameters) | |
|---|---|
editTitle |
CharSequence: The optional title text to edit when TextView is activated. |
| 返回(Returns) | |
|---|---|
B |
|
B editTitle (int editTitleResourceId)
设置要编辑的可选标题文本。 当TextView被激活时,编辑标题将替换标题字符串。
| 参数(Parameters) | |
|---|---|
editTitleResourceId |
int: String resource id of the optional title text to edit when TextView is activated. |
| 返回(Returns) | |
|---|---|
B |
|
B editable (boolean editable)
指示此操作标题是否可编辑。 注意:可编辑的操作也不能被检查,或属于检查集。
| 参数(Parameters) | |
|---|---|
editable |
boolean: Whether this action is editable. |
| 返回(Returns) | |
|---|---|
B |
|
B enabled (boolean enabled)
指示是否启用此操作。 如果未启用,则无法单击操作。
| 参数(Parameters) | |
|---|---|
enabled |
boolean: Whether the action is enabled. |
| 返回(Returns) | |
|---|---|
B |
|
B focusable (boolean focusable)
指示此操作是否可以关注。
| 返回(Returns) | |
|---|---|
B |
The same BuilderBase object. |
B hasEditableActivatorView (boolean editable)
指示此动作是否具有可以被激活编辑的视图,例如DatePicker。
| 参数(Parameters) | |
|---|---|
editable |
boolean: Whether this action has view can be activated to edit. |
| 返回(Returns) | |
|---|---|
B |
|
B hasNext (boolean hasNext)
指示此操作是否具有下一个状态并应显示V形符号。
| 参数(Parameters) | |
|---|---|
hasNext |
boolean: Whether this action has a next state. |
| 返回(Returns) | |
|---|---|
B |
|
B icon (Drawable icon)
设置动作的图标可绘制。
| 参数(Parameters) | |
|---|---|
icon |
Drawable: The drawable for the icon associated with this action. |
| 返回(Returns) | |
|---|---|
B |
|
B icon (int iconResourceId)
通过从Builder的上下文中通过资源ID检索它来设置可绘制的动作图标。 这是一个方便的功能,只需查找drawable即可调用icon(Drawable) 。
| 参数(Parameters) | |
|---|---|
iconResourceId |
int: The resource ID for the icon associated with this action. |
| 返回(Returns) | |
|---|---|
B |
|
B iconResourceId (int iconResourceId,
Context context)
此方法已弃用。
使用icon(int) 。
通过从指定的上下文中通过资源ID检索它来设置可绘制的操作图标。 这是一个方便的功能,只需查找drawable即可调用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)
设置与此操作关联的ID。 该ID可以是客户希望的任何值; 它通常用于确定单击操作时要执行的操作。
| 参数(Parameters) | |
|---|---|
id |
long: The ID to associate with this action. |
| 返回(Returns) | |
|---|---|
B |
|
B infoOnly (boolean infoOnly)
指示此操作是仅用于信息目的并且不能单击。
| 参数(Parameters) | |
|---|---|
infoOnly |
boolean: Whether this action has a next state. |
| 返回(Returns) | |
|---|---|
B |
|
B inputType (int inputType)
此动作标题的 InputType不在编辑中。
| 参数(Parameters) | |
|---|---|
inputType |
int: InputType for the action title not in editing. |
| 返回(Returns) | |
|---|---|
B |
|
B intent (Intent intent)
设置与此操作关联的意图。 当点击操作时,客户通常会直接触发此意图。
| 参数(Parameters) | |
|---|---|
intent |
Intent: The intent associated with this action. |
| 返回(Returns) | |
|---|---|
B |
|
B multilineDescription (boolean multilineDescription)
指示标题和描述是否很长,并且应该适当地显示。
| 参数(Parameters) | |
|---|---|
multilineDescription |
boolean: Whether this action has a multiline description. |
| 返回(Returns) | |
|---|---|
B |
|
B subActions (List<GuidedAction> subActions)
设置子动作列表。
| 返回(Returns) | |
|---|---|
B |
The same BuilderBase object. |
B title (CharSequence title)
设置此操作的标题。 标题通常是一个简短的字符串,指示点击时采取的操作,例如“继续”或“取消”。
| 参数(Parameters) | |
|---|---|
title |
CharSequence: The title for this action. |
| 返回(Returns) | |
|---|---|
B |
|
B title (int titleResourceId)
设置此操作的标题。 标题通常是一个简短的字符串,指示点击时采取的操作,例如“继续”或“取消”。
| 参数(Parameters) | |
|---|---|
titleResourceId |
int: The resource id of title for this action. |
| 返回(Returns) | |
|---|---|
B |
|
void applyValues (GuidedAction action)
BuilderBase的子类应该调用这个函数来应用值。
| 参数(Parameters) | |
|---|---|
action |
GuidedAction: GuidedAction to apply BuilderBase values. |