Stay organized with collections Save and categorize content based on your preferences.

CommandButton

public final class CommandButton implements Bundleable


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.

Constants

static final Bundleable.Creator<CommandButton>

Object that can restore CommandButton from a Bundle.

Public fields

final CharSequence

The display name of the button.

final Bundle

The extra Bundle of the button.

final @DrawableRes int

The icon resource id of the button.

final boolean

Whether it's enabled.

final int

The Player.Command command of the button.

final @Nullable SessionCommand

The session command of the button.

Public methods

Bundle

Returns a Bundle representing the information stored in this object.

Constants

CREATOR

@UnstableApi
public static final Bundleable.Creator<CommandButtonCREATOR

Object that can restore CommandButton from a Bundle.

Public fields

displayName

public final CharSequence displayName

The display name of the button. Can be empty if the command is predefined and a custom name isn't needed.

extras

@UnstableApi
public final Bundle extras

The extra Bundle of the button. It's private information between session and controller.

iconResId

public final @DrawableRes int iconResId

The icon resource id of the button. Can be 0 if the command is predefined and a custom icon isn't needed.

isEnabled

public final boolean isEnabled

Whether it's enabled.

playerCommand

@Player.Command
public final int playerCommand

The Player.Command command of the button. Can be COMMAND_INVALID if the button is a placeholder.

sessionCommand

public final @Nullable SessionCommand sessionCommand

The session command of the button. Can be null if the button is a placeholder.

Public methods

toBundle

@UnstableApi
public Bundle toBundle()

Returns a Bundle representing the information stored in this object.