mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-04 20:42:48 +02:00
refacctoring
This commit is contained in:
@@ -605,11 +605,11 @@ private fun pollCurrentDuration(controller: MediaController) = flow {
|
|||||||
fun Waveform(
|
fun Waveform(
|
||||||
waveform: ImmutableList<Int>,
|
waveform: ImmutableList<Int>,
|
||||||
controller: MediaController,
|
controller: MediaController,
|
||||||
align: Modifier
|
modifier: Modifier
|
||||||
) {
|
) {
|
||||||
val waveformProgress = remember { mutableStateOf(0F) }
|
val waveformProgress = remember { mutableStateOf(0F) }
|
||||||
|
|
||||||
DrawWaveform(waveform, waveformProgress, align)
|
DrawWaveform(waveform, waveformProgress, modifier)
|
||||||
|
|
||||||
val restartFlow = remember {
|
val restartFlow = remember {
|
||||||
mutableStateOf(0)
|
mutableStateOf(0)
|
||||||
@@ -641,9 +641,9 @@ fun Waveform(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun DrawWaveform(waveform: ImmutableList<Int>, waveformProgress: MutableState<Float>, align: Modifier) {
|
fun DrawWaveform(waveform: ImmutableList<Int>, waveformProgress: MutableState<Float>, modifier: Modifier) {
|
||||||
AudioWaveformReadOnly(
|
AudioWaveformReadOnly(
|
||||||
modifier = align.padding(start = 10.dp, end = 10.dp),
|
modifier = modifier.padding(start = 10.dp, end = 10.dp),
|
||||||
amplitudes = waveform,
|
amplitudes = waveform,
|
||||||
progress = waveformProgress.value,
|
progress = waveformProgress.value,
|
||||||
progressBrush = Brush.infiniteLinearGradient(
|
progressBrush = Brush.infiniteLinearGradient(
|
||||||
|
Reference in New Issue
Block a user