Register now for Android Dev Summit 2019!

MultiAction

abstract class MultiAction : Action
kotlin.Any
   ↳ androidx.leanback.widget.Action
   ↳ androidx.leanback.widget.PlaybackControlsRow.MultiAction

Base class for an action comprised of a series of icons.

Summary

Inherited constants

Public constructors

<init>(id: Int)

Constructor

Public methods

open Int

Returns the number of actions.

open Drawable!
getDrawable(index: Int)

Returns the drawable at the given index.

open Int

Returns the current index.

open String!
getLabel(index: Int)

Returns the label at the given index.

open String!

Returns the secondary label at the given index.

open Unit

Increments the index, wrapping to zero once the end is reached.

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

Sets the array of drawables.

open Unit
setIndex(index: Int)

Sets the current index.

open Unit
setLabels(labels: Array<String!>!)

Sets the array of strings used as labels.

open Unit

Sets the array of strings used as secondary labels.

Inherited functions

Public constructors

<init>

MultiAction(id: Int)

Constructor

Parameters
id Int: The id of the Action.

Public methods

getActionCount

open fun getActionCount(): Int

Returns the number of actions.

getDrawable

open fun getDrawable(index: Int): Drawable!

Returns the drawable at the given index.

getIndex

open fun getIndex(): Int

Returns the current index.

getLabel

open fun getLabel(index: Int): String!

Returns the label at the given index.

getSecondaryLabel

open fun getSecondaryLabel(index: Int): String!

Returns the secondary label at the given index.

nextIndex

open fun nextIndex(): Unit

Increments the index, wrapping to zero once the end is reached.

setDrawables

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

Sets the array of drawables. The size of the array defines the range of valid indices for this action.

setIndex

open fun setIndex(index: Int): Unit

Sets the current index.

setLabels

open fun setLabels(labels: Array<String!>!): Unit

Sets the array of strings used as labels. The size of the array defines the range of valid indices for this action. The labels are used to define the accessibility content description unless secondary labels are provided.

setSecondaryLabels

open fun setSecondaryLabels(labels: Array<String!>!): Unit

Sets the array of strings used as secondary labels. These labels are used in place of the primary labels for accessibility content description only.