Skip to content

Commit

Permalink
fix: LoginScreen UI에 온보딩 투표 결과 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsooplus committed Feb 16, 2024
1 parent b3964ea commit e58003a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class OnboardRepositoryImpl @Inject constructor(

return OnboardVote(
mostContent = mostOption.content,
mostPercentage = mostOption.count / result.sumOf { it.count } * 100,
mostPercentage = (mostOption.count.toFloat() / result.sumOf { it.count } * 100).toInt(),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fun LoginArchGraph(
) {
val fillAngle = remember { Animatable(fillFrom) }

LaunchedEffect(key1 = Unit) {
LaunchedEffect(key1 = fillUntil) {
fillAngle.animateTo(
targetValue = fillUntil,
animationSpec = tween(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,25 @@ fun LoginScreen(
Text(text = stringResource(R.string.login_sub_header), style = SusuTheme.typography.title_m, color = Gray50)
Spacer(modifier = Modifier.height(64.dp))

LoginArchGraph(modifier = Modifier.size(200.dp))
LoginArchGraph(
modifier = Modifier.size(200.dp),
fillUntil = uiState.onboardVote?.let { it.mostPercentage.toFloat() / 100f } ?: 0f,
)

Spacer(modifier = Modifier.height(SusuTheme.spacing.spacing_xxxxl))

Row(
horizontalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxxxs),
) {
Text(text = stringResource(R.string.login_statistics_1), style = SusuTheme.typography.title_s)
LoginBlankText(text = "87%", state = transitionState) // TODO: 임시 하드코딩
LoginBlankText(
text = stringResource(
id = R.string.login_percentage_format,
uiState.onboardVote?.mostPercentage?.toString()
?: stringResource(id = R.string.login_statistics_unknown_percentage),
),
state = transitionState,
)
Text(text = stringResource(R.string.login_statistics_2), style = SusuTheme.typography.title_s)
}

Expand All @@ -152,7 +162,11 @@ fun LoginScreen(
Row(
horizontalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxxxs),
) {
LoginBlankText(text = "10만원", state = transitionState) // TODO: 임시 하드코딩
LoginBlankText(
text = uiState.onboardVote?.mostContent
?: stringResource(id = R.string.login_statistics_unknown_content),
state = transitionState,
)
Text(text = stringResource(R.string.login_statistics_3), style = SusuTheme.typography.title_s)
}

Expand Down
3 changes: 3 additions & 0 deletions feature/loginsignup/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<string name="login_statistics_1">수수 가입자</string>
<string name="login_statistics_2">는</string>
<string name="login_statistics_3">이 적당하다고 답했어요</string>
<string name="login_percentage_format">%s%%</string>
<string name="login_statistics_unknown_content">\?만원</string>
<string name="login_statistics_unknown_percentage">\?</string>
<string name="signup_vote_question_1">친구의 결혼식,</string>
<string name="signup_vote_question_2">축의금</string>
<string name="signup_vote_question_3">"은 "</string>
Expand Down

0 comments on commit e58003a

Please sign in to comment.