Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 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 Unit
setLabels(labels: Array<String!>!)

Sets the array of strings used as labels.

open String!
getLabel(index: Int)

Returns the label at the given index.

open Int

Returns the current index.

open Unit
setIndex(index: Int)

Sets the current index.

open Drawable!
getDrawable(index: Int)

Returns the drawable at the given index.

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

Sets the array of drawables.

open Unit

Sets the array of strings used as secondary labels.

open Unit

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

open Int

Returns the number of actions.

open String!

Returns the secondary label at the given index.

Inherited functions

Public constructors

<init>

MultiAction(id: Int)

Constructor

Parameters
id Int: The id of the Action.

Public methods

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.

getLabel

open fun getLabel(index: Int): String!

Returns the label at the given index.

getIndex

open fun getIndex(): Int

Returns the current index.

setIndex

open fun setIndex(index: Int): Unit

Sets the current index.

getDrawable

open fun getDrawable(index: Int): Drawable!

Returns the drawable at the given index.

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.

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.

nextIndex

open fun nextIndex(): Unit

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

getActionCount

open fun getActionCount(): Int

Returns the number of actions.

getSecondaryLabel

open fun getSecondaryLabel(index: Int): String!

Returns the secondary label at the given index.