Skip to content

Most visited

Recently visited

navigation

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.

    See also:

    Summary

    Nested classes

    class GuidedActionsStylist.ViewHolder

    ViewHolder caches information about the action item layouts' subviews. 

    XML attributes

    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: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:guidedActionsListStyle Theme attribute for the style of the list in a GuidedActionsPresenter. 
    android.support.v17.leanback:guidedActionsSelectorDrawable Theme attribute for the style of the item selector in a GuidedActionsPresenter. 
    android.support.v17.leanback:guidedButtonActionsListStyle Theme attribute for the style of the list in a GuidedActionsPresenter. 
    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. 
    android.support.v17.leanback:guidedSubActionsListStyle Theme attribute for the style of the sub actions list in a GuidedActionsPresenter. 

    Constants

    int VIEW_TYPE_DATE_PICKER

    ViewType for DatePicker.

    int VIEW_TYPE_DEFAULT

    Default viewType that associated with default layout Id for the action item.

    Public constructors

    GuidedActionsStylist()

    Public methods

    void collapseAction(boolean withTransition)

    Collapse expanded action.

    void expandAction(GuidedAction action, boolean withTransition)

    Expand an action.

    VerticalGridView getActionsGridView()

    Returns the VerticalGridView that displays the list of GuidedActions.

    GuidedAction getExpandedAction()
    int getItemViewType(GuidedAction action)

    Return view type of action, each different type can have differently associated layout Id.

    VerticalGridView getSubActionsGridView()

    Returns the VerticalGridView that displays the sub actions list of an expanded action.

    final boolean isBackKeyToCollapseActivatorView()
    final boolean isBackKeyToCollapseSubActions()
    boolean isButtonActions()

    Returns true if it is button actions list, false for normal actions list.

    boolean isExpandTransitionSupported()

    Returns if expand/collapse animation is supported.

    boolean isExpanded()
    boolean isInExpandTransition()

    Returns true if it is running an expanding or collapsing transition, false otherwise.

    boolean isSubActionsExpanded()
    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 onAnimateItemPressedCancelled(GuidedActionsStylist.ViewHolder vh)

    Resets the view holder's view to unpressed state.

    void onBindActivatorView(GuidedActionsStylist.ViewHolder vh, GuidedAction action)

    Performs binding activator view value to action.

    void onBindCheckMarkView(GuidedActionsStylist.ViewHolder vh, GuidedAction action)

    Sets states of check mark view, called by onBindViewHolder(ViewHolder, GuidedAction) when action's checkset Id is other than NO_CHECK_SET.

    void onBindChevronView(GuidedActionsStylist.ViewHolder vh, GuidedAction action)

    Sets states of chevron view, called by onBindViewHolder(ViewHolder, GuidedAction).

    void onBindViewHolder(GuidedActionsStylist.ViewHolder vh, GuidedAction action)

    Binds a GuidedActionsStylist.ViewHolder to a particular GuidedAction.

    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, int viewType)

    Constructs a GuidedActionsStylist.ViewHolder capable of representing GuidedActions.

    GuidedActionsStylist.ViewHolder onCreateViewHolder(ViewGroup parent)

    Constructs a GuidedActionsStylist.ViewHolder capable of representing GuidedActions.

    void onDestroyView()

    Called when destroy the View created by GuidedActionsStylist.

    void onImeAppearing(List<Animator> animators)

    Animates the fragment in response to the IME appearing.

    void onImeDisappearing(List<Animator> animators)

    Animates the fragment in response to the IME disappearing.

    int onProvideItemLayoutId()

    Provides the resource ID of the layout defining the view for an individual guided actions.

    int onProvideItemLayoutId(int viewType)

    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.

    boolean onUpdateActivatorView(GuidedActionsStylist.ViewHolder vh, GuidedAction action)

    Performs updating GuidedAction from activator view.

    void onUpdateExpandedViewHolder(GuidedActionsStylist.ViewHolder avh)

    Expand or collapse GuidedActionStylist.

    void openInEditMode(GuidedAction action)

    Switches action to edit mode and pops up the keyboard.

    void setAsButtonActions()

    Choose the layout resource for button actions in onProvideLayoutId().

    final void setBackKeyToCollapseActivatorView(boolean backToCollapse)

    Enable or disable using BACK key to collapse GuidedAction with editable activator view.

    final void setBackKeyToCollapseSubActions(boolean backToCollapse)

    Enable or disable using BACK key to collapse sub actions list.

    void setEditingMode(GuidedActionsStylist.ViewHolder vh, GuidedAction action, boolean editing)

    This method was deprecated in API level 25.1.0. This method is for internal library use only and should not be called directly.

    void setExpandedViewHolder(GuidedActionsStylist.ViewHolder avh)

    This method was deprecated in API level 25.1.0. use expandAction(GuidedAction, boolean) and collapseAction(boolean)

    void startExpandedTransition(GuidedActionsStylist.ViewHolder avh)

    This method was deprecated in API level 25.1.0. use expandAction(GuidedAction, boolean) and collapseAction(boolean)

    Protected methods

    void onEditingModeChange(GuidedActionsStylist.ViewHolder vh, GuidedAction action, boolean editing)

    This method was deprecated in API level 25.1.0. Use onEditingModeChange(ViewHolder, boolean, boolean).

    void onEditingModeChange(GuidedActionsStylist.ViewHolder vh, boolean editing, boolean withTransition)

    Called when editing mode of an ViewHolder is changed.

    void setupImeOptions(GuidedActionsStylist.ViewHolder vh, GuidedAction action)

    Called by onBindViewHolder(ViewHolder, GuidedAction) to setup IME options.

    Inherited methods

    From class java.lang.Object
    From interface android.support.v17.leanback.widget.FragmentAnimationProvider

    XML attributes

    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.

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

    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.

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

    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.

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

    android.support.v17.leanback:guidedActionItemCheckmarkStyle

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

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

    android.support.v17.leanback:guidedActionItemChevronStyle

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

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

    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.

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

    android.support.v17.leanback:guidedActionItemContentStyle

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

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

    android.support.v17.leanback:guidedActionItemDescriptionStyle

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

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

    android.support.v17.leanback:guidedActionItemIconStyle

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

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

    android.support.v17.leanback:guidedActionItemTitleStyle

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

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

    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.

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

    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.

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

    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.

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

    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.

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

    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.

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

    android.support.v17.leanback:guidedActionsListStyle

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

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

    android.support.v17.leanback:guidedActionsSelectorDrawable

    Theme attribute for the style of the item selector in a GuidedActionsPresenter. Default is ?android:attr/selectableItemBackground.

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

    android.support.v17.leanback:guidedButtonActionsListStyle

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

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

    android.support.v17.leanback:guidedStepImeAppearingAnimation

    Theme attribute for the animation used when a guided step element is animated in response to the IME appearing. Default is lb_guidedstep_slide_up.

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

    android.support.v17.leanback:guidedStepImeDisappearingAnimation

    Theme attribute for the animation used when a guided step element is animated in response to the IME disappearing. Default is lb_guidedstep_slide_down.

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

    android.support.v17.leanback:guidedSubActionsListStyle

    Theme attribute for the style of the sub actions list in a GuidedActionsPresenter. Default is Widget_Leanback_GuidedSubActionsListStyle.

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

    Constants

    VIEW_TYPE_DATE_PICKER

    added in version 23.2.0
    int VIEW_TYPE_DATE_PICKER

    ViewType for DatePicker.

    Constant Value: 1 (0x00000001)

    VIEW_TYPE_DEFAULT

    added in version 23.2.0
    int VIEW_TYPE_DEFAULT

    Default viewType that associated with default layout Id for the action item.

    Constant Value: 0 (0x00000000)

    Public constructors

    GuidedActionsStylist

    added in version 22.1.0
    GuidedActionsStylist ()

    Public methods

    collapseAction

    added in version 25.1.0
    void collapseAction (boolean withTransition)

    Collapse expanded action. Do nothing if it is in animation or there is no action expanded.

    Parameters
    withTransition boolean: True to run transition animation, false otherwsie.

    expandAction

    added in version 25.1.0
    void expandAction (GuidedAction action, 
                    boolean withTransition)

    Expand an action. Do nothing if it is in animation or there is action expanded.

    Parameters
    action GuidedAction: Action to expand.

    withTransition boolean: True to run transition animation, false otherwsie.

    getActionsGridView

    added in version 22.1.0
    VerticalGridView getActionsGridView ()

    Returns the VerticalGridView that displays the list of GuidedActions.

    Returns
    VerticalGridView The VerticalGridView for this presenter.

    getExpandedAction

    added in version 23.2.0
    GuidedAction getExpandedAction ()

    Returns
    GuidedAction Current expanded GuidedAction or null if not expanded.

    getItemViewType

    added in version 23.2.0
    int getItemViewType (GuidedAction action)

    Return view type of action, each different type can have differently associated layout Id. Default implementation returns VIEW_TYPE_DEFAULT.

    Parameters
    action GuidedAction: The action object.

    Returns
    int View type that used in onProvideItemLayoutId(int).

    getSubActionsGridView

    added in version 23.2.0
    VerticalGridView getSubActionsGridView ()

    Returns the VerticalGridView that displays the sub actions list of an expanded action.

    Returns
    VerticalGridView The VerticalGridView that displays the sub actions list of an expanded action.

    isBackKeyToCollapseActivatorView

    added in version 25.1.0
    boolean isBackKeyToCollapseActivatorView ()

    Returns
    boolean True if using BACK key to collapse GuidedAction with editable activator view, false otherwise. Default value is true.

    isBackKeyToCollapseSubActions

    added in version 25.1.0
    boolean isBackKeyToCollapseSubActions ()

    Returns
    boolean True if using BACK key to collapse sub actions list, false otherwise. Default value is true.

    isButtonActions

    added in version 23.2.0
    boolean isButtonActions ()

    Returns true if it is button actions list, false for normal actions list.

    Returns
    boolean True if it is button actions list, false for normal actions list.

    isExpandTransitionSupported

    added in version 23.2.0
    boolean isExpandTransitionSupported ()

    Returns if expand/collapse animation is supported. When this method returns true, startExpandedTransition(ViewHolder) will be used. When this method returns false, onUpdateExpandedViewHolder(ViewHolder) will be called.

    Returns
    boolean True if it is running an expanding or collapsing transition, false otherwise.

    isExpanded

    added in version 25.1.0
    boolean isExpanded ()

    Returns
    boolean True if there is getExpandedAction() is not null, false otherwise.

    isInExpandTransition

    added in version 23.2.0
    boolean isInExpandTransition ()

    Returns true if it is running an expanding or collapsing transition, false otherwise.

    Returns
    boolean True if it is running an expanding or collapsing transition, false otherwise.

    isSubActionsExpanded

    added in version 23.2.0
    boolean isSubActionsExpanded ()

    Returns
    boolean True if sub actions list is expanded.

    onAnimateItemChecked

    added in version 22.1.0
    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. Default implementation calls setChecked() if getCheckmarkView() is instance of Checkable.

    Parameters
    vh GuidedActionsStylist.ViewHolder: The view holder associated with the relevant action.

    checked boolean: True if the action has become checked, false if it has become unchecked.

    onAnimateItemFocused

    added in version 22.1.0
    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 GuidedActionsStylist.ViewHolder: The view holder associated with the relevant action.

    focused boolean: True if the action has become focused, false if it has lost focus.

    onAnimateItemPressed

    added in version 22.1.0
    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 GuidedActionsStylist.ViewHolder: The view holder associated with the relevant action.

    pressed boolean: True if the action has been pressed, false if it has been unpressed.

    onAnimateItemPressedCancelled

    added in version 23.2.0
    void onAnimateItemPressedCancelled (GuidedActionsStylist.ViewHolder vh)

    Resets the view holder's view to unpressed state.

    Parameters
    vh GuidedActionsStylist.ViewHolder: The view holder associated with the relevant action.

    onBindActivatorView

    added in version 23.2.0
    void onBindActivatorView (GuidedActionsStylist.ViewHolder vh, 
                    GuidedAction action)

    Performs binding activator view value to action. Default implementation supports GuidedDatePickerAction, subclass may override to add support of other views.

    Parameters
    vh GuidedActionsStylist.ViewHolder: ViewHolder of activator view.

    action GuidedAction: GuidedAction to bind.

    onBindCheckMarkView

    added in version 23.2.0
    void onBindCheckMarkView (GuidedActionsStylist.ViewHolder vh, 
                    GuidedAction action)

    Sets states of check mark view, called by onBindViewHolder(ViewHolder, GuidedAction) when action's checkset Id is other than NO_CHECK_SET. Default implementation assigns drawable loaded from theme attribute listChoiceIndicatorMultiple for checkbox or listChoiceIndicatorSingle for radio button. Subclass rarely needs override the method, instead app can provide its own drawable that supports transition animations, change theme attributes listChoiceIndicatorMultiple and listChoiceIndicatorSingle in {android.support.v17.leanback.R. styleable#LeanbackGuidedStepTheme}.

    Parameters
    vh GuidedActionsStylist.ViewHolder: The view holder associated with the relevant action.

    action GuidedAction: The GuidedAction object to bind to.

    onBindChevronView

    added in version 23.2.0
    void onBindChevronView (GuidedActionsStylist.ViewHolder vh, 
                    GuidedAction action)

    Sets states of chevron view, called by onBindViewHolder(ViewHolder, GuidedAction). Subclass may override.

    Parameters
    vh GuidedActionsStylist.ViewHolder: The view holder associated with the relevant action.

    action GuidedAction: The GuidedAction object to bind to.

    onBindViewHolder

    added in version 22.1.0
    void onBindViewHolder (GuidedActionsStylist.ViewHolder vh, 
                    GuidedAction action)

    Binds a GuidedActionsStylist.ViewHolder to a particular GuidedAction.

    Parameters
    vh GuidedActionsStylist.ViewHolder: The view holder to be associated with the given action.

    action GuidedAction: The guided action to be displayed by the view holder's view.

    Returns
    void The view to be added to the caller's view hierarchy.

    onCreateView

    added in version 22.1.0
    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 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.

    Returns
    View The view to be added to the caller's view hierarchy.

    onCreateViewHolder

    added in version 23.2.0
    GuidedActionsStylist.ViewHolder onCreateViewHolder (ViewGroup parent, 
                    int viewType)

    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 ViewGroup: The view group to be used as the parent of the new view.

    viewType int: The viewType returned by getItemViewType(GuidedAction)

    Returns
    GuidedActionsStylist.ViewHolder The view to be added to the caller's view hierarchy.

    onCreateViewHolder

    added in version 22.1.0
    GuidedActionsStylist.ViewHolder onCreateViewHolder (ViewGroup parent)

    Constructs a GuidedActionsStylist.ViewHolder capable of representing GuidedActions. Subclasses may choose to return a subclass of ViewHolder. To support different view types, override onCreateViewHolder(ViewGroup, int)

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

    Parameters
    parent ViewGroup: The view group to be used as the parent of the new view.

    Returns
    GuidedActionsStylist.ViewHolder The view to be added to the caller's view hierarchy.

    onDestroyView

    added in version 23.2.0
    void onDestroyView ()

    Called when destroy the View created by GuidedActionsStylist.

    onImeAppearing

    added in version 23.1.0
    void onImeAppearing (List<Animator> animators)

    Animates the fragment in response to the IME appearing.

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

    onImeDisappearing

    added in version 23.1.0
    void onImeDisappearing (List<Animator> animators)

    Animates the fragment in response to the IME disappearing.

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

    onProvideItemLayoutId

    added in version 22.1.0
    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. Note that in order for the item to support editing, the title view should both subclass EditText and implement ImeKeyMonitor; see GuidedActionEditText. To support different types of Layouts, override onProvideItemLayoutId(int).

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

    onProvideItemLayoutId

    added in version 23.2.0
    int onProvideItemLayoutId (int viewType)

    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 supports:

  • lb_guidedactions_item
  • {lb_guidedactions_datepicker_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. Note that in order for the item to support editing, the title view should both subclass EditText and implement ImeKeyMonitor; see GuidedActionEditText.

    Parameters
    viewType int: View type returned by getItemViewType(GuidedAction)

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

  • onProvideLayoutId

    added in version 22.1.0
    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 or lb_guidedbuttonactions if isButtonActions() is true. 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
    int The resource ID of the layout to be inflated to define the host view for the list of GuidedActions.

    onUpdateActivatorView

    added in version 23.2.0
    boolean onUpdateActivatorView (GuidedActionsStylist.ViewHolder vh, 
                    GuidedAction action)

    Performs updating GuidedAction from activator view. Default implementation supports GuidedDatePickerAction, subclass may override to add support of other views.

    Parameters
    vh GuidedActionsStylist.ViewHolder: ViewHolder of activator view.

    action GuidedAction: GuidedAction to update.

    Returns
    boolean True if value has been updated, false otherwise.

    onUpdateExpandedViewHolder

    added in version 23.2.0
    void onUpdateExpandedViewHolder (GuidedActionsStylist.ViewHolder avh)

    Expand or collapse GuidedActionStylist.

    Parameters
    avh GuidedActionsStylist.ViewHolder: When not null, the GuidedActionStylist expands the sub actions of avh. When null the GuidedActionStylist will collapse sub actions.

    openInEditMode

    void openInEditMode (GuidedAction action)

    Switches action to edit mode and pops up the keyboard.

    Parameters
    action GuidedAction

    setAsButtonActions

    added in version 23.2.0
    void setAsButtonActions ()

    Choose the layout resource for button actions in onProvideLayoutId().

    setBackKeyToCollapseActivatorView

    added in version 25.1.0
    void setBackKeyToCollapseActivatorView (boolean backToCollapse)

    Enable or disable using BACK key to collapse GuidedAction with editable activator view. Default is enabled.

    Parameters
    backToCollapse boolean: True to enable using BACK key to collapse GuidedAction with editable activator view.

    See also:

    setBackKeyToCollapseSubActions

    added in version 25.1.0
    void setBackKeyToCollapseSubActions (boolean backToCollapse)

    Enable or disable using BACK key to collapse sub actions list. Default is enabled.

    Parameters
    backToCollapse boolean: True to enable using BACK key to collapse sub actions list, false to disable.

    See also:

    setEditingMode

    added in version 23.2.0
    void setEditingMode (GuidedActionsStylist.ViewHolder vh, 
                    GuidedAction action, 
                    boolean editing)

    This method was deprecated in API level 25.1.0.
    This method is for internal library use only and should not be called directly.

    Parameters
    vh GuidedActionsStylist.ViewHolder

    action GuidedAction

    editing boolean

    setExpandedViewHolder

    added in version 23.2.0
    void setExpandedViewHolder (GuidedActionsStylist.ViewHolder avh)

    This method was deprecated in API level 25.1.0.
    use expandAction(GuidedAction, boolean) and collapseAction(boolean)

    Expands or collapse the sub actions list view with transition animation

    Parameters
    avh GuidedActionsStylist.ViewHolder: When not null, fill sub actions list of this ViewHolder into sub actions list and hide the other items in main list. When null, collapse the sub actions list.

    startExpandedTransition

    added in version 23.2.0
    void startExpandedTransition (GuidedActionsStylist.ViewHolder avh)

    This method was deprecated in API level 25.1.0.
    use expandAction(GuidedAction, boolean) and collapseAction(boolean)

    Start transition to expand or collapse GuidedActionStylist.

    Parameters
    avh GuidedActionsStylist.ViewHolder: When not null, the GuidedActionStylist expands the sub actions of avh. When null the GuidedActionStylist will collapse sub actions.

    Protected methods

    onEditingModeChange

    added in version 23.2.0
    void onEditingModeChange (GuidedActionsStylist.ViewHolder vh, 
                    GuidedAction action, 
                    boolean editing)

    This method was deprecated in API level 25.1.0.
    Use onEditingModeChange(ViewHolder, boolean, boolean).

    Parameters
    vh GuidedActionsStylist.ViewHolder

    action GuidedAction

    editing boolean

    onEditingModeChange

    added in version 25.1.0
    void onEditingModeChange (GuidedActionsStylist.ViewHolder vh, 
                    boolean editing, 
                    boolean withTransition)

    Called when editing mode of an ViewHolder is changed. Subclass must call super.onEditingModeChange(vh,editing,withTransition).

    Parameters
    vh GuidedActionsStylist.ViewHolder: ViewHolder to change editing mode.

    editing boolean: True to enable editing, false to stop editing

    withTransition boolean: True to run expand transiiton, false otherwise.

    setupImeOptions

    added in version 23.2.0
    void setupImeOptions (GuidedActionsStylist.ViewHolder vh, 
                    GuidedAction action)

    Called by onBindViewHolder(ViewHolder, GuidedAction) to setup IME options. Default implementation assigns IME_ACTION_DONE. Subclass may override.

    Parameters
    vh GuidedActionsStylist.ViewHolder: The view holder to be associated with the given action.

    action GuidedAction: The guided action to be displayed by the view holder's view.

    This site uses cookies to store your preferences for site-specific language and display options.

    Get the latest Android developer news and tips that will help you find success on Google Play.

    * Required Fields

    Hooray!

    Browse this site in ?

    You requested a page in , but your language preference for this site is .

    Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

    This class requires API level or higher

    This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

    For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

    Take a one-minute survey?
    Help us improve Android tools and documentation.