VolumeViewModel

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

ViewModel for a Volume Control Screen.

Holds the state of both Volume (volumeState) and AudioOutput (audioOutput).

Volume changes can be made via increaseVolume and decreaseVolume.

See AudioManager.setStreamVolume See AudioManager.STREAM_MUSIC

Constructors

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val audioOutput: StateFlow<AudioOutput>
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setVolume(volume: Int)