Skip to content

Commit

Permalink
[REFACTOR] #125 : 모든 ProgressBar Animation으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Feb 16, 2024
1 parent d09185a commit 8e0c8ea
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.wap.wapp.feature.management.event.edit

import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.spring
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -260,13 +263,21 @@ private fun EventEditStateText(
private fun EventEditStateProgressBar(
currentRegistrationProgress: Float,
) {
val progress by animateFloatAsState(
targetValue = currentRegistrationProgress,
animationSpec = spring(
stiffness = Spring.StiffnessMediumLow,
dampingRatio = Spring.DampingRatioMediumBouncy,
),
)

LinearProgressIndicator(
modifier = Modifier
.fillMaxWidth()
.height(10.dp),
color = WappTheme.colors.yellow34,
trackColor = WappTheme.colors.white,
progress = currentRegistrationProgress,
progress = progress,
strokeCap = StrokeCap.Round,
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.wap.wapp.feature.management.event.registration

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
Expand Down Expand Up @@ -227,13 +230,21 @@ private fun EventRegistrationStateText(
private fun EventRegistrationStateProgressBar(
currentRegistrationProgress: Float,
) {
val progress by animateFloatAsState(
targetValue = currentRegistrationProgress,
animationSpec = spring(
stiffness = Spring.StiffnessMediumLow,
dampingRatio = Spring.DampingRatioMediumBouncy,
),
)

LinearProgressIndicator(
modifier = Modifier
.fillMaxWidth()
.height(10.dp),
color = WappTheme.colors.yellow34,
trackColor = WappTheme.colors.white,
progress = currentRegistrationProgress,
progress = progress,
strokeCap = StrokeCap.Round,
)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.wap.wapp.feature.management.survey

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
Expand All @@ -8,6 +11,7 @@ import androidx.compose.foundation.layout.height
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
Expand Down Expand Up @@ -52,13 +56,21 @@ private fun SurveyRegistrationStateText(
private fun SurveyRegistrationStateProgressBar(
currentRegistrationProgress: Float,
) {
val progress by animateFloatAsState(
targetValue = currentRegistrationProgress,
animationSpec = spring(
stiffness = Spring.StiffnessMediumLow,
dampingRatio = Spring.DampingRatioMediumBouncy,
),
)

LinearProgressIndicator(
modifier = Modifier
.fillMaxWidth()
.height(10.dp),
color = WappTheme.colors.yellow34,
trackColor = WappTheme.colors.white,
progress = currentRegistrationProgress,
progress = progress,
strokeCap = StrokeCap.Round,
)
}

0 comments on commit 8e0c8ea

Please sign in to comment.