Action


class Action

Known direct subclasses
GuidedAction

A data class which represents an action within a .

PlaybackControlsRow.MoreActions

An action displaying an icon for "more actions".

PlaybackControlsRow.MultiAction

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

PlaybackControlsRow.PictureInPictureAction

An action displaying an icon for picture-in-picture.

PlaybackControlsRow.SkipNextAction

An action displaying an icon for skip next.

PlaybackControlsRow.SkipPreviousAction

An action displaying an icon for skip previous.

Known indirect subclasses
GuidedDatePickerAction

Subclass of GuidedAction that can choose a date.

PlaybackControlsRow.ClosedCaptioningAction

An action for displaying a CC (Closed Captioning) icon.

PlaybackControlsRow.FastForwardAction

An action displaying an icon for fast forward.

PlaybackControlsRow.HighQualityAction

An action for displaying a HQ (High Quality) icon.

PlaybackControlsRow.PlayPauseAction

An action displaying icons for play and pause.

PlaybackControlsRow.RepeatAction

An action for displaying three repeat states: none, one, or all.

PlaybackControlsRow.RewindAction

An action displaying an icon for rewind.

PlaybackControlsRow.ShuffleAction

An action for displaying a shuffle icon.

PlaybackControlsRow.ThumbsAction

A base class for displaying a thumbs action.

PlaybackControlsRow.ThumbsDownAction

An action displaying an icon for thumbs down.

PlaybackControlsRow.ThumbsUpAction

An action displaying an icon for thumbs up.


An action contains one or two lines of text, an optional image and an optional id. It may also be invoked by one or more keycodes.

Summary

Constants

const Long
NO_ID = -1

Indicates that an id has not been set.

Public constructors

Action(id: Long)

Constructor for an Action.

Action(id: Long, label: CharSequence?)

Constructor for an Action.

Action(id: Long, label1: CharSequence?, label2: CharSequence?)

Constructor for an Action.

Action(id: Long, label1: CharSequence?, label2: CharSequence?, icon: Drawable?)

Constructor for an Action.

Public functions

Unit
addKeyCode(keyCode: Int)

Adds a keycode used to invoke this Action.

Drawable?

Returns the icon drawable for this Action.

Long

Returns the id for this Action.

CharSequence?

Returns the first line label for this Action.

CharSequence?

Returns the second line label for this Action.

Unit
removeKeyCode(keyCode: Int)

Removes a keycode used to invoke this Action.

Boolean

Returns true if the Action should respond to the given keycode.

Unit
setIcon(icon: Drawable?)

Sets the icon drawable for this Action.

Unit
setId(id: Long)

Sets the id for this Action.

Unit

Sets the first line label for this Action.

Unit

Sets the second line label for this Action.

String

Constants

NO_ID

Added in 1.1.0
const val NO_ID = -1: Long

Indicates that an id has not been set.

Public constructors

Action

Added in 1.1.0
Action(id: Long)

Constructor for an Action.

Parameters
id: Long

The id of the Action.

Action

Added in 1.1.0
Action(id: Long, label: CharSequence?)

Constructor for an Action.

Parameters
id: Long

The id of the Action.

label: CharSequence?

The label to display for the Action.

Action

Added in 1.1.0
Action(id: Long, label1: CharSequence?, label2: CharSequence?)

Constructor for an Action.

Parameters
id: Long

The id of the Action.

label1: CharSequence?

The label to display on the first line of the Action.

label2: CharSequence?

The label to display on the second line of the Action.

Action

Added in 1.1.0
Action(id: Long, label1: CharSequence?, label2: CharSequence?, icon: Drawable?)

Constructor for an Action.

Parameters
id: Long

The id of the Action.

label1: CharSequence?

The label to display on the first line of the Action.

label2: CharSequence?

The label to display on the second line of the Action.

icon: Drawable?

The icon to display for the Action.

Public functions

addKeyCode

Added in 1.1.0
fun addKeyCode(keyCode: Int): Unit

Adds a keycode used to invoke this Action.

getIcon

Added in 1.1.0
fun getIcon(): Drawable?

Returns the icon drawable for this Action.

getId

Added in 1.1.0
fun getId(): Long

Returns the id for this Action.

getLabel1

Added in 1.1.0
fun getLabel1(): CharSequence?

Returns the first line label for this Action.

getLabel2

Added in 1.1.0
fun getLabel2(): CharSequence?

Returns the second line label for this Action.

removeKeyCode

Added in 1.1.0
fun removeKeyCode(keyCode: Int): Unit

Removes a keycode used to invoke this Action.

respondsToKeyCode

Added in 1.1.0
fun respondsToKeyCode(keyCode: Int): Boolean

Returns true if the Action should respond to the given keycode.

setIcon

Added in 1.1.0
fun setIcon(icon: Drawable?): Unit

Sets the icon drawable for this Action.

setId

Added in 1.1.0
fun setId(id: Long): Unit

Sets the id for this Action.

setLabel1

Added in 1.1.0
fun setLabel1(label: CharSequence?): Unit

Sets the first line label for this Action.

setLabel2

Added in 1.1.0
fun setLabel2(label: CharSequence?): Unit

Sets the second line label for this Action.

toString

fun toString(): String