# MultiActionsProvider.MultiAction

Artifact: [androidx.leanback:leanback](https://developer.android.com/jetpack/androidx/releases/leanback) [View Source](https://cs.android.com/search?q=file:androidx/leanback/widget/MultiActionsProvider.java+class:androidx.leanback.widget.MultiActionsProvider.MultiAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

*** ** * ** ***


```
public class MultiActionsProvider.MultiAction
```

<br />

*** ** * ** ***

MultiAction represents an action that can have multiple states. `https://developer.android.com/reference/androidx/leanback/widget/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 `https://developer.android.com/reference/androidx/leanback/widget/AbstractMediaItemPresenter.ViewHolder`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction#MultiAction(long)(long id)` |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction#getCurrentDrawable()()` |
| `Drawable[]` | `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction#getDrawables()()` Returns the drawables used for displaying different states within this `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction`. |
| `long` | `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction#getId()()` |
| `int` | `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction#getIndex()()` Returns the currently selected index in this MultiAction. |
| `void` | `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction#incrementIndex()()` Increments the index which this MultiAction currently represents. |
| `void` | `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction#setDrawables(android.graphics.drawable.Drawable[])(Drawable[] drawables)` Sets the drawables used for displaying different states within this `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction`. |
| `void` | `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction#setIndex(int)(int index)` Sets the index which this MultiAction currently represents. |

## Public constructors

### MultiAction

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public MultiAction(long id)
```

## Public methods

### getCurrentDrawable

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public Drawable getCurrentDrawable()
```

| Returns |
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | The icon drawable for the current state of this MultiAction. |

### getDrawables

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public Drawable[] getDrawables()
```

Returns the drawables used for displaying different states within this `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction`.

| Returns |
|---|---|
| `Drawable[]` | The drawables used for displaying different states within this `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction`. |

### getId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public long getId()
```

| Returns |
|---|---|
| `long` | The id for this MultiAction. |

### getIndex

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public int getIndex()
```

Returns the currently selected index in this MultiAction.

| Returns |
|---|---|
| `int` | The currently selected index in this MultiAction. |

### incrementIndex

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void incrementIndex()
```

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

### setDrawables

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setDrawables(Drawable[] drawables)
```

Sets the drawables used for displaying different states within this `https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction`. The size of drawables determines the set of states this action represents.

| Parameters |
|---|---|
| `Drawable[] drawables` | Array of drawables for different MultiAction states. |

### setIndex

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
public void setIndex(int index)
```

Sets the index which this MultiAction currently represents.

| Parameters |
|---|---|
| `int index` | The current action index. |