VolumeButtonWithBadge
A composable function that creates an audio output button with an optional badge.
Parameters
The callback invoked when the button is clicked.
The modifier to be applied to the button.
Controls the enabled state of the button. When false, the button will not respond to user input.
The alignment of the button within the tap area.
The colors to be used for the button.
The colors to be used for the badge.
The content description to be used for the button.
A composable function that creates an audio output button with an optional badge, dynamically displaying icons based on the audio output and volume states.
The default button's main icon is determined by the audio output's connection status. If the audio output is connected, the button displays the icon provided by the audio output UI state. If the audio output is disconnected, the button displays a "media output off" icon.
The default badge icon, if present, represents the volume level and is only displayed when the audio output is connected. If the volume is at its minimum, the badge displays a mute icon. If the volume is not at its maximum, the badge displays a volume down icon. Otherwise, including when the volume state is null or the volume is at its maximum, the badge displays a volume up icon. If the audio output is disconnected, no badge is displayed.
Parameters
The callback invoked when the button is clicked.
The UI state of the audio output, including connection status and icon.
The UI state of the volume, used to determine the badge icon.
The modifier to be applied to the button.
Controls the enabled state of the button. When false, the button will not respond to user input.
The alignment of the button within the tap area.
The colors to be used for the button.
The colors to be used for the badge.
The content description to be used for the button.