ToggleMediaControl

A MediaControl with two states: activated and deactivated. These will be automatically represented to the end-user by highlighting the given drawable when isActivated is true.

Inheritors

Properties

Link copied to clipboard
open override val actionType: TtButton.ActionType

Toggle-based action type.

Link copied to clipboard

Whether the associated action is currently switched on.

Inherited properties

Link copied to clipboard
abstract val drawable: LiveData<DrawableResolver?>

The icon of the control, which is used to represent the control to the user.

Link copied to clipboard

Whether or not it is possible to launch the action right now.

Link copied to clipboard

Whether the control is visible. This can be used to show the control as disabled. Defaults to isAvailable.

Link copied to clipboard
open val tag: Int?

Int resource ID to tag this MediaControl with. The tag can be used in tests to refer to one or more controls with the same tag.

Link copied to clipboard
open val text: LiveData<StringResolver>

Textual description of the control.

Inherited functions

Link copied to clipboard
open fun asIconTtButtonViewModel(): LiveData<TtButtonViewModel>

Creates a TtButtonViewModel representation of this MediaControl as an icon button. This implies only the drawable is included.

Link copied to clipboard
abstract fun launch(): Boolean

Perform the action.