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 | |
---|---|
Public methods | |
---|---|
open Drawable! | |
open Array<Drawable!>! |
Returns the drawables used for displaying different states within this |
open Long |
getId() |
open Int |
getIndex() Returns the currently selected index in this MultiAction. |
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 |
open Unit |
Sets the index which this MultiAction currently represents. |
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. |
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 . |
getIndex
open fun getIndex(): Int
Returns the currently selected index in this MultiAction.
Return | |
---|---|
Int |
The currently selected index in 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. |