Gordon
04/03/2022, 8:20 AMval currentAnimValue = remember { Animatable(0f) }
//if i put this inside my dragEnd i get: Composable invocations can only happen from the context of a @Composable function
LaunchedEffect(value) {
currentAnimValue.animateTo(value)
}
And if i do it, on function start, I can't set the current value, so the animation goes from initial value(0f in this case) not the current dragged value
val coroutineScope = rememberCoroutineScope()
And then from dragEnd:
coroutineScope.launch {
currentAnimValue.snapTo(current)
currentAnimValue.animateTo(targetValue)
}