# MultiActionsProvider.MultiAction

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/leanback/widget/MultiActionsProvider.MultiAction "View this page in Java")

<br />

```
class MultiActionsProvider.MultiAction
```

<br />

*** ** * ** ***

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

## Summary

|                                                                                                     ### Public constructors                                                                                                      |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MultiAction](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction#MultiAction(long))`(id: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` |

|                                                                                ### Public functions                                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)`!`                                                                                     | [getCurrentDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction#getCurrentDrawable())`()`                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)`!>!` | [getDrawables](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction#getDrawables())`()` Returns the drawables used for displaying different states within this[MultiAction](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction).                                                                                                                                                                                                                               |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                      | [getId](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction#getId())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                        | [getIndex](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction#getIndex())`()` Returns the currently selected index in this MultiAction.                                                                                                                                                                                                                                                                                                                                                                            |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                      | [incrementIndex](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction#incrementIndex())`()` Increments the index which this MultiAction currently represents.                                                                                                                                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                      | [setDrawables](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction#setDrawables(android.graphics.drawable.Drawable[]))`(drawables: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)`!>!)` Sets the drawables used for displaying different states within this[MultiAction](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction). |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                      | [setIndex](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction#setIndex(int))`(index: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` 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)  

```
MultiAction(id: Long)
```  

## Public functions

### getCurrentDrawable

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

```
fun getCurrentDrawable(): Drawable!
```  

|                                            Returns                                             |
|------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [Drawable](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)  

```
fun getDrawables(): Array<Drawable!>!
```

Returns the drawables used for displaying different states within this[MultiAction](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction).  

|                                                                                      Returns                                                                                       |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)`!>!` | The drawables used for displaying different states within this[MultiAction](https://developer.android.com/reference/kotlin/androidx/leanback/widget/MultiActionsProvider.MultiAction). |

### getId

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

```
fun getId(): Long
```  

|                                    Returns                                    |
|-------------------------------------------------------------------------------|------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The id for this MultiAction. |

### getIndex

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

```
fun getIndex(): Int
```

Returns the currently selected index in this MultiAction.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|---------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The currently selected index in this MultiAction. |

### incrementIndex

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

```
fun incrementIndex(): Unit
```

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)  

```
fun setDrawables(drawables: Array<Drawable!>!): Unit
```

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

|                                                                                           Parameters                                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
| `drawables: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)`!>!` | Array of drawables for different MultiAction states. |

### setIndex

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

```
fun setIndex(index: Int): Unit
```

Sets the index which this MultiAction currently represents.  

|                                      Parameters                                      |
|--------------------------------------------------------------------------------------|---------------------------|
| `index: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The current action index. |