added in version 22.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1

GuidedActionsStylist

public class GuidedActionsStylist
extends Object implements FragmentAnimationProvider

java.lang.Object
   ↳ android.support.v17.leanback.widget.GuidedActionsStylist


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. GuidedActionsStylist has two different layouts: default is for normal actions including text, radio, checkbox, DatePicker, etc, the other when setAsButtonActions() is called is recommended for button actions such as "yes", "no".

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; override onProvideItemLayoutId(int) and getItemViewType(GuidedAction) method to change the layout used to display each action.

To support a "click to activate" view similar to DatePicker, app needs:

  • Override onProvideItemLayoutId(int) and getItemViewType(GuidedAction), provides a layout id for the action.
  • The layout must include a widget with id "guidedactions_activator_item", the widget is toggled edit mode by setActivated(boolean).
  • Override onBindActivatorView(ViewHolder, GuidedAction) to populate values into View.
  • Override onUpdateActivatorView(ViewHolder, GuidedAction) to update 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.

    In order to support editable actions, the view associated with guidedactions_item_title should be a subclass of EditText, and should satisfy the ImeKeyMonitor interface.

    Summary

    Nested classes

    class GuidedActionsStylist.ViewHolder

    ViewHolder caches information about the action item layouts' subviews. 

    XML attributes

    LeanbackGuidedStepTheme_guidedActionDescriptionMinLines  
    LeanbackGuidedStepTheme_guidedActionDisabledChevronAlpha  
    LeanbackGuidedStepTheme_guidedActionEnabledChevronAlpha  
    LeanbackGuidedStepTheme_guidedActionItemCheckmarkStyle  
    LeanbackGuidedStepTheme_guidedActionItemChevronStyle  
    LeanbackGuidedStepTheme_guidedActionItemContainerStyle  
    LeanbackGuidedStepTheme_guidedActionItemContentStyle  
    LeanbackGuidedStepTheme_guidedActionItemDescriptionStyle  
    LeanbackGuidedStepTheme_guidedActionItemIconStyle  
    LeanbackGuidedStepTheme_guidedActionItemTitleStyle  
    LeanbackGuidedStepTheme_guidedActionPressedAnimation