Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
data class VolumeUiState(val current: Int = 0, val max: Int = 1, val min: Int = 0)

A UI state for volume.

Link copied to clipboard
open class VolumeViewModel(volumeRepository: VolumeRepository, audioOutputRepository: AudioOutputRepository, onCleared: () -> Unit = {}, vibrator: Vibrator) : ViewModel

ViewModel for a Volume Control Screen.

Functions

Link copied to clipboard
fun Modifier.highResRotaryVolumeControls(volumeUiStateProvider: () -> VolumeUiState, onRotaryVolumeInput: (Int) -> Unit, localView: View): Modifier

A high resolution rotary volume modifier, that uses convertPixelToVolume to convert accumulated scrolled pixels to volume to pass into onRotaryVolumeInput for a corresponding volume change

Link copied to clipboard
fun Modifier.lowResRotaryVolumeControls(volumeUiStateProvider: () -> VolumeUiState, onRotaryVolumeInput: (Int) -> Unit, localView: View): Modifier

A low resolution rotary volume modifier, that treats the accumulated input with 1:1 volume change to pass into onRotaryVolumeInput for a corresponding volume change. E.g. 2f change would increase volume by 2 and -3f change would decrease volume by 3.

Link copied to clipboard
fun Modifier.rotaryVolumeControlsWithFocus(focusRequester: FocusRequester? = null, volumeUiStateProvider: () -> VolumeUiState, onRotaryVolumeInput: (Int) -> Unit, localView: View, isLowRes: Boolean): Modifier

A Focusable modifier, that depending on rotary resolution (by isLowRes parameter), accumulates the input by onRotaryInputAccumulated modifier, and converts the accumulated input into a target volume to pass into onRotaryVolumeInput for a corresponding volume change.

Link copied to clipboard
fun VolumePositionIndicator(volumeUiState: () -> VolumeUiState, modifier: Modifier = Modifier, displayIndicatorEvents: Flow<Unit>? = null, color: Color = MaterialTheme.colors.secondary)

A PositionIndicator that is tied to the system audio volume.

Link copied to clipboard
fun VolumeScreen(modifier: Modifier = Modifier, volumeViewModel: VolumeViewModel = viewModel(factory = VolumeViewModel.Factory), showVolumeIndicator: Boolean = true, increaseIcon: @Composable () -> Unit = { VolumeScreenDefaults.IncreaseIcon() }, decreaseIcon: @Composable () -> Unit = { VolumeScreenDefaults.DecreaseIcon() })

Volume Screen with an InlineSlider and Increase/Decrease buttons for the Audio Stream Volume.

fun VolumeScreen(volume: () -> VolumeUiState, audioOutputUi: AudioOutputUi, increaseVolume: () -> Unit, decreaseVolume: () -> Unit, onAudioOutputClick: () -> Unit, modifier: Modifier = Modifier, increaseIcon: @Composable () -> Unit = { VolumeScreenDefaults.IncreaseIcon() }, decreaseIcon: @Composable () -> Unit = { VolumeScreenDefaults.DecreaseIcon() }, showVolumeIndicator: Boolean = true)

Volume Screen with a Output Device chip.

Link copied to clipboard
fun VolumeWithLabelScreen(volume: () -> VolumeUiState, increaseVolume: () -> Unit, decreaseVolume: () -> Unit, modifier: Modifier = Modifier, increaseIcon: @Composable () -> Unit = { VolumeScreenDefaults.IncreaseIcon() }, decreaseIcon: @Composable () -> Unit = { VolumeScreenDefaults.DecreaseIcon() }, showVolumeIndicator: Boolean = true, volumeColor: Color = MaterialTheme.colors.secondary)

Volume Screen with a simple "Volume" label.