CompositeMediaControl

class CompositeMediaControl(controls: List<MediaControl>) : ToggleMediaControl

Continuously picks the first visible media control from the given controls list, and delegates all calls to it. If there is no visible control, it will delegate to the last control in the list.

Can wrap MediaControl and ToggleMediaControls.

Parameters

controls

List of controls to aggregate.

Throws

when no controls are supplied.

Note: The MediaControlPriority provided to the Factory is used for all contained media controls.

Constructors

Link copied to clipboard
fun CompositeMediaControl(controls: List<MediaControl>)

Types

Link copied to clipboard
class Factory(val priority: MediaControlPriority, factories: MediaControlFactory) : MediaControlFactory

MediaControlFactory implementation that is used to create CompositeMediaControl instances.

Properties

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

Toggle-based action type.

Link copied to clipboard
open override val drawable: LiveData<DrawableResolver>

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

Link copied to clipboard
open override val isActivated: LiveData<Boolean>

Whether the associated action is currently switched on.

Link copied to clipboard
open override val isAvailable: LiveData<Boolean>

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

Link copied to clipboard
open override val isVisible: LiveData<Boolean>

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

Link copied to clipboard
open override 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 override val text: LiveData<StringResolver>

Textual description of the control.

Functions

Link copied to clipboard
open override fun launch(): Boolean

Perform the action.

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.