From e9bdb65980f2915c72bdc45b9452b20670fd58ce Mon Sep 17 00:00:00 2001 From: wjdrjs00 Date: Tue, 12 Aug 2025 22:34:00 +0900 Subject: [PATCH 1/6] =?UTF-8?q?Refactor:=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=ED=99=94=EB=A9=B4=20=EB=A6=AC=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/HomeBottomNavigationBar.kt | 50 +++++++++++-------- .../component/block/BitnagilOptionButton.kt | 8 +-- .../src/main/res/drawable/ic_setting.xml | 14 ++++-- .../presentation/mypage/MyPageScreen.kt | 12 ++--- 4 files changed, 49 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/com/threegap/bitnagil/navigation/home/HomeBottomNavigationBar.kt b/app/src/main/java/com/threegap/bitnagil/navigation/home/HomeBottomNavigationBar.kt index 086cfb8f..7c480e6c 100644 --- a/app/src/main/java/com/threegap/bitnagil/navigation/home/HomeBottomNavigationBar.kt +++ b/app/src/main/java/com/threegap/bitnagil/navigation/home/HomeBottomNavigationBar.kt @@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -30,27 +31,34 @@ fun HomeBottomNavigationBar( ) { val navBackStackEntry by navController.currentBackStackEntryAsState() - Row( - modifier = Modifier - .fillMaxWidth() - .background(color = BitnagilTheme.colors.white) - .height(62.dp) - .padding(horizontal = 16.dp, vertical = 7.dp), - horizontalArrangement = Arrangement.spacedBy(10.dp), - verticalAlignment = Alignment.CenterVertically, - ) { - HomeRoute.entries.map { homeRoute -> - HomeBottomNavigationItem( - modifier = Modifier.weight(1f), - icon = homeRoute.icon, - title = homeRoute.title, - onClick = { - navController.navigate(homeRoute.route) { - popUpTo(0) { inclusive = true } - } - }, - selected = navBackStackEntry?.destination?.route == homeRoute.route, - ) + Column { + HorizontalDivider( + modifier = Modifier.fillMaxWidth(), + thickness = 1.dp, + color = BitnagilTheme.colors.coolGray98, + ) + Row( + modifier = Modifier + .fillMaxWidth() + .background(color = BitnagilTheme.colors.white) + .height(62.dp) + .padding(horizontal = 16.dp, vertical = 7.dp), + horizontalArrangement = Arrangement.spacedBy(10.dp), + verticalAlignment = Alignment.CenterVertically, + ) { + HomeRoute.entries.map { homeRoute -> + HomeBottomNavigationItem( + modifier = Modifier.weight(1f), + icon = homeRoute.icon, + title = homeRoute.title, + onClick = { + navController.navigate(homeRoute.route) { + popUpTo(0) { inclusive = true } + } + }, + selected = navBackStackEntry?.destination?.route == homeRoute.route, + ) + } } } } diff --git a/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/block/BitnagilOptionButton.kt b/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/block/BitnagilOptionButton.kt index 5c8aed22..c21409ed 100644 --- a/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/block/BitnagilOptionButton.kt +++ b/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/block/BitnagilOptionButton.kt @@ -31,14 +31,14 @@ fun BitnagilOptionButton( ) { Text( text = title, - color = BitnagilTheme.colors.black, - style = BitnagilTheme.typography.body1Regular, + color = BitnagilTheme.colors.coolGray10, + style = BitnagilTheme.typography.body1Medium, modifier = Modifier.weight(1f), ) BitnagilIcon( - id = R.drawable.ic_right_arrow_20, - tint = BitnagilTheme.colors.black, + id = R.drawable.ic_chevron_right_md, + tint = BitnagilTheme.colors.coolGray10, modifier = Modifier.padding(10.dp), ) } diff --git a/core/designsystem/src/main/res/drawable/ic_setting.xml b/core/designsystem/src/main/res/drawable/ic_setting.xml index 4eaef82b..295bd7c1 100644 --- a/core/designsystem/src/main/res/drawable/ic_setting.xml +++ b/core/designsystem/src/main/res/drawable/ic_setting.xml @@ -3,18 +3,24 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> + + diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageScreen.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageScreen.kt index edf24a46..3feabcac 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageScreen.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/mypage/MyPageScreen.kt @@ -3,6 +3,7 @@ package com.threegap.bitnagil.presentation.mypage import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height @@ -25,10 +26,9 @@ import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import com.threegap.bitnagil.designsystem.BitnagilTheme import com.threegap.bitnagil.designsystem.R -import com.threegap.bitnagil.designsystem.component.atom.BitnagilIcon +import com.threegap.bitnagil.designsystem.component.atom.BitnagilIconButton import com.threegap.bitnagil.designsystem.component.block.BitnagilOptionButton import com.threegap.bitnagil.designsystem.component.block.BitnagilTopBar -import com.threegap.bitnagil.designsystem.modifier.clickableWithoutRipple import com.threegap.bitnagil.presentation.mypage.model.MyPageState @Composable @@ -68,11 +68,11 @@ private fun MyPageScreen( BitnagilTopBar( title = "마이페이지", actions = { - BitnagilIcon( + BitnagilIconButton( id = R.drawable.ic_setting, - modifier = Modifier - .clickableWithoutRipple(onClick = onClickSetting) - .padding(6.dp), + onClick = onClickSetting, + tint = null, + paddingValues = PaddingValues(6.dp), ) }, ) From ec3c8ba77ed3ad56b7f28684f4c38f908ef0cc26 Mon Sep 17 00:00:00 2001 From: wjdrjs00 Date: Tue, 12 Aug 2025 22:34:20 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Refactor:=20=EC=84=A4=EC=A0=95=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20=EB=A6=AC=EB=94=94=EC=9E=90=EC=9D=B8=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/setting/SettingScreen.kt | 42 +++++++------------ .../atom/settingtitle/SettingTitle.kt | 2 +- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingScreen.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingScreen.kt index 4460cc71..c3114961 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingScreen.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingScreen.kt @@ -1,7 +1,6 @@ package com.threegap.bitnagil.presentation.setting import androidx.compose.foundation.background -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -27,6 +26,7 @@ import androidx.hilt.navigation.compose.hiltViewModel import com.threegap.bitnagil.designsystem.BitnagilTheme import com.threegap.bitnagil.designsystem.component.block.BitnagilOptionButton import com.threegap.bitnagil.designsystem.component.block.BitnagilTopBar +import com.threegap.bitnagil.designsystem.modifier.clickableWithoutRipple import com.threegap.bitnagil.presentation.common.flow.collectAsEffect import com.threegap.bitnagil.presentation.setting.component.atom.settingtitle.SettingTitle import com.threegap.bitnagil.presentation.setting.component.block.ConfirmDialog @@ -116,7 +116,7 @@ private fun SettingScreen( Text( text = "버전 ", color = BitnagilTheme.colors.black, - style = BitnagilTheme.typography.body1Regular, + style = BitnagilTheme.typography.body1Medium, ) Text( text = state.version, @@ -124,30 +124,20 @@ private fun SettingScreen( style = BitnagilTheme.typography.body1SemiBold, ) } - if (state.version == state.latestVersion) { - Text( - "최신", - modifier = Modifier - .background( - color = BitnagilTheme.colors.coolGray98, - shape = RoundedCornerShape(4.dp), - ) - .padding(horizontal = 10.dp, vertical = 5.dp), - style = BitnagilTheme.typography.button2.copy(color = BitnagilTheme.colors.coolGray70), - ) - } else { - Text( - "업데이트", - modifier = Modifier - .background( - color = BitnagilTheme.colors.lightBlue200, - shape = RoundedCornerShape(4.dp), - ) - .clickable(onClick = onClickUpdate) - .padding(horizontal = 10.dp, vertical = 5.dp), - style = BitnagilTheme.typography.button2.copy(color = BitnagilTheme.colors.navy500), - ) - } + + val isLatest = state.version == state.latestVersion + Text( + text = if (isLatest) "최신" else "업데이트", + color = if (isLatest) BitnagilTheme.colors.coolGray70 else BitnagilTheme.colors.orange500, + style = BitnagilTheme.typography.button2, + modifier = Modifier + .background( + color = if (isLatest) BitnagilTheme.colors.coolGray98 else BitnagilTheme.colors.orange50, + shape = RoundedCornerShape(8.dp), + ) + .let { if (!isLatest) it.clickableWithoutRipple(onClick = onClickUpdate) else it } + .padding(horizontal = 10.dp, vertical = 5.dp), + ) } BitnagilOptionButton( diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/atom/settingtitle/SettingTitle.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/atom/settingtitle/SettingTitle.kt index 53570202..529122f9 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/atom/settingtitle/SettingTitle.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/atom/settingtitle/SettingTitle.kt @@ -15,6 +15,6 @@ fun SettingTitle( Text( title, modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 3.dp), - style = BitnagilTheme.typography.caption1SemiBold.copy(color = BitnagilTheme.colors.coolGray50), + style = BitnagilTheme.typography.caption1SemiBold.copy(color = BitnagilTheme.colors.coolGray60), ) } From 00834647d4bb6af7c52adb49f9c9c6cbc9e5237a Mon Sep 17 00:00:00 2001 From: wjdrjs00 Date: Wed, 13 Aug 2025 17:53:04 +0900 Subject: [PATCH 3/6] =?UTF-8?q?Refactor:=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83,=20=ED=9A=8C=EC=9B=90=ED=83=88=ED=87=B4=20=EB=8B=A4?= =?UTF-8?q?=EC=9D=B4=EC=96=BC=EB=A1=9C=EA=B7=B8=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 로그아웃 다이얼로그 디자인 수정 - 회원탈퇴 로직 제거 --- .../component/atom/BitnagilTextButton.kt | 10 +++ .../main/res/drawable/ic_modal_warning.xml | 18 ------ .../presentation/setting/SettingScreen.kt | 13 ++-- .../presentation/setting/SettingViewModel.kt | 63 ++++--------------- ...onfirmDialog.kt => LogoutConfirmDialog.kt} | 58 ++++++----------- .../setting/model/ConfirmDialogType.kt | 18 ------ .../setting/model/mvi/SettingIntent.kt | 6 +- .../setting/model/mvi/SettingState.kt | 5 +- 8 files changed, 50 insertions(+), 141 deletions(-) delete mode 100644 core/designsystem/src/main/res/drawable/ic_modal_warning.xml rename presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/block/{ConfirmDialog.kt => LogoutConfirmDialog.kt} (55%) delete mode 100644 presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/ConfirmDialogType.kt diff --git a/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilTextButton.kt b/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilTextButton.kt index f4096627..d1fb0c9a 100644 --- a/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilTextButton.kt +++ b/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/component/atom/BitnagilTextButton.kt @@ -110,6 +110,16 @@ data class BitnagilTextButtonColor( pressedTextColor = BitnagilTheme.colors.navy500, disabledTextColor = BitnagilTheme.colors.navy500, ) + + @Composable + fun cancel(): BitnagilTextButtonColor = BitnagilTextButtonColor( + defaultBackgroundColor = BitnagilTheme.colors.coolGray97, + pressedBackgroundColor = BitnagilTheme.colors.coolGray97, + disabledBackgroundColor = BitnagilTheme.colors.coolGray97, + defaultTextColor = BitnagilTheme.colors.coolGray40, + pressedTextColor = BitnagilTheme.colors.coolGray40, + disabledTextColor = BitnagilTheme.colors.coolGray40, + ) } } diff --git a/core/designsystem/src/main/res/drawable/ic_modal_warning.xml b/core/designsystem/src/main/res/drawable/ic_modal_warning.xml deleted file mode 100644 index 38d03a9a..00000000 --- a/core/designsystem/src/main/res/drawable/ic_modal_warning.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingScreen.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingScreen.kt index c3114961..e727bfbf 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingScreen.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingScreen.kt @@ -29,7 +29,7 @@ import com.threegap.bitnagil.designsystem.component.block.BitnagilTopBar import com.threegap.bitnagil.designsystem.modifier.clickableWithoutRipple import com.threegap.bitnagil.presentation.common.flow.collectAsEffect import com.threegap.bitnagil.presentation.setting.component.atom.settingtitle.SettingTitle -import com.threegap.bitnagil.presentation.setting.component.block.ConfirmDialog +import com.threegap.bitnagil.presentation.setting.component.block.LogoutConfirmDialog import com.threegap.bitnagil.presentation.setting.model.mvi.SettingSideEffect import com.threegap.bitnagil.presentation.setting.model.mvi.SettingState @@ -49,11 +49,10 @@ fun SettingScreenContainer( } } - state.showConfirmDialog?.let { dialogType -> - ConfirmDialog( - type = dialogType, + if (state.logoutConfirmDialogVisible) { + LogoutConfirmDialog( onDismiss = viewModel::hideConfirmDialog, - onConfirm = viewModel::confirmDialogAction, + onConfirm = viewModel::logout, ) } @@ -66,7 +65,7 @@ fun SettingScreenContainer( onClickTermsOfService = navigateToTermsOfService, onClickPrivacyPolicy = navigateToPrivacyPolicy, onClickLogout = viewModel::showLogoutDialog, - onClickWithdrawal = viewModel::showWithdrawalDialog, + onClickWithdrawal = {}, ) } @@ -181,7 +180,7 @@ fun SettingScreenPreview() { version = "1.0.1", latestVersion = "1.0.0", loading = false, - showConfirmDialog = null, + logoutConfirmDialogVisible = false, ), toggleServiceAlarm = {}, togglePushAlarm = {}, diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt index 539a00cb..03f9e827 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt @@ -3,9 +3,7 @@ package com.threegap.bitnagil.presentation.setting import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.viewModelScope import com.threegap.bitnagil.domain.auth.usecase.LogoutUseCase -import com.threegap.bitnagil.domain.auth.usecase.WithdrawalUseCase import com.threegap.bitnagil.presentation.common.mviviewmodel.MviViewModel -import com.threegap.bitnagil.presentation.setting.model.ConfirmDialogType import com.threegap.bitnagil.presentation.setting.model.mvi.SettingIntent import com.threegap.bitnagil.presentation.setting.model.mvi.SettingSideEffect import com.threegap.bitnagil.presentation.setting.model.mvi.SettingState @@ -20,7 +18,6 @@ import javax.inject.Inject class SettingViewModel @Inject constructor( savedStateHandle: SavedStateHandle, private val logoutUseCase: LogoutUseCase, - private val withdrawalUseCase: WithdrawalUseCase, ) : MviViewModel( initState = SettingState.Init, savedStateHandle = savedStateHandle, @@ -49,57 +46,45 @@ class SettingViewModel @Inject constructor( } is SettingIntent.ShowConfirmDialog -> { - return state.copy(showConfirmDialog = intent.type) + return state.copy(logoutConfirmDialogVisible = true) } is SettingIntent.HideConfirmDialog -> { - return state.copy(showConfirmDialog = null) + return state.copy(logoutConfirmDialogVisible = false) } SettingIntent.LogoutSuccess -> { sendSideEffect(SettingSideEffect.NavigateToLogin) return null } + SettingIntent.LogoutLoading -> { return state.copy(loading = true) } + SettingIntent.LogoutFailure -> { return state.copy(loading = false) } - SettingIntent.WithdrawalSuccess -> { - sendSideEffect(SettingSideEffect.NavigateToLogin) - return null - } - SettingIntent.WithdrawalLoading -> { - return state.copy(loading = true) - } - SettingIntent.WithdrawalFailure -> { - return state.copy(loading = false) - } } } fun showLogoutDialog() { - sendIntent(SettingIntent.ShowConfirmDialog(ConfirmDialogType.LOGOUT)) - } - - fun showWithdrawalDialog() { - sendIntent(SettingIntent.ShowConfirmDialog(ConfirmDialogType.WITHDRAW)) + sendIntent(SettingIntent.ShowConfirmDialog) } fun hideConfirmDialog() { sendIntent(SettingIntent.HideConfirmDialog) } - fun confirmDialogAction() { - val currentDialogType = container.stateFlow.value.showConfirmDialog - + fun logout() { sendIntent(SettingIntent.HideConfirmDialog) - - when (currentDialogType) { - ConfirmDialogType.LOGOUT -> executeLogout() - ConfirmDialogType.WITHDRAW -> executeWithdrawal() - null -> {} + viewModelScope.launch { + sendIntent(SettingIntent.LogoutLoading) + logoutUseCase().onSuccess { + sendIntent(SettingIntent.LogoutSuccess) + }.onFailure { + sendIntent(SettingIntent.LogoutFailure) + } } } @@ -118,26 +103,4 @@ class SettingViewModel @Inject constructor( delay(1000L) } } - - private fun executeLogout() { - viewModelScope.launch { - sendIntent(SettingIntent.LogoutLoading) - logoutUseCase().onSuccess { - sendIntent(SettingIntent.LogoutSuccess) - }.onFailure { - sendIntent(SettingIntent.LogoutFailure) - } - } - } - - private fun executeWithdrawal() { - viewModelScope.launch { - sendIntent(SettingIntent.WithdrawalLoading) - withdrawalUseCase().onSuccess { - sendIntent(SettingIntent.WithdrawalSuccess) - }.onFailure { - sendIntent(SettingIntent.WithdrawalFailure) - } - } - } } diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/block/ConfirmDialog.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/block/LogoutConfirmDialog.kt similarity index 55% rename from presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/block/ConfirmDialog.kt rename to presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/block/LogoutConfirmDialog.kt index 6de79180..efe64301 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/block/ConfirmDialog.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/component/block/LogoutConfirmDialog.kt @@ -1,35 +1,28 @@ package com.threegap.bitnagil.presentation.setting.component.block import androidx.compose.foundation.background -import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.BasicAlertDialog import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.window.DialogProperties import com.threegap.bitnagil.designsystem.BitnagilTheme -import com.threegap.bitnagil.designsystem.R -import com.threegap.bitnagil.designsystem.component.atom.BitnagilIcon import com.threegap.bitnagil.designsystem.component.atom.BitnagilTextButton import com.threegap.bitnagil.designsystem.component.atom.BitnagilTextButtonColor -import com.threegap.bitnagil.presentation.setting.model.ConfirmDialogType @OptIn(ExperimentalMaterial3Api::class) @Composable -fun ConfirmDialog( - type: ConfirmDialogType, +fun LogoutConfirmDialog( onDismiss: () -> Unit, onConfirm: () -> Unit, modifier: Modifier = Modifier, @@ -46,57 +39,43 @@ fun ConfirmDialog( modifier = Modifier .background( color = BitnagilTheme.colors.white, - shape = RoundedCornerShape(20.dp), + shape = RoundedCornerShape(12.dp), ) - .padding(vertical = 24.dp, horizontal = 16.dp), + .padding(vertical = 20.dp, horizontal = 24.dp), verticalArrangement = Arrangement.Center, - horizontalAlignment = Alignment.CenterHorizontally, ) { - BitnagilIcon( - id = R.drawable.ic_modal_warning, - tint = null, - modifier = Modifier.size(55.dp), - ) - - Spacer(modifier = Modifier.height(18.dp)) - Text( - text = type.titleText, + text = "로그아웃할까요?", color = BitnagilTheme.colors.coolGray10, - style = BitnagilTheme.typography.title2Bold, + style = BitnagilTheme.typography.subtitle1SemiBold, ) - Spacer(modifier = Modifier.height(2.dp)) + Spacer(modifier = Modifier.height(6.dp)) Text( - text = type.descriptionText, - color = BitnagilTheme.colors.coolGray10, - style = BitnagilTheme.typography.caption1Regular, + text = "이 기기에서 계정이 로그아웃되고, 다시\n로그인해야 서비스를 계속 이용할 수 있어요.", + color = BitnagilTheme.colors.coolGray40, + style = BitnagilTheme.typography.body2Medium, ) Spacer(modifier = Modifier.height(18.dp)) Row( - modifier = Modifier.height(44.dp), - horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.height(48.dp), + horizontalArrangement = Arrangement.spacedBy(12.dp), ) { BitnagilTextButton( text = "취소", onClick = onDismiss, - colors = BitnagilTextButtonColor.skip(), - modifier = Modifier - .weight(1f) - .border( - width = 1.dp, - color = BitnagilTheme.colors.navy500, - shape = RoundedCornerShape(8.dp), - ), + colors = BitnagilTextButtonColor.cancel(), + textStyle = BitnagilTheme.typography.body2Medium, + modifier = Modifier.weight(1f), ) BitnagilTextButton( - text = type.confirmButtonText, + text = "로그아웃", onClick = onConfirm, - shape = RoundedCornerShape(8.dp), + textStyle = BitnagilTheme.typography.body2Medium, modifier = Modifier.weight(1f), ) } @@ -106,9 +85,8 @@ fun ConfirmDialog( @Preview @Composable -private fun ConfirmDialogPreview() { - ConfirmDialog( - type = ConfirmDialogType.LOGOUT, +private fun LogoutConfirmDialogPreview() { + LogoutConfirmDialog( onDismiss = {}, onConfirm = {}, ) diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/ConfirmDialogType.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/ConfirmDialogType.kt deleted file mode 100644 index c26c4cbd..00000000 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/ConfirmDialogType.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.threegap.bitnagil.presentation.setting.model - -enum class ConfirmDialogType( - val titleText: String, - val descriptionText: String, - val confirmButtonText: String, -) { - LOGOUT( - titleText = "로그아웃 하시겠어요?", - descriptionText = "버튼을 누르면 로그인 페이지로 이동해요.", - confirmButtonText = "로그아웃", - ), - WITHDRAW( - titleText = "정말 탈퇴하시겠어요?", - descriptionText = "소중한 기록들이 모두 사라져요.", - confirmButtonText = "탈퇴하기", - ), -} diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingIntent.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingIntent.kt index 9438f5d4..5358865f 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingIntent.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingIntent.kt @@ -1,7 +1,6 @@ package com.threegap.bitnagil.presentation.setting.model.mvi import com.threegap.bitnagil.presentation.common.mviviewmodel.MviIntent -import com.threegap.bitnagil.presentation.setting.model.ConfirmDialogType sealed class SettingIntent : MviIntent { data class LoadSettingSuccess( @@ -11,14 +10,11 @@ sealed class SettingIntent : MviIntent { val latestVersion: String, ) : SettingIntent() - data class ShowConfirmDialog(val type: ConfirmDialogType) : SettingIntent() + data object ShowConfirmDialog : SettingIntent() data object HideConfirmDialog : SettingIntent() data object ToggleServiceAlarm : SettingIntent() data object TogglePushAlarm : SettingIntent() data object LogoutLoading : SettingIntent() data object LogoutSuccess : SettingIntent() data object LogoutFailure : SettingIntent() - data object WithdrawalLoading : SettingIntent() - data object WithdrawalSuccess : SettingIntent() - data object WithdrawalFailure : SettingIntent() } diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingState.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingState.kt index a0b7166b..47b30630 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingState.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingState.kt @@ -1,7 +1,6 @@ package com.threegap.bitnagil.presentation.setting.model.mvi import com.threegap.bitnagil.presentation.common.mviviewmodel.MviState -import com.threegap.bitnagil.presentation.setting.model.ConfirmDialogType import kotlinx.parcelize.Parcelize @Parcelize @@ -11,7 +10,7 @@ data class SettingState( val version: String, val latestVersion: String, val loading: Boolean, - val showConfirmDialog: ConfirmDialogType?, + val logoutConfirmDialogVisible: Boolean, ) : MviState { companion object { val Init = SettingState( @@ -20,7 +19,7 @@ data class SettingState( version = "", latestVersion = "", loading = false, - showConfirmDialog = null, + logoutConfirmDialogVisible = false, ) } } From b61c73b583c732fd4fdc8399ea25ac7472d32c90 Mon Sep 17 00:00:00 2001 From: wjdrjs00 Date: Wed, 13 Aug 2025 18:13:22 +0900 Subject: [PATCH 4/6] =?UTF-8?q?Refactor:=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=A4=91=EB=B3=B5=20=ED=81=B4=EB=A6=AD=20=EB=B0=A9?= =?UTF-8?q?=EC=A7=80=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/setting/SettingViewModel.kt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt index 03f9e827..e65ee24e 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt @@ -77,14 +77,19 @@ class SettingViewModel @Inject constructor( } fun logout() { + if (container.stateFlow.value.loading) return + sendIntent(SettingIntent.HideConfirmDialog) viewModelScope.launch { sendIntent(SettingIntent.LogoutLoading) - logoutUseCase().onSuccess { - sendIntent(SettingIntent.LogoutSuccess) - }.onFailure { - sendIntent(SettingIntent.LogoutFailure) - } + logoutUseCase().fold( + onSuccess = { + sendIntent(SettingIntent.LogoutSuccess) + }, + onFailure = { + sendIntent(SettingIntent.LogoutFailure) + }, + ) } } From 7c7cbc54e9fcdb3cb55e37e973d87e0bd4243dfc Mon Sep 17 00:00:00 2001 From: wjdrjs00 Date: Wed, 13 Aug 2025 18:21:43 +0900 Subject: [PATCH 5/6] =?UTF-8?q?Refactor:=20=EB=A1=9C=EB=94=A9=20=ED=98=B8?= =?UTF-8?q?=EC=B6=9C=20=EC=9C=84=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../threegap/bitnagil/presentation/setting/SettingViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt index e65ee24e..fe174569 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt @@ -80,8 +80,8 @@ class SettingViewModel @Inject constructor( if (container.stateFlow.value.loading) return sendIntent(SettingIntent.HideConfirmDialog) + sendIntent(SettingIntent.LogoutLoading) viewModelScope.launch { - sendIntent(SettingIntent.LogoutLoading) logoutUseCase().fold( onSuccess = { sendIntent(SettingIntent.LogoutSuccess) From 932081fe886fc3757141afabe404a1cf1807ac65 Mon Sep 17 00:00:00 2001 From: wjdrjs00 Date: Wed, 13 Aug 2025 19:28:40 +0900 Subject: [PATCH 6/6] =?UTF-8?q?Chore:=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ShowConfirmDialog -> ShowLogoutConfirmDialog --- .../bitnagil/presentation/setting/SettingViewModel.kt | 4 ++-- .../bitnagil/presentation/setting/model/mvi/SettingIntent.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt index fe174569..e97f0776 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt @@ -45,7 +45,7 @@ class SettingViewModel @Inject constructor( return state.copy(useServiceAlarm = !state.useServiceAlarm) } - is SettingIntent.ShowConfirmDialog -> { + is SettingIntent.ShowLogoutConfirmDialog -> { return state.copy(logoutConfirmDialogVisible = true) } @@ -69,7 +69,7 @@ class SettingViewModel @Inject constructor( } fun showLogoutDialog() { - sendIntent(SettingIntent.ShowConfirmDialog) + sendIntent(SettingIntent.ShowLogoutConfirmDialog) } fun hideConfirmDialog() { diff --git a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingIntent.kt b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingIntent.kt index 5358865f..c16591a4 100644 --- a/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingIntent.kt +++ b/presentation/src/main/java/com/threegap/bitnagil/presentation/setting/model/mvi/SettingIntent.kt @@ -10,7 +10,7 @@ sealed class SettingIntent : MviIntent { val latestVersion: String, ) : SettingIntent() - data object ShowConfirmDialog : SettingIntent() + data object ShowLogoutConfirmDialog : SettingIntent() data object HideConfirmDialog : SettingIntent() data object ToggleServiceAlarm : SettingIntent() data object TogglePushAlarm : SettingIntent()