# PlaybackControlsRow.ShuffleAction

# PlaybackControlsRow.ShuffleAction

Artifact:[androidx.leanback:leanback](https://developer.android.com/jetpack/androidx/releases/leanback)  
[View Source](https://cs.android.com/search?q=file:androidx/leanback/widget/PlaybackControlsRow.java+class:androidx.leanback.widget.PlaybackControlsRow.ShuffleAction)  
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/PlaybackControlsRow.ShuffleAction "View this page in Java")

<br />

```
class PlaybackControlsRow.ShuffleAction : PlaybackControlsRow.MultiAction
```

<br />

|---|---|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                                               ||||
| ↳ | [androidx.leanback.widget.Action](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action)                                                             |||
|   | ↳ | [androidx.leanback.widget.PlaybackControlsRow.MultiAction](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction)        ||
|   |   | ↳ | [androidx.leanback.widget.PlaybackControlsRow.ShuffleAction](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction) |

*** ** * ** ***

An action for displaying a shuffle icon.

## Summary

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [INDEX_OFF](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction#INDEX_OFF())` = 0` Action index for shuffle is off                                                                                                                                   |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [INDEX_ON](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction#INDEX_ON())` = 1` Action index for shuffle is on.                                                                                                                                     |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [OFF](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction#OFF())` = 0` **This property is deprecated.** Use[INDEX_OFF](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction#INDEX_OFF()) <br /> |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [ON](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction#ON())` = 1` **This property is deprecated.** Use[INDEX_ON](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction#INDEX_ON()) <br />     |

|                                                                                                                                                                             ### Public constructors                                                                                                                                                                             |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ShuffleAction](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction#ShuffleAction(android.content.Context))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!)` Constructor                                                                                                    |
| [ShuffleAction](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction#ShuffleAction(android.content.Context,int))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!, highlightColor: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Constructor |

|                                                                                                                                                                                                                                                                                          ### Inherited Constants                                                                                                                                                                                                                                                                                          |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.leanback.widget.Action](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action) |---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------| | `const `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [NO_ID](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#NO_ID())` = -1` Indicates that an id has not been set. | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.leanback.widget.Action](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action) |---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                     | [addKeyCode](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#addKeyCode(int))`(keyCode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Adds a keycode used to invoke this Action.                                     | | [Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)`?`    | [getIcon](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#getIcon())`()` Returns the icon drawable for this Action.                                                                                                                                    | | [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                     | [getId](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#getId())`()` Returns the id for this Action.                                                                                                                                                   | | [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?` | [getLabel1](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#getLabel1())`()` Returns the first line label for this Action.                                                                                                                             | | [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?` | [getLabel2](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#getLabel2())`()` Returns the second line label for this Action.                                                                                                                            | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                     | [removeKeyCode](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#removeKeyCode(int))`(keyCode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Removes a keycode used to invoke this Action.                            | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)               | [respondsToKeyCode](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#respondsToKeyCode(int))`(keyCode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns true if the Action should respond to the given keycode.  | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                     | [setIcon](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#setIcon(android.graphics.drawable.Drawable))`(icon: `[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)`?)` Sets the icon drawable for this Action. | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                     | [setId](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#setId(long))`(id: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Sets the id for this Action.                                                               | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                     | [setLabel1](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#setLabel1(java.lang.CharSequence))`(label: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?)` Sets the first line label for this Action.  | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                     | [setLabel2](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#setLabel2(java.lang.CharSequence))`(label: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?)` Sets the second line label for this Action. | | [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                 | [toString](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Action#toString())`()`                                                                                                                                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| From[androidx.leanback.widget.PlaybackControlsRow.MultiAction](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction) |------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                    | [getActionCount](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction#getActionCount())`()` Returns the number of actions.                                                                                                                                                                                                                                | | [Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)`!` | [getDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction#getDrawable(int))`(index: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the drawable at the given index.                                                                                                                                     | | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                    | [getIndex](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction#getIndex())`()` Returns the current index.                                                                                                                                                                                                                                                | | [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`           | [getLabel](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction#getLabel(int))`(index: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the label at the given index.                                                                                                                                              | | [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`           | [getSecondaryLabel](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction#getSecondaryLabel(int))`(index: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the secondary label at the given index.                                                                                                                  | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                  | [nextIndex](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction#nextIndex())`()` Increments the index, wrapping to zero once the end is reached.                                                                                                                                                                                                         | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                  | [setDrawables](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.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 array of drawables.     | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                  | [setIndex](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction#setIndex(int))`(index: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Sets the current index.                                                                                                                                                            | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                  | [setLabels](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction#setLabels(java.lang.String[]))`(labels: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>!)` Sets the array of strings used as labels.                             | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                  | [setSecondaryLabels](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.MultiAction#setSecondaryLabels(java.lang.String[]))`(labels: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>!)` Sets the array of strings used as secondary labels. | |

## Constants

### INDEX_OFF

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

```
const val INDEX_OFF = 0: Int
```

Action index for shuffle is off  

### INDEX_ON

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

```
const val INDEX_ON = 1: Int
```

Action index for shuffle is on.  

### OFF

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

```
const val OFF = 0: Int
```
| **This property is deprecated.**   
|
| Use[INDEX_OFF](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction#INDEX_OFF())

Action index for shuffle is off.  

### ON

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

```
const val ON = 1: Int
```
| **This property is deprecated.**   
|
| Use[INDEX_ON](https://developer.android.com/reference/kotlin/androidx/leanback/widget/PlaybackControlsRow.ShuffleAction#INDEX_ON())

Action index for shuffle is on.  

## Public constructors

### ShuffleAction

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

```
ShuffleAction(context: Context!)
```

Constructor  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|-------------------------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!` | Context used for loading resources. |

### ShuffleAction

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

```
ShuffleAction(context: Context!, highlightColor: Int)
```

Constructor  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|---------------------------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!` | Context used for loading resources.   |
| `highlightColor: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Color for the highlighted icon state. |