diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerStateIndicator.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerStateIndicator.kt index da16a291..e00d723c 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerStateIndicator.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerStateIndicator.kt @@ -1,5 +1,8 @@ package com.wap.wapp.feature.survey.answer +import androidx.compose.animation.core.Spring +import androidx.compose.animation.core.animateFloatAsState +import androidx.compose.animation.core.spring import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -10,6 +13,7 @@ import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.StrokeCap @@ -49,10 +53,18 @@ private fun SurveyAnswerStateText(index: Int, size: Int) { @Composable private fun SurveyAnswerStateProgressBar(index: Int, size: Int) { + val progress by animateFloatAsState( + targetValue = index.toFloat() / size.toFloat(), + animationSpec = spring( + stiffness = Spring.StiffnessMediumLow, + dampingRatio = Spring.DampingRatioMediumBouncy, + ), + ) + LinearProgressIndicator( color = WappTheme.colors.yellow34, trackColor = WappTheme.colors.white, - progress = index.toFloat() / size.toFloat(), + progress = progress, strokeCap = StrokeCap.Round, modifier = Modifier .fillMaxWidth()