From e58003abd2c772589de21208bf142761b2f63cda Mon Sep 17 00:00:00 2001 From: yangsooplus Date: Fri, 16 Feb 2024 15:55:01 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20LoginScreen=20UI=EC=97=90=20=EC=98=A8?= =?UTF-8?q?=EB=B3=B4=EB=94=A9=20=ED=88=AC=ED=91=9C=20=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/repository/OnboardRepositoryImpl.kt | 2 +- .../loginsignup/login/LoginArchGraph.kt | 2 +- .../feature/loginsignup/login/LoginScreen.kt | 20 ++++++++++++++++--- .../src/main/res/values/strings.xml | 3 +++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/data/src/main/java/com/susu/data/data/repository/OnboardRepositoryImpl.kt b/data/src/main/java/com/susu/data/data/repository/OnboardRepositoryImpl.kt index c5b39d36..cfbc8e78 100644 --- a/data/src/main/java/com/susu/data/data/repository/OnboardRepositoryImpl.kt +++ b/data/src/main/java/com/susu/data/data/repository/OnboardRepositoryImpl.kt @@ -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(), ) } } diff --git a/feature/loginsignup/src/main/java/com/susu/feature/loginsignup/login/LoginArchGraph.kt b/feature/loginsignup/src/main/java/com/susu/feature/loginsignup/login/LoginArchGraph.kt index 75b0f322..91449474 100644 --- a/feature/loginsignup/src/main/java/com/susu/feature/loginsignup/login/LoginArchGraph.kt +++ b/feature/loginsignup/src/main/java/com/susu/feature/loginsignup/login/LoginArchGraph.kt @@ -27,7 +27,7 @@ fun LoginArchGraph( ) { val fillAngle = remember { Animatable(fillFrom) } - LaunchedEffect(key1 = Unit) { + LaunchedEffect(key1 = fillUntil) { fillAngle.animateTo( targetValue = fillUntil, animationSpec = tween( diff --git a/feature/loginsignup/src/main/java/com/susu/feature/loginsignup/login/LoginScreen.kt b/feature/loginsignup/src/main/java/com/susu/feature/loginsignup/login/LoginScreen.kt index e004dfbc..c61593b8 100644 --- a/feature/loginsignup/src/main/java/com/susu/feature/loginsignup/login/LoginScreen.kt +++ b/feature/loginsignup/src/main/java/com/susu/feature/loginsignup/login/LoginScreen.kt @@ -135,7 +135,10 @@ 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)) @@ -143,7 +146,14 @@ fun LoginScreen( 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) } @@ -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) } diff --git a/feature/loginsignup/src/main/res/values/strings.xml b/feature/loginsignup/src/main/res/values/strings.xml index 7931166a..0404248a 100644 --- a/feature/loginsignup/src/main/res/values/strings.xml +++ b/feature/loginsignup/src/main/res/values/strings.xml @@ -10,6 +10,9 @@ 수수 가입자 이 적당하다고 답했어요 + %s%% + \?만원 + \? 친구의 결혼식, 축의금 "은 "