public final class CommandButton


A button for a SessionCommand or Player.Command that can be displayed by controllers.

Summary

Nested types

public final class CommandButton.Builder

A builder for CommandButton.

Constraints for displaying a list of CommandButton instances with utilities to resolve these constraints for a given list of buttons.

A builder for DisplayConstraints.

An icon constant for a button.

A slot at which a button can be displayed in a UI surface.

Constants

static final int
ICON_ALBUM = 57369

An icon showing an album symbol (a stylized LP record).

static final int
ICON_ARTIST = 57370

An icon showing an artist symbol (a stylized person with a musical note).

static final int
ICON_BLOCK = 57675

An icon showing a block symbol (a circle with a diagonal line).

static final int

An icon showing a filled bookmark symbol.

static final int

An icon showing an unfilled bookmark symbol.

static final int

An icon showing a filled circle with a check mark.

static final int

An icon showing a unfilled circle with a check mark.

static final int

An icon showing a closed caption symbol (a rectangle with the letters CC).

static final int

An icon showing a closed caption off symbol (a rectangle with the letters CC, with a large diagonal line across).

static final int

An icon showing a fast forward symbol (two right facing triangles).

static final int
ICON_FEED = 57573

An icon showing an feed symbol (a dot in the bottom-left with multiple concentric quarter circles).

static final int

An icon showing a filled flag symbol.

static final int

An icon showing an unfilled flag symbol.

static final int

An icon showing a filled heart symbol.

static final int

An icon showing an unfilled heart symbol.

static final int
ICON_MINUS = 57691

An icon showing a minus symbol.

static final int

An icon showing a filled circle with a minus.

static final int

An icon showing an unfilled circle with a minus.

static final int
ICON_NEXT = 57412

An icon showing a next symbol (a right facing triangle with a vertical bar).

static final int
ICON_PAUSE = 57396

An icon showing a pause symbol (two vertical bars).

static final int
ICON_PLAY = 57399

An icon showing a play symbol (a right facing triangle).

static final int

An icon showing a playback speed symbol (a right facing triangle in a circle with half-dashed, half-solid contour).

static final int

An icon showing a 0.5x speed symbol.

static final int

An icon showing a 0.8x speed symbol.

static final int

An icon showing a 1.0x speed symbol.

static final int

An icon showing a 1.2x speed symbol.

static final int

An icon showing a 1.5x speed symbol.

static final int

An icon showing a 1.8x speed symbol.

static final int

An icon showing a 2.0x speed symbol.

static final int

An icon showing an add to playlist symbol (multiple horizontal bars with a small plus).

static final int

An icon showing an remove from playlist symbol (multiple horizontal bars with a small minus).

static final int
ICON_PLUS = 57669

An icon showing a plus symbol.

static final int

An icon showing a filled circle with a plus.

static final int

An icon showing an unfilled circle with a plus.

static final int

An icon showing a previous symbol (a left facing triangle with a vertical bar).

static final int
ICON_QUALITY = 58409

An icon showing a quality selection symbol (multiple horizontal bars with sliders).

static final int

An icon showing an add to queue symbol (a stylized TV with a plus).

static final int

An icon showing a play next queue item symbol (a stylized TV with a plus and a right-facing arrow).

static final int

An icon showing a remove from queue symbol (a stylized TV with a minus).

static final int
ICON_RADIO = 58654

An icon showing a radio symbol (left and right facing sound waves).

static final int

An icon showing a repeat all symbol (two open clockwise arrows).

static final int
ICON_REPEAT_OFF = 1040448

An icon showing a disabled repeat symbol (two open clockwise arrows, in a color representing a disabled state).

static final int

An icon showing a repeat one symbol (two open clockwise arrows with an overlaid number 1).

static final int
ICON_REWIND = 57376

An icon showing a rewind symbol (two left facing triangles).

static final int

An icon showing a settings symbol (a stylized cog).

static final int
ICON_SHARE = 59405

An icon showing a share symbol (three dots connected by two diagonal lines, open on the right).

static final int

An icon showing a disabled shuffle symbol (two diagonal upward and downward facing arrows, in a color representing a disabled state).

static final int

An icon showing a shuffle symbol (two diagonal upward and downward facing arrows).

static final int

An icon showing a shuffle symbol with a start (two diagonal upward and downward facing arrows with an overlaid star).

static final int
ICON_SIGNAL = 61512

An icon showing an signal symbol (a vertical mast with circular sounds waves).

static final int

An icon showing a skip back symbol (an open anti-clockwise arrow).

static final int

An icon showing a skip back 10 seconds symbol (an open anti-clockwise arrow with the number 10).

static final int

An icon showing a skip back 15 seconds symbol (an open anti-clockwise arrow with the number 15).

static final int

An icon showing a skip back 30 seconds symbol (an open anti-clockwise arrow with the number 30).

static final int

An icon showing a skip back 5 seconds symbol (an open anti-clockwise arrow with the number 5).

static final int

An icon showing a skip forward symbol (an open clock-wise arrow).

static final int

An icon showing a skip forward 10 seconds symbol (an open clockwise arrow with the number 10).

static final int

An icon showing a skip forward 15 seconds symbol (an open clockwise arrow with the number 15).

static final int

An icon showing a skip forward 30 seconds symbol (an open clockwise arrow with the number 30).

static final int

An icon showing a skip forward 5 seconds symbol (an open clockwise arrow with the number 5).

static final int

An icon showing a filled star symbol.

static final int

An icon showing an unfilled star symbol.

static final int
ICON_STOP = 57415

An icon showing a stop symbol (a square).

static final int

An icon showing a subtitles symbol (a rectangle filled with dots and horizontal lines).

static final int

An icon showing a subtitles off symbol (a rectangle filled with dots and horizontal lines, with a large diagonal line across).

static final int
ICON_SYNC = 58919

An icon showing a sync symbol (two open anti-clockwise arrows).

static final int

An icon showing a filled thumb-down symbol.

static final int

An icon showing an unfilled thumb-down symbol.

static final int

An icon showing a filled thumb-up symbol.

static final int

An icon showing an unfilled thumb-up symbol.

static final int

An icon constant representing an undefined icon, for example a custom icon not covered by the existing constants.

static final int

An icon showing a volume down symbol (a stylized speaker with a single small sound wave).

static final int

An icon showing a volume off symbol (a stylized speaker with multiple sound waves, with a large diagonal line across).

static final int

An icon showing a volume up symbol (a stylized speaker with multiple sound waves).

static final int

A slot in a playback control UI for backward-directed playback actions, most commonly used for previous or rewind actions.

static final int

A slot in a playback control UI for secondary backward-directed playback actions, most commonly used for previous or rewind actions.

static final int

A central slot in a playback control UI, most commonly used for play or pause actions.

static final int

A slot in a playback control UI for forward-directed playback actions, most commonly used for next or fast-forward actions.

static final int

A slot in a playback control UI for secondary forward-directed playback actions, most commonly used for next or fast-forward actions.

static final int

A slot in a playback control UI for additional actions that don't fit into other slots.

Public fields

final CharSequence

The display name of the button.

final Bundle

The extra Bundle of the button.

final int

The Icon of the button.

final @DrawableRes int

The fallback icon resource ID of the button.

final @Nullable Uri

The fallback content or resourceUri for the icon of the button.

final boolean

Whether the button is enabled.

final int

The Player.Command command of the button.

final @Nullable SessionCommand

The session command of the button.

final ImmutableIntArray

The allowed Slot positions for this button.

Public methods

boolean

Checks the given command button for equality while ignoring extras.

static CommandButton

This method is deprecated.

Use fromBundle instead.

static CommandButton
@UnstableApi
fromBundle(Bundle bundle, int sessionInterfaceVersion)

Restores a CommandButton from a Bundle.

static int
@UnstableApi
@CommandButton.Slot
getDefaultSlot(
    @Player.Command int playerCommand,
    @CommandButton.Icon int icon
)

Returns the default Slot for a button.

static @DrawableRes int

Returns a drawable resource id for the given Icon constant.

int
Bundle

Constants

ICON_ALBUM

public static final int ICON_ALBUM = 57369

An icon showing an album symbol (a stylized LP record).

<a name="getIC