This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun RowScope.WaveForm(progress: List<Float>) { | |
// State to track the horizontal offset for the animation | |
var offsetState by remember { mutableStateOf(0f) } | |
val itemWidth = with(LocalDensity.current) { 4.dp.toPx() } | |
val padding = with(LocalDensity.current) { 1.dp.toPx() } | |
// Animate the offset change | |
val animatedOffset by animateFloatAsState( | |
targetValue = offsetState, | |
animationSpec = tween( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package se.sabumbi.vacapp.audio | |
import kotlinx.cinterop.CPointer | |
import kotlinx.cinterop.ExperimentalForeignApi | |
import kotlinx.cinterop.ObjCObjectVar | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.IO | |
import kotlinx.coroutines.Job | |
import kotlinx.coroutines.flow.MutableStateFlow |
OlderNewer