VolumeButton

fun VolumeButton(onVolumeClick: () -> Unit, modifier: Modifier = Modifier, imageVector: ImageVector = Icons.Rounded.Radio, enabled: Boolean = true, alignment: Alignment = Alignment.Center, buttonColors: IconButtonColors = SettingsButtonDefaults.buttonColors(), contentDescription: String = stringResource(ModelR.string.horologist_set_volume_content_description), border: BorderStroke? = null)

A composable function that creates a volume button.

Parameters

onVolumeClick

The callback invoked when the button is clicked.

modifier

The modifier to be applied to the button.

imageVector

The ImageVector to be used for the button's icon.

enabled

Controls the enabled state of the button. When false, the button will not respond to user input.

alignment

The alignment of the button within the tap area.

buttonColors

The colors to be used for the button.

contentDescription

The content description to be used for the button.


fun VolumeButton(onVolumeClick: () -> Unit, modifier: Modifier = Modifier, volumeUiState: VolumeUiState?, enabled: Boolean = true, alignment: Alignment = Alignment.Center, buttonColors: IconButtonColors = SettingsButtonDefaults.buttonColors(), contentDescription: String = stringResource(ModelR.string.horologist_set_volume_content_description), border: BorderStroke? = null)

A composable function that creates a volume button with dynamic icon based on the volumeUiState.

The button's icon changes depending on the volume state provided. If the volume is at its minimum, the button displays a mute icon. If the volume is not at its maximum, the button shows a volume down icon. In all other cases, including when no volume state is provided or the volume is at its maximum, the button displays a volume up icon..

Parameters

onVolumeClick

The callback invoked when the button is clicked.

modifier

The modifier to be applied to the button.

volumeUiState

The state of the volume UI, used to determine the button's icon.

enabled

Controls the enabled state of the button. When false, the button will not respond to user input.

alignment

The alignment of the button within the tap area.

buttonColors

The colors to be used for the button.

contentDescription

The content description to be used for the button.