MultiAction

open class MultiAction
kotlin.Any
   ↳ androidx.leanback.widget.MultiActionsProvider.MultiAction

MultiAction represents an action that can have multiple states. 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

Public constructors
<init>(id: Long)

Public methods
open Drawable!

open Int

Returns the currently selected index in this MultiAction.

open Unit
setIndex(index: Int)

Sets the index which this MultiAction currently represents.

open Long

open Unit

Increments the index which this MultiAction currently represents.

open Unit
setDrawables(drawables: Array<Drawable!>!)

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

open Array<Drawable!>!

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

Public constructors

<init>

MultiAction(id: Long)

Public methods

getCurrentDrawable

open fun getCurrentDrawable(): Drawable!
Return
Drawable!: The icon drawable for the current state of this MultiAction.

getIndex

open fun getIndex(): Int

Returns the currently selected index in this MultiAction.

Return
Int: The currently selected index in this MultiAction.

setIndex

open fun setIndex(index: Int): Unit

Sets the index which this MultiAction currently represents.

Parameters
index Int: The current action index.

getId

open fun getId(): Long
Return
Long: The id for this MultiAction.

incrementIndex

open fun incrementIndex(): Unit

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

setDrawables

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

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

Parameters
drawables Array<Drawable!>!: Array of drawables for different MultiAction states.

getDrawables

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

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

Return
Array<Drawable!>!: The drawables used for displaying different states within this MultiAction.