Improve slider track animation

This commit is contained in:
Sad Ellie 2023-05-23 17:15:26 +03:00
parent 6922db9d6e
commit 6bb6afcbcf

View File

@ -18,6 +18,7 @@
package com.sadellie.unitto.core.ui.common package com.sadellie.unitto.core.ui.common
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.animateFloatAsState import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.spring import androidx.compose.animation.core.spring
import androidx.compose.foundation.Canvas import androidx.compose.foundation.Canvas
@ -79,7 +80,7 @@ private fun SquigglyTrack(
) { ) {
val coroutineScope = rememberCoroutineScope() val coroutineScope = rememberCoroutineScope()
var direct by remember { mutableStateOf(0.72f) } var direct by remember { mutableStateOf(0.72f) }
val animatedDirect = animateFloatAsState(direct, spring()) val animatedDirect = animateFloatAsState(direct, spring(stiffness = Spring.StiffnessLow))
val slider = sliderPosition.activeRange.endInclusive val slider = sliderPosition.activeRange.endInclusive
LaunchedEffect(sliderPosition.activeRange.endInclusive) { LaunchedEffect(sliderPosition.activeRange.endInclusive) {