public class GuidanceStylist
extends Object implements FragmentAnimationProvider
| java.lang.Object | |
| android.support.v17.leanback.widget.GuidanceStylist | |
GuidanceStylist用于 GuidedStepFragment内显示该步骤所需决策的上下文信息。
基础GuidanceStylist的许多方面都可以通过主题进行定制; 请参阅下面的主题属性。 请注意,这些属性不是在布局XML中的单个元素上设置的,而是在自定义主题中设置的。 有关更多信息,请参阅Styles and Themes 。
如果这些钩子不够用,这个类别也可能被分类。 子类可能希望覆盖onProvideLayoutId()方法来更改用于显示指导的布局文件; 还可以通过提供具有额外字段的GuidanceStylist.Guidance的子类来支持更复杂的布局。
注意:如果提供了备用布局,则应使用以下视图ID引用基本元素:
视图ID可以丢失,在这种情况下,相应的视图将为空。
Nested classes |
|
|---|---|
class |
GuidanceStylist.Guidance 表示 |
XML attributes |
|
|---|---|
android.support.v17.leanback:guidanceBreadcrumbStyle |
Theme attribute for the style of the breadcrumb in a GuidanceStylist. |
android.support.v17.leanback:guidanceContainerStyle |
Theme attribute for the style of the main container in a GuidanceStylist. |
android.support.v17.leanback:guidanceDescriptionStyle |
Theme attribute for the style of the description in a GuidanceStylist. |
android.support.v17.leanback:guidanceIconStyle |
Theme attribute for the style of the icon in a GuidanceStylist. |
android.support.v17.leanback:guidanceTitleStyle |
Theme attribute for the style of the title in a GuidanceStylist. |
android.support.v17.leanback:guidedStepImeAppearingAnimation |
Theme attribute for the animation used when a guided step element is animated in response to the IME appearing. |
android.support.v17.leanback:guidedStepImeDisappearingAnimation |
Theme attribute for the animation used when a guided step element is animated in response to the IME disappearing. |
Public constructors |
|
|---|---|
GuidanceStylist() |
|
公共方法(Public methods) |
|
|---|---|
TextView |
getBreadcrumbView() 返回显示指导痕迹的视图。 |
TextView |
getDescriptionView() 返回显示指导描述的视图。 |
ImageView |
getIconView() 返回显示指南图标的视图。 |
TextView |
getTitleView() 返回显示指导标题的视图。 |
View |
onCreateView(LayoutInflater inflater, ViewGroup container, GuidanceStylist.Guidance guidance) 使用提供的inflater和容器为给定Guidance创建适当配置的视图。 |
void |
onDestroyView() 在销毁由GuidanceStylist创建的视图时调用。 |
void |
onImeAppearing(List<Animator> animators) 动画片段响应IME出现。 |
void |
onImeDisappearing(List<Animator> animators) 动画片段以响应IME消失。 |
int |
onProvideLayoutId() 提供定义指导视图的布局的资源ID。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
android.support.v17.leanback.widget.FragmentAnimationProvider
|
|
GuidanceStylist中的面包屑风格的主题属性。 默认是Widget_Leanback_GuidanceBreadcrumbStyle 。
可能是另一种资源的引用,其形式为“ @[+][package:]type/name ”或形式为“一个主题属性 ?[package:]type/name ”。
GuidanceStylist中主容器样式的主题属性。 默认是Widget_Leanback_GuidanceContainerStyle 。
可能是另一种资源的引用,其形式为“ @[+][package:]type/name ”或形式为“一个主题属性 ?[package:]type/name ”。
GuidanceStylist中的说明风格的主题属性。 默认值是Widget_Leanback_GuidanceDescriptionStyle 。
可能是另一种资源的引用,其形式为“ @[+][package:]type/name ”或形式为“一个主题属性 ?[package:]type/name ”。
GuidanceStylist中图标样式的主题属性。 默认为Widget_Leanback_GuidanceIconStyle 。
可能是另一种资源的引用,其形式为“ @[+][package:]type/name ”或形式为“一个主题属性 ?[package:]type/name ”。
GuidanceStylist中标题样式的主题属性。 默认是Widget_Leanback_GuidanceTitleStyle 。
可能是另一种资源的引用,其形式为“ @[+][package:]type/name ”或形式为“一个主题属性 ?[package:]type/name ”。
当引导的步骤元素响应IME出现而动画时使用的动画的主题属性。 默认为lb_guidedstep_slide_up 。
可能是另一种资源的引用,其形式为“ @[+][package:]type/name ”或形式为“一个主题属性 ?[package:]type/name ”。
当导入的步骤元素响应IME消失而动画时使用的动画的主题属性。 默认是lb_guidedstep_slide_down 。
可能是另一种资源的引用,其形式为“ @[+][package:]type/name ”或形式为“一个主题属性 ?[package:]type/name ”。
GuidanceStylist ()
TextView getBreadcrumbView ()
返回显示指导痕迹的视图。
| 返回(Returns) | |
|---|---|
TextView |
The text view object for the breadcrumb. |
TextView getDescriptionView ()
返回显示指导描述的视图。
| 返回(Returns) | |
|---|---|
TextView |
The text view object for the description. |
ImageView getIconView ()
返回显示指南图标的视图。
| 返回(Returns) | |
|---|---|
ImageView |
The image view object for the icon. |
TextView getTitleView ()
返回显示指导标题的视图。
| 返回(Returns) | |
|---|---|
TextView |
The text view object for the title. |
View onCreateView (LayoutInflater inflater, ViewGroup container, GuidanceStylist.Guidance guidance)
使用提供的inflater和容器为给定Guidance创建适当配置的视图。
注意:实际上并没有将创建的视图添加到容器中; 来电者应该这样做。
| 参数(Parameters) | |
|---|---|
inflater |
LayoutInflater: The layout inflater to be used when constructing the view. |
container |
ViewGroup: The view group to be passed in the call to LayoutInflater.inflate. |
guidance |
GuidanceStylist.Guidance: The guidance data for the view. |
| 返回(Returns) | |
|---|---|
View |
The view to be added to the caller's view hierarchy. |
void onDestroyView ()
在销毁由GuidanceStylist创建的视图时调用。
void onImeAppearing (List<Animator> animators)
动画片段响应IME出现。
| 参数(Parameters) | |
|---|---|
animators |
List: A list of animations to which this provider's animations should be added. |
void onImeDisappearing (List<Animator> animators)
动画片段以响应IME消失。
| 参数(Parameters) | |
|---|---|
animators |
List: A list of animations to which this provider's animations should be added. |
int onProvideLayoutId ()
提供定义指导视图的布局的资源ID。 子类可以覆盖以提供他们自己的自定义布局。 基本实现返回lb_guidance 。 如果被覆盖,替换的布局应该包含任何应该由基类管理的视图的匹配ID; 这可以通过从基本布局文件的副本开始来实现。
| 返回(Returns) | |
|---|---|
int |
The resource ID of the layout to be inflated to define the guidance view. |