@UnstableApi
class MuteButtonState


State that holds all interactions to correctly deal with a UI component representing a Mute button.

Summary

Public constructors

Public functions

suspend Nothing

Subscribes to updates from Player.Events and listens to

Unit

Handles the interaction with the Mute button according to the current state of the Player.

Public properties

Boolean

determined by isCommandAvailable(Player.COMMAND_SET_VOLUME)

Boolean

determined by Player's volume being 0.0f

Public constructors

MuteButtonState

MuteButtonState(player: Player)

Public functions

observe

suspend fun observe(): Nothing

Subscribes to updates from Player.Events and listens to

onClick

fun onClick(): Unit

Handles the interaction with the Mute button according to the current state of the Player. Toggled between a muted state (volume of the Player is 0) and non-muted. Does not influence the volume of the device.

This method must only be programmatically called if the state is enabled. However, it can be freely provided into containers that take care of skipping the onClick if a particular UI node is not enabled (see Compose Clickable Modifier).

Public properties

isEnabled

val isEnabledBoolean

determined by isCommandAvailable(Player.COMMAND_SET_VOLUME)

showMuted

val showMutedBoolean

determined by Player's volume being 0.0f