public class

MultiActionsProvider.MultiAction

extends java.lang.Object

 java.lang.Object

↳androidx.leanback.widget.MultiActionsProvider.MultiAction

Overview

MultiAction represents an action that can have multiple states. MultiActionsProvider.MultiAction.getIndex() returns the current index within the drawables. Both list of drawables and index can be updated dynamically in the program, and the UI could be updated by notifying the listeners provided in AbstractMediaItemPresenter.ViewHolder.

Summary

Constructors
publicMultiAction(long id)

Methods
public DrawablegetCurrentDrawable()

public DrawablegetDrawables()

Returns the drawables used for displaying different states within this MultiActionsProvider.MultiAction.

public longgetId()

public intgetIndex()

Returns the currently selected index in this MultiAction.

public voidincrementIndex()

Increments the index which this MultiAction currently represents.

public voidsetDrawables(Drawable drawables[])

Sets the drawables used for displaying different states within this MultiActionsProvider.MultiAction.

public voidsetIndex(int index)

Sets the index which this MultiAction currently represents.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public MultiAction(long id)

Methods

public void setDrawables(Drawable drawables[])

Sets the drawables used for displaying different states within this MultiActionsProvider.MultiAction. The size of drawables determines the set of states this action represents.

Parameters:

drawables: Array of drawables for different MultiAction states.

public Drawable getDrawables()

Returns the drawables used for displaying different states within this MultiActionsProvider.MultiAction.

Returns:

The drawables used for displaying different states within this MultiActionsProvider.MultiAction.

public void incrementIndex()

Increments the index which this MultiAction currently represents. The index is wrapped around to zero when the end is reached.

public void setIndex(int index)

Sets the index which this MultiAction currently represents.

Parameters:

index: The current action index.

public int getIndex()

Returns the currently selected index in this MultiAction.

Returns:

The currently selected index in this MultiAction.

public Drawable getCurrentDrawable()

Returns:

The icon drawable for the current state of this MultiAction.

public long getId()

Returns:

The id for this MultiAction.