Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

CommandButton

class CommandButton : VersionedParcelable
kotlin.Any
   ↳ androidx.media2.session.MediaSession.CommandButton

Button for a SessionCommand that will be shown by the controller.

It's up to the controller's decision to respect or ignore this customization request.

Summary

Nested classes

Builder for CommandButton.

Public methods
SessionCommand?

Gets the command associated with this button.

CharSequence?

Gets the display name of the button.

Bundle?

Gets extra information of the button.

Int

Gets the resource id of the button in this package.

Boolean

Returns whether it's enabled.

Public methods

getCommand

@Nullable fun getCommand(): SessionCommand?

Gets the command associated with this button. Can be null if the button isn't enabled and only providing placeholder.

Return
SessionCommand? command or null

getDisplayName

@Nullable fun getDisplayName(): CharSequence?

Gets the display name of the button. Can be null or empty if the command is predefined and custom name isn't needed.

Return
CharSequence? custom display name. Can be null or empty.

getExtras

@Nullable fun getExtras(): Bundle?

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

Return
Bundle?

getIconResId

fun getIconResId(): Int

Gets the resource id of the button in this package. Can be 0 if the command is predefined and custom icon isn't needed.

Return
Int resource id of the icon. Can be 0.

isEnabled

fun isEnabled(): Boolean

Returns whether it's enabled.

Return
Boolean true if enabled. false otherwise.