Android APIs
public class

GuidedActionsStylist

extends Object
implements FragmentAnimationProvider
java.lang.Object
   ↳ android.support.v17.leanback.widget.GuidedActionsStylist

Class Overview

GuidedActionsStylist is used within a GuidedStepFragment to supply the right-side panel where users can take actions. It consists of a container for the list of actions, and a stationary selector view that indicates visually the location of focus.

Many aspects of the base GuidedActionsStylist can be customized through theming; see the theme attributes below. Note that these attributes are not set on individual elements in layout XML, but instead would be set in a custom theme. See Styles and Themes for more information.

If these hooks are insufficient, this class may also be subclassed. Subclasses may wish to override the onProvideLayoutId() method to change the layout used to display the list container and selector, or the onProvideItemLayoutId() method to change the layout used to display each action.

Note: If an alternate list layout is provided, the following view IDs must be supplied:

These view IDs must be present in order for the stylist to function. The list ID must correspond to a VerticalGridView or subclass.

If an alternate item layout is provided, the following view IDs should be used to refer to base elements:

These view IDs are allowed to be missing, in which case the corresponding views in GuidedActionsStylist.ViewHolder will be null.

Summary

Nested Classes
class GuidedActionsStylist.ViewHolder ViewHolder caches information about the action item layouts' subviews. 
XML Attributes
Attribute Name Related Method Description
android.support.v17.leanback:guidedActionCheckedAnimation Theme attribute for the animation used in a GuidedActionsPresenter when an action is checked. 
android.support.v17.leanback:guidedActionContentWidth Theme attribute used in a GuidedActionsPresenter for the width of the text area of a single action when there is an icon present. 
android.support.v17.leanback:guidedActionContentWidthNoIcon Theme attribute used in a GuidedActionsPresenter for the width of the text area of a single action when there is no icon present. 
android.support.v17.leanback:guidedActionDescriptionMinLines Theme attribute used in a GuidedActionsPresenter for the max lines of the title text view when the action's isMultilineDescription is set to false. 
android.support.v17.leanback:guidedActionDisabledChevronAlpha Theme attribute used in a GuidedActionsPresenter for the alpha value of the chevron decoration when its action is disabled. 
android.support.v17.leanback:guidedActionEnabledChevronAlpha Theme attribute used in a GuidedActionsPresenter for the alpha value of the chevron decoration when its action is enabled. 
android.support.v17.leanback:guidedActionItemCheckmarkStyle Theme attribute for the style of an action's checkmark in a GuidedActionsPresenter. 
android.support.v17.leanback:guidedActionItemChevronStyle Theme attribute for the style of an action's chevron decoration in a GuidedActionsPresenter. 
android.support.v17.leanback:guidedActionItemContainerStyle Theme attribute for the style of the container of a single action in a GuidedActionsPresenter. 
android.support.v17.leanback:guidedActionItemContentStyle Theme attribute for the style of an action's content in a GuidedActionsPresenter. 
android.support.v17.leanback:guidedActionItemDescriptionStyle Theme attribute for the style of an action's description in a GuidedActionsPresenter. 
android.support.v17.leanback:guidedActionItemIconStyle Theme attribute for the style of an action's icon in a GuidedActionsPresenter. 
android.support.v17.leanback:guidedActionItemTitleStyle Theme attribute for the style of an action's title in a GuidedActionsPresenter. 
android.support.v17.leanback:guidedActionPressedAnimation Theme attribute for the animation used in a GuidedActionsPresenter when an action is pressed. 
android.support.v17.leanback:guidedActionTitleMaxLines Theme attribute used in a GuidedActionsPresenter for the max lines of the title text view when the action's isMultilineDescription is set to true. 
android.support.v17.leanback:guidedActionTitleMinLines Theme attribute used in a GuidedActionsPresenter for the max lines of the title text view when the action's isMultilineDescription is set to false. 
android.support.v17.leanback:guidedActionUncheckedAnimation Theme attribute for the animation used in a GuidedActionsPresenter when an action is unchecked. 
android.support.v17.leanback:guidedActionUnpressedAnimation Theme attribute for the animation used in a GuidedActionsPresenter when an action is unpressed. 
android.support.v17.leanback:guidedActionVerticalPadding Theme attribute used in a GuidedActionsPresenter for the vertical padding between action views in the list. 
android.support.v17.leanback:guidedActionsContainerStyle Theme attribute for the style of the container in a GuidedActionsPresenter. 
android.support.v17.leanback:guidedActionsEntryAnimation Theme attribute for the animation used in a GuidedActionsPresenter when the actions list is animated in at activity start. 
android.support.v17.leanback:guidedActionsListStyle Theme attribute for the style of the list in a GuidedActionsPresenter. 
android.support.v17.leanback:guidedActionsSelectorHideAnimation Theme attribute for the animation used in a GuidedActionsPresenter when the action selector is animated in at activity start. 
android.support.v17.leanback:guidedActionsSelectorShowAnimation Theme attribute for the animation used in a GuidedActionsPresenter when the action selector is animated in at activity start. 
android.support.v17.leanback:guidedActionsSelectorStyle Theme attribute for the style of the item selector in a GuidedActionsPresenter. 
Fields
protected VerticalGridView mActionsGridView
protected View mMainView
protected View mSelectorView
Public Constructors
GuidedActionsStylist()
Public Methods
VerticalGridView getActionsGridView()
Returns the VerticalGridView that displays the list of GuidedActions.
void onActivityEnter(List<Animator> animators)
Animates the entry of the fragment in the case where the activity is first being presented.
void onActivityExit(List<Animator> animators)
Animates the exit of the fragment in the case where the activity is about to pause.
void onAnimateItemChecked(GuidedActionsStylist.ViewHolder vh, boolean checked)
Animates the view holder's view (or subviews thereof) when the action has had its check state changed.
void onAnimateItemFocused(GuidedActionsStylist.ViewHolder vh, boolean focused)
Animates the view holder's view (or subviews thereof) when the action has had its focus state changed.
void onAnimateItemPressed(GuidedActionsStylist.ViewHolder vh, boolean pressed)
Animates the view holder's view (or subviews thereof) when the action has had its press state changed.
void onBindViewHolder(GuidedActionsStylist.ViewHolder vh, GuidedAction action)
View onCreateView(LayoutInflater inflater, ViewGroup container)
Creates a view appropriate for displaying a list of GuidedActions, using the provided inflater and container.
GuidedActionsStylist.ViewHolder onCreateViewHolder(ViewGroup parent)
Constructs a GuidedActionsStylist.ViewHolder capable of representing GuidedActions.
void onFragmentEnter(List<Animator> animators)
Animates the entry of the fragment in the case where there is a previous step fragment participating in the animation.
void onFragmentExit(List<Animator> animators)
Animates the exit of the fragment in the case where there is a previous step fragment participating in the animation.
void onFragmentReenter(List<Animator> animators)
Animates the re-entry of the fragment in the case where there is a previous step fragment participating in the animation.
void onFragmentReturn(List<Animator> animators)
Animates the return of the fragment in the case where there is a previous step fragment participating in the animation.
int onProvideItemLayoutId()
Provides the resource ID of the layout defining the view for an individual guided actions.
int onProvideLayoutId()
Provides the resource ID of the layout defining the host view for the list of guided actions.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.support.v17.leanback.widget.FragmentAnimationProvider

XML Attributes

android.support.v17.leanback:guidedActionCheckedAnimation

Theme attribute for the animation used in a GuidedActionsPresenter when an action is checked. Default is lb_guidedactions_item_checked.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionContentWidth

Theme attribute used in a GuidedActionsPresenter for the width of the text area of a single action when there is an icon present. Default is lb_guidedactions_item_text_width.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionContentWidthNoIcon

Theme attribute used in a GuidedActionsPresenter for the width of the text area of a single action when there is no icon present. Default is lb_guidedactions_item_text_width_no_icon.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionDescriptionMinLines

Theme attribute used in a GuidedActionsPresenter for the max lines of the title text view when the action's isMultilineDescription is set to false. Default is lb_guidedactions_item_description_min_lines.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionDisabledChevronAlpha

Theme attribute used in a GuidedActionsPresenter for the alpha value of the chevron decoration when its action is disabled. Default is lb_guidedactions_item_disabled_chevron_alpha.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionEnabledChevronAlpha

Theme attribute used in a GuidedActionsPresenter for the alpha value of the chevron decoration when its action is enabled. Default is lb_guidedactions_item_enabled_chevron_alpha.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionItemCheckmarkStyle

Theme attribute for the style of an action's checkmark in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedActionItemCheckmarkStyle.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionItemChevronStyle

Theme attribute for the style of an action's chevron decoration in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedActionItemChevronStyle.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionItemContainerStyle

Theme attribute for the style of the container of a single action in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedActionItemContainerStyle.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionItemContentStyle

Theme attribute for the style of an action's content in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedActionItemContentStyle.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionItemDescriptionStyle

Theme attribute for the style of an action's description in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedActionItemDescriptionStyle.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionItemIconStyle

Theme attribute for the style of an action's icon in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedActionItemIconStyle.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionItemTitleStyle

Theme attribute for the style of an action's title in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedActionItemTitleStyle.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionPressedAnimation

Theme attribute for the animation used in a GuidedActionsPresenter when an action is pressed. Default is lb_guidedactions_item_pressed.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionTitleMaxLines

Theme attribute used in a GuidedActionsPresenter for the max lines of the title text view when the action's isMultilineDescription is set to true. Default is lb_guidedactions_item_title_max_lines.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionTitleMinLines

Theme attribute used in a GuidedActionsPresenter for the max lines of the title text view when the action's isMultilineDescription is set to false. Default is lb_guidedactions_item_title_min_lines.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionUncheckedAnimation

Theme attribute for the animation used in a GuidedActionsPresenter when an action is unchecked. Default is lb_guidedactions_item_unchecked.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionUnpressedAnimation

Theme attribute for the animation used in a GuidedActionsPresenter when an action is unpressed. Default is lb_guidedactions_item_unpressed.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionVerticalPadding

Theme attribute used in a GuidedActionsPresenter for the vertical padding between action views in the list. Default is lb_guidedactions_vertical_padding.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionsContainerStyle

Theme attribute for the style of the container in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedActionsContainerStyle.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionsEntryAnimation

Theme attribute for the animation used in a GuidedActionsPresenter when the actions list is animated in at activity start. Default is lb_guidedactions_entry.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionsListStyle

Theme attribute for the style of the list in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedActionsListStyle.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionsSelectorHideAnimation

Theme attribute for the animation used in a GuidedActionsPresenter when the action selector is animated in at activity start. Default is lb_guidedactions_selector_hide.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionsSelectorShowAnimation

Theme attribute for the animation used in a GuidedActionsPresenter when the action selector is animated in at activity start. Default is lb_guidedactions_selector_show.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

android.support.v17.leanback:guidedActionsSelectorStyle

Theme attribute for the style of the item selector in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedActionsSelectorStyle.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This is a private symbol.

Related Methods

Fields

protected VerticalGridView mActionsGridView

protected View mMainView

protected View mSelectorView

Public Constructors

public GuidedActionsStylist ()

Public Methods

public VerticalGridView getActionsGridView ()

Returns the VerticalGridView that displays the list of GuidedActions.

Returns
  • The VerticalGridView for this presenter.

public void onActivityEnter (List<Animator> animators)

Animates the entry of the fragment in the case where the activity is first being presented.

Parameters
animators A list of animations to which this provider's animations should be added.

public void onActivityExit (List<Animator> animators)

Animates the exit of the fragment in the case where the activity is about to pause.

Parameters
animators A list of animations to which this provider's animations should be added.

public void onAnimateItemChecked (GuidedActionsStylist.ViewHolder vh, boolean checked)

Animates the view holder's view (or subviews thereof) when the action has had its check state changed.

Parameters
vh The view holder associated with the relevant action.
checked True if the action has become checked, false if it has become unchecked.

public void onAnimateItemFocused (GuidedActionsStylist.ViewHolder vh, boolean focused)

Animates the view holder's view (or subviews thereof) when the action has had its focus state changed.

Parameters
vh The view holder associated with the relevant action.
focused True if the action has become focused, false if it has lost focus.

public void onAnimateItemPressed (GuidedActionsStylist.ViewHolder vh, boolean pressed)

Animates the view holder's view (or subviews thereof) when the action has had its press state changed.

Parameters
vh The view holder associated with the relevant action.
pressed True if the action has been pressed, false if it has been unpressed.

public void onBindViewHolder (GuidedActionsStylist.ViewHolder vh, GuidedAction action)

Parameters
vh The view holder to be associated with the given action.
action The guided action to be displayed by the view holder's view.
Returns
  • The view to be added to the caller's view hierarchy.

public View onCreateView (LayoutInflater inflater, ViewGroup container)

Creates a view appropriate for displaying a list of GuidedActions, using the provided inflater and container.

Note: Does not actually add the created view to the container; the caller should do this.

Parameters
inflater The layout inflater to be used when constructing the view.
container The view group to be passed in the call to LayoutInflater.inflate.
Returns
  • The view to be added to the caller's view hierarchy.

public GuidedActionsStylist.ViewHolder onCreateViewHolder (ViewGroup parent)

Constructs a GuidedActionsStylist.ViewHolder capable of representing GuidedActions. Subclasses may choose to return a subclass of ViewHolder.

Note: Should not actually add the created view to the parent; the caller will do this.

Parameters
parent The view group to be used as the parent of the new view.
Returns
  • The view to be added to the caller's view hierarchy.

public void onFragmentEnter (List<Animator> animators)

Animates the entry of the fragment in the case where there is a previous step fragment participating in the animation. Entry occurs when the fragment is preparing to be shown as it is pushed onto the back stack.

Parameters
animators A list of animations to which this provider's animations should be added.

public void onFragmentExit (List<Animator> animators)

Animates the exit of the fragment in the case where there is a previous step fragment participating in the animation. Exit occurs when the fragment is preparing to be removed, hidden, or detached due to pushing another fragment onto the back stack.

Parameters
animators A list of animations to which this provider's animations should be added.

public void onFragmentReenter (List<Animator> animators)

Animates the re-entry of the fragment in the case where there is a previous step fragment participating in the animation. Re-entry occurs when the fragment is preparing to be shown due to popping the back stack.

Parameters
animators A list of animations to which this provider's animations should be added.

public void onFragmentReturn (List<Animator> animators)

Animates the return of the fragment in the case where there is a previous step fragment participating in the animation. Return occurs when the fragment is preparing to be removed, hidden, or detached due to popping the back stack.

Parameters
animators A list of animations to which this provider's animations should be added.

public int onProvideItemLayoutId ()

Provides the resource ID of the layout defining the view for an individual guided actions. Subclasses may override to provide their own customized layouts. The base implementation returns lb_guidedactions_item. If overridden, the substituted layout should contain matching IDs for any views that should be managed by the base class; this can be achieved by starting with a copy of the base layout file.

Returns
  • The resource ID of the layout to be inflated to define the view to display an individual GuidedAction.

public int onProvideLayoutId ()

Provides the resource ID of the layout defining the host view for the list of guided actions. Subclasses may override to provide their own customized layouts. The base implementation returns lb_guidedactions. If overridden, the substituted layout should contain matching IDs for any views that should be managed by the base class; this can be achieved by starting with a copy of the base layout file.

Returns
  • The resource ID of the layout to be inflated to define the host view for the list of GuidedActions.