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>

This field is deprecated.

Use fromBundle instead.

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 @Nullable Uri

The Uri for the icon 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

boolean

Checks the given command button for equality while ignoring extras.

static CommandButton

Restores a CommandButton from a Bundle.

int
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.

iconUri

@UnstableApi
public final @Nullable Uri iconUri

The Uri for the icon of the button. Can be null.

isEnabled

public final boolean isEnabled

Whether it's enabled.

playerCommand

@Player.Command
public final int playerCommand

The Player.Command command of the button. Will be COMMAND_INVALID if sessionCommand is set.

sessionCommand

public final @Nullable SessionCommand sessionCommand

The session command of the button. Will be null if playerCommand is set.

Public methods

equals

public boolean equals(@Nullable Object obj)

Checks the given command button for equality while ignoring extras.

fromBundle

@UnstableApi
public static CommandButton fromBundle(Bundle bundle)

Restores a CommandButton from a Bundle.

hashCode

public int hashCode()

toBundle

@UnstableApi
public Bundle toBundle()

Returns a Bundle representing the information stored in this object.