From 613006083c76d43f4d4f90c6dedabf20145a5ce3 Mon Sep 17 00:00:00 2001 From: Hyeonseo4799 Date: Mon, 21 Jul 2025 19:40:21 +0900 Subject: [PATCH 1/6] =?UTF-8?q?:lipstick:=20::=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=ED=95=84=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=ED=8D=BC=EB=B8=94?= =?UTF-8?q?=EB=A6=AC=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/drawable/ic_chevron_right.xml | 20 +++ .../com/idiotfrogs/profile/ProfileScreen.kt | 137 ++++++++++++++++++ .../profile/component/ProfileHeader.kt | 66 +++++++++ .../profile/component/ProfileOption.kt | 54 +++++++ 4 files changed, 277 insertions(+) create mode 100644 common/resource/src/main/res/drawable/ic_chevron_right.xml create mode 100644 feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt create mode 100644 feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt create mode 100644 feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileOption.kt diff --git a/common/resource/src/main/res/drawable/ic_chevron_right.xml b/common/resource/src/main/res/drawable/ic_chevron_right.xml new file mode 100644 index 0000000..17a0992 --- /dev/null +++ b/common/resource/src/main/res/drawable/ic_chevron_right.xml @@ -0,0 +1,20 @@ + + + + diff --git a/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt b/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt new file mode 100644 index 0000000..ea53556 --- /dev/null +++ b/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt @@ -0,0 +1,137 @@ +package com.idiotfrogs.profile + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +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.foundation.shape.CircleShape +import androidx.compose.foundation.text.input.rememberTextFieldState +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.idiotfrogs.designsystem.component.MSText +import com.idiotfrogs.designsystem.component.MSTextField +import com.idiotfrogs.designsystem.theme.MSTheme +import com.idiotfrogs.designsystem.util.noRippleClickable +import com.idiotfrogs.designsystem.util.rememberPickerState +import com.idiotfrogs.profile.component.ProfileHeader +import com.idiotfrogs.profile.component.ProfileOption +import com.idiotfrogs.resource.R +import com.skydoves.landscapist.glide.GlideImage + +@Composable +fun ProfileScreen() { + // TODO: 추후 기존 프로필과 비교 로직 작성 + var isChanged by remember { mutableStateOf(false) } + + val (imageUri, launchImagePicker) = rememberPickerState() + val textFieldState = rememberTextFieldState() + + Column( + modifier = Modifier + .fillMaxSize() + .background(MSTheme.color.white) + .padding(horizontal = 20.dp) + ) { + ProfileHeader( + isChanged = isChanged, + onSave = { /** TODO: 저장 로직 */ } + ) + Spacer(modifier = Modifier.height(16.dp)) + imageUri?.let { + GlideImage( + imageModel = { imageUri }, + modifier = Modifier + .noRippleClickable { launchImagePicker() } + .size(128.dp) + .clip(CircleShape) + .align(Alignment.CenterHorizontally), + + ) + } ?: Image( + modifier = Modifier + .noRippleClickable { launchImagePicker() } + .size(128.dp) + .align(Alignment.CenterHorizontally), + painter = painterResource(R.drawable.img_empty_profile), + contentDescription = "Profile" + ) + Spacer(modifier = Modifier.height(16.dp)) + MSText( + text = "닉네임", + fontWeight = FontWeight.Normal, + fontSize = 12.dp, + color = MSTheme.color.greyG5 + ) + Spacer(modifier = Modifier.height(8.dp)) + MSTextField( + modifier = Modifier.fillMaxWidth(), + textFieldState = textFieldState, + hint = "" + ) + Spacer(modifier = Modifier.height(16.dp)) + ProfileOption( + option = "앱 버전", + trailingContent = { + MSText( + text = "v0.2", + fontWeight = FontWeight.Normal, + fontSize = 16.dp, + color = MSTheme.color.greyG4 + ) + } + ) + Spacer(modifier = Modifier.height(16.dp)) + ProfileOption( + option = "이용 약관", + trailingContent = { + Image( + painter = painterResource(R.drawable.ic_chevron_right), + contentDescription = "terms" + ) + } + ) + Spacer(modifier = Modifier.weight(1f)) + ProfileOption( + option = "로그아웃", + trailingContent = { + Image( + painter = painterResource(R.drawable.ic_chevron_right), + contentDescription = "terms" + ) + } + ) + Spacer(modifier = Modifier.height(16.dp)) + ProfileOption( + option = "회원탈퇴", + optionColor = MSTheme.color.red, + trailingContent = { + Image( + painter = painterResource(R.drawable.ic_chevron_right), + contentDescription = "logout" + ) + } + ) + Spacer(modifier = Modifier.height(16.dp)) + } +} + +@Preview +@Composable +fun ProfileScreenPreview() { + ProfileScreen() +} \ No newline at end of file diff --git a/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt b/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt new file mode 100644 index 0000000..b3ed1e1 --- /dev/null +++ b/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt @@ -0,0 +1,66 @@ +package com.idiotfrogs.profile.component + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.idiotfrogs.designsystem.component.MSText +import com.idiotfrogs.designsystem.theme.MSTheme +import com.idiotfrogs.designsystem.util.noRippleClickable +import com.idiotfrogs.resource.R + +@Composable +fun ProfileHeader( + modifier: Modifier = Modifier, + isChanged: Boolean, + onSave: () -> Unit, +) { + Row( + modifier = modifier + .fillMaxWidth() + .padding(vertical = 16.dp), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Image( + painter = painterResource(R.drawable.ic_chevron_left), + contentDescription = "chevron left" + ) + MSText( + text = "프로필", + fontWeight = FontWeight.Bold, + fontSize = 14.dp, + color = MSTheme.color.black + ) + MSText( + modifier = Modifier.noRippleClickable(onSave), + text = "저장", + fontWeight = FontWeight.Bold, + fontSize = 14.dp, + color = if (isChanged) MSTheme.color.primaryNormal else MSTheme.color.greyG2, + ) + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFFFFFFF) +@Composable +fun ProfileHeaderPreview() { + var isChanged by remember { mutableStateOf(false) } + ProfileHeader( + modifier = Modifier.padding(horizontal = 20.dp), + isChanged = isChanged, + onSave = { isChanged = !isChanged } + ) +} diff --git a/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileOption.kt b/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileOption.kt new file mode 100644 index 0000000..41ae788 --- /dev/null +++ b/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileOption.kt @@ -0,0 +1,54 @@ +package com.idiotfrogs.profile.component + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.idiotfrogs.designsystem.component.MSText +import com.idiotfrogs.designsystem.theme.MSTheme + +@Composable +fun ProfileOption( + modifier: Modifier = Modifier, + option: String, + optionColor: Color = MSTheme.color.greyG5, + trailingContent: @Composable () -> Unit +) { + Row( + modifier = modifier + .fillMaxWidth() + .padding(vertical = 12.dp), + horizontalArrangement = Arrangement.SpaceBetween + ) { + MSText( + text = option, + fontWeight = FontWeight.Normal, + fontSize = 16.dp, + color = optionColor + ) + trailingContent() + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFFFFFFF) +@Composable +fun ProfileOptionPreview() { + ProfileOption( + modifier = Modifier.padding(horizontal = 20.dp), + option = "앱 버전", + trailingContent = { + MSText( + text = "v0.2", + fontWeight = FontWeight.Normal, + fontSize = 16.dp, + color = MSTheme.color.greyG4 + ) + } + ) +} From 7e8e6b764c681c8526834924810231947950cfee Mon Sep 17 00:00:00 2001 From: Hyeonseo4799 Date: Fri, 25 Jul 2025 21:58:48 +0900 Subject: [PATCH 2/6] =?UTF-8?q?:sparkles:=20::=20=EB=84=A4=EB=B9=84?= =?UTF-8?q?=EA=B2=8C=EC=9D=B4=EC=85=98=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 1 + .../com/idiotfrogs/memoryseal/MainActivity.kt | 9 ++++++++- .../java/com/idiotfrogs/navigation/Routes.kt | 2 ++ .../main/java/com/idiotfrogs/home/HomeScreen.kt | 8 ++++++-- .../com/idiotfrogs/home/component/HomeHeader.kt | 13 ++++++++++--- .../java/com/idiotfrogs/profile/ProfileScreen.kt | 16 +++++++++++++--- .../profile/component/ProfileHeader.kt | 3 +++ 7 files changed, 43 insertions(+), 9 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d8cfbed..69fdfa3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -9,6 +9,7 @@ dependencies { implementation(project(":feature:auth")) implementation(project(":feature:home")) implementation(project(":feature:create")) + implementation(project(":feature:profile")) implementation(project(":core:designsystem")) implementation(project(":core:data")) implementation(project(":core:navigation")) diff --git a/app/src/main/java/com/idiotfrogs/memoryseal/MainActivity.kt b/app/src/main/java/com/idiotfrogs/memoryseal/MainActivity.kt index 7f0435a..53bbe6f 100644 --- a/app/src/main/java/com/idiotfrogs/memoryseal/MainActivity.kt +++ b/app/src/main/java/com/idiotfrogs/memoryseal/MainActivity.kt @@ -19,6 +19,7 @@ import com.idiotfrogs.create.CreateScreen import com.idiotfrogs.designsystem.theme.MSTheme import com.idiotfrogs.home.HomeScreen import com.idiotfrogs.navigation.Routes +import com.idiotfrogs.profile.ProfileScreen import dagger.hilt.android.AndroidEntryPoint @SuppressLint("UnusedMaterial3ScaffoldPaddingParameter") @@ -65,7 +66,8 @@ class MainActivity : ComponentActivity() { } composable { HomeScreen( - navigateToCreate = { navController.navigate(Routes.Create) } + navigateToCreate = { navController.navigate(Routes.Create) }, + navigateToProfile = { navController.navigate(Routes.Profile) } ) } composable { @@ -73,6 +75,11 @@ class MainActivity : ComponentActivity() { navigateToBack = { navController.popBackStack() } ) } + composable { + ProfileScreen ( + navigateToBack = { navController.popBackStack() } + ) + } } } } diff --git a/core/navigation/src/main/java/com/idiotfrogs/navigation/Routes.kt b/core/navigation/src/main/java/com/idiotfrogs/navigation/Routes.kt index af18c8c..0faa1e8 100644 --- a/core/navigation/src/main/java/com/idiotfrogs/navigation/Routes.kt +++ b/core/navigation/src/main/java/com/idiotfrogs/navigation/Routes.kt @@ -11,4 +11,6 @@ sealed interface Routes { data object Home : Routes @Serializable data object Create : Routes + @Serializable + data object Profile : Routes } diff --git a/feature/home/src/main/java/com/idiotfrogs/home/HomeScreen.kt b/feature/home/src/main/java/com/idiotfrogs/home/HomeScreen.kt index 97c9307..43732cf 100644 --- a/feature/home/src/main/java/com/idiotfrogs/home/HomeScreen.kt +++ b/feature/home/src/main/java/com/idiotfrogs/home/HomeScreen.kt @@ -39,6 +39,7 @@ import com.idiotfrogs.home.component.HomeTicket @Composable fun HomeScreen( navigateToCreate: () -> Unit, + navigateToProfile: () -> Unit, ) { var expanded by remember { mutableStateOf(false) } var currentTab by remember { mutableStateOf(HomeTab.CREATED) } @@ -79,7 +80,7 @@ fun HomeScreen( .background(MSTheme.color.bgNormal) .systemBarsPadding() ) { - HomeHeader() + HomeHeader(navigateToProfile = navigateToProfile) HomeTabBar( selectedTab = currentTab, onClick = { currentTab = it }, @@ -131,5 +132,8 @@ fun HomeScreen( @DevicePreview @Composable fun HomeScreenPreview() { - HomeScreen(navigateToCreate = {}) + HomeScreen( + navigateToProfile = {}, + navigateToCreate = {} + ) } \ No newline at end of file diff --git a/feature/home/src/main/java/com/idiotfrogs/home/component/HomeHeader.kt b/feature/home/src/main/java/com/idiotfrogs/home/component/HomeHeader.kt index 3d38e0f..592d462 100644 --- a/feature/home/src/main/java/com/idiotfrogs/home/component/HomeHeader.kt +++ b/feature/home/src/main/java/com/idiotfrogs/home/component/HomeHeader.kt @@ -14,10 +14,13 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.idiotfrogs.designsystem.component.MSText import com.idiotfrogs.designsystem.theme.MSTheme +import com.idiotfrogs.designsystem.util.noRippleClickable import com.idiotfrogs.resource.R @Composable -fun HomeHeader() { +fun HomeHeader( + navigateToProfile: () -> Unit, +) { Row( modifier = Modifier .background(color = MSTheme.color.white) @@ -32,7 +35,9 @@ fun HomeHeader() { Spacer(modifier = Modifier.weight(1f)) // TODO: 이미지 url 통해 로드 Image( - modifier = Modifier.size(32.dp), + modifier = Modifier + .noRippleClickable(navigateToProfile) + .size(32.dp), painter = painterResource(R.drawable.img_profile), contentDescription = "profile" ) @@ -42,5 +47,7 @@ fun HomeHeader() { @Preview @Composable private fun HomeHeaderPreview() { - HomeHeader() + HomeHeader( + navigateToProfile = {} + ) } \ No newline at end of file diff --git a/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt b/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt index ea53556..f01fc02 100644 --- a/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt +++ b/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt @@ -9,6 +9,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.foundation.layout.systemBarsPadding import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.text.input.rememberTextFieldState import androidx.compose.runtime.Composable @@ -34,7 +35,9 @@ import com.idiotfrogs.resource.R import com.skydoves.landscapist.glide.GlideImage @Composable -fun ProfileScreen() { +fun ProfileScreen( + navigateToBack: () -> Unit, +) { // TODO: 추후 기존 프로필과 비교 로직 작성 var isChanged by remember { mutableStateOf(false) } @@ -45,11 +48,16 @@ fun ProfileScreen() { modifier = Modifier .fillMaxSize() .background(MSTheme.color.white) + .systemBarsPadding() .padding(horizontal = 20.dp) ) { ProfileHeader( isChanged = isChanged, - onSave = { /** TODO: 저장 로직 */ } + onBack = { navigateToBack() }, + onSave = { + /** TODO: 저장 로직 */ + navigateToBack() + } ) Spacer(modifier = Modifier.height(16.dp)) imageUri?.let { @@ -133,5 +141,7 @@ fun ProfileScreen() { @Preview @Composable fun ProfileScreenPreview() { - ProfileScreen() + ProfileScreen( + navigateToBack = { } + ) } \ No newline at end of file diff --git a/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt b/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt index b3ed1e1..7edc9ff 100644 --- a/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt +++ b/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt @@ -25,6 +25,7 @@ import com.idiotfrogs.resource.R fun ProfileHeader( modifier: Modifier = Modifier, isChanged: Boolean, + onBack: () -> Unit, onSave: () -> Unit, ) { Row( @@ -35,6 +36,7 @@ fun ProfileHeader( verticalAlignment = Alignment.CenterVertically ) { Image( + modifier = Modifier.noRippleClickable(onBack), painter = painterResource(R.drawable.ic_chevron_left), contentDescription = "chevron left" ) @@ -61,6 +63,7 @@ fun ProfileHeaderPreview() { ProfileHeader( modifier = Modifier.padding(horizontal = 20.dp), isChanged = isChanged, + onBack = { }, onSave = { isChanged = !isChanged } ) } From f8d313149df914a95fa7aafae0fdc41cf3527ae8 Mon Sep 17 00:00:00 2001 From: Hyeonseo4799 Date: Fri, 25 Jul 2025 22:43:54 +0900 Subject: [PATCH 3/6] =?UTF-8?q?:sparkles:=20::=20=EA=B3=B5=ED=86=B5=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20MSDialog=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/MSDialog.kt | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 core/designsystem/src/main/java/com/idiotfrogs/designsystem/component/MSDialog.kt diff --git a/core/designsystem/src/main/java/com/idiotfrogs/designsystem/component/MSDialog.kt b/core/designsystem/src/main/java/com/idiotfrogs/designsystem/component/MSDialog.kt new file mode 100644 index 0000000..c5242ae --- /dev/null +++ b/core/designsystem/src/main/java/com/idiotfrogs/designsystem/component/MSDialog.kt @@ -0,0 +1,115 @@ +package com.idiotfrogs.designsystem.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +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.shape.RoundedCornerShape +import androidx.compose.material3.ButtonDefaults +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.em +import androidx.compose.ui.window.Dialog +import androidx.compose.ui.window.DialogProperties +import com.idiotfrogs.designsystem.component.button.MSButton +import com.idiotfrogs.designsystem.theme.MSTheme + +@Composable +fun MSDialog( + isShow: Boolean, + title: String, + content: String, + primaryText: String, + secondaryText: String, + onDismiss: () -> Unit, + onAction: () -> Unit, + properties: DialogProperties = DialogProperties(), +) { + if (isShow) { + Dialog( + properties = properties, + onDismissRequest = onDismiss + ) { + Column( + modifier = Modifier + .background( + color = MSTheme.color.white, + shape = RoundedCornerShape(24.dp) + ) + .padding(top = 28.dp, start = 24.dp, end = 24.dp, bottom = 24.dp) + ) { + MSText( + text = title, + fontWeight = FontWeight.Bold, + fontSize = 20.dp, + lineHeight = (1.3).em, + color = MSTheme.color.black + ) + Spacer(modifier = Modifier.height(8.dp)) + MSText( + text = content, + fontWeight = FontWeight.Normal, + fontSize = 16.dp, + lineHeight = (1.5).em, + color = MSTheme.color.black + ) + Spacer(modifier = Modifier.height(24.dp)) + Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { + MSButton( + modifier = Modifier.weight(1f), + colors = ButtonDefaults.buttonColors( + containerColor = MSTheme.color.greyG1, + disabledContainerColor = MSTheme.color.greyG2 + ), + pressColors = ButtonDefaults.buttonColors( + containerColor = MSTheme.color.greyG2, + disabledContainerColor = MSTheme.color.greyG2 + ), + contentPadding = PaddingValues(vertical = 11.dp), + onClick = onDismiss + ) { + MSText( + text = secondaryText, + fontWeight = FontWeight.Bold, + fontSize = 16.dp, + color = MSTheme.color.greyG4 + ) + } + MSButton( + modifier = Modifier.weight(1f), + contentPadding = PaddingValues(vertical = 11.dp), + onClick = onAction + ) { + MSText( + text = primaryText, + fontWeight = FontWeight.Bold, + fontSize = 16.dp, + color = MSTheme.color.white + ) + } + } + } + } + } +} + +@Preview +@Composable +fun MSDialogPreview() { + MSDialog( + isShow = true, + title = "로그아웃", + content = "메실에서 로그아웃 하시겠습니까?", + primaryText = "로그아웃", + secondaryText = "유지", + onDismiss = { }, + onAction = { } + ) +} \ No newline at end of file From 80a9e1c1b6c50bc469abe965d40c1f608bcef5aa Mon Sep 17 00:00:00 2001 From: Hyeonseo4799 Date: Fri, 25 Jul 2025 22:44:16 +0900 Subject: [PATCH 4/6] =?UTF-8?q?:sparkles:=20::=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=EB=B0=8F=20=ED=83=88=ED=87=B4=20Dialog=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 --- .../com/idiotfrogs/memoryseal/MainActivity.kt | 12 +++++- .../com/idiotfrogs/profile/ProfileScreen.kt | 39 ++++++++++++++++++- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/idiotfrogs/memoryseal/MainActivity.kt b/app/src/main/java/com/idiotfrogs/memoryseal/MainActivity.kt index 53bbe6f..c2296c9 100644 --- a/app/src/main/java/com/idiotfrogs/memoryseal/MainActivity.kt +++ b/app/src/main/java/com/idiotfrogs/memoryseal/MainActivity.kt @@ -76,8 +76,16 @@ class MainActivity : ComponentActivity() { ) } composable { - ProfileScreen ( - navigateToBack = { navController.popBackStack() } + ProfileScreen( + navigateToBack = { navController.popBackStack() }, + navigateToLogin = { + navController.navigate(Routes.Login) { + popUpTo { + inclusive = true + } + launchSingleTop = true + } + } ) } } diff --git a/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt b/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt index f01fc02..6100ada 100644 --- a/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt +++ b/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt @@ -24,6 +24,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.idiotfrogs.designsystem.component.MSDialog import com.idiotfrogs.designsystem.component.MSText import com.idiotfrogs.designsystem.component.MSTextField import com.idiotfrogs.designsystem.theme.MSTheme @@ -37,9 +38,12 @@ import com.skydoves.landscapist.glide.GlideImage @Composable fun ProfileScreen( navigateToBack: () -> Unit, + navigateToLogin: () -> Unit, ) { // TODO: 추후 기존 프로필과 비교 로직 작성 var isChanged by remember { mutableStateOf(false) } + var showLogoutDialog by remember { mutableStateOf(false) } + var showWithdrawDialog by remember { mutableStateOf(false) } val (imageUri, launchImagePicker) = rememberPickerState() val textFieldState = rememberTextFieldState() @@ -115,6 +119,7 @@ fun ProfileScreen( ) Spacer(modifier = Modifier.weight(1f)) ProfileOption( + modifier = Modifier.noRippleClickable { showLogoutDialog = true }, option = "로그아웃", trailingContent = { Image( @@ -125,6 +130,7 @@ fun ProfileScreen( ) Spacer(modifier = Modifier.height(16.dp)) ProfileOption( + modifier = Modifier.noRippleClickable { showWithdrawDialog = true }, option = "회원탈퇴", optionColor = MSTheme.color.red, trailingContent = { @@ -136,12 +142,43 @@ fun ProfileScreen( ) Spacer(modifier = Modifier.height(16.dp)) } + MSDialog( + isShow = showLogoutDialog, + title = "로그아웃", + content = "메실에서 로그아웃 하시겠습니까?", + primaryText = "로그아웃", + secondaryText = "유지", + onAction = { + /** TODO: 로그아웃 로직 */ + showLogoutDialog = false + navigateToLogin() + }, + onDismiss = { + showLogoutDialog = false + } + ) + MSDialog( + isShow = showWithdrawDialog, + title = "회원탈퇴", + content = "메실 회원을 탈퇴하시겠습니까?\n티켓에 저장된 내용은 삭제되지 않습니다.", + primaryText = "탈퇴", + secondaryText = "취소", + onAction = { + /** TODO: 탈퇴 로직 */ + showWithdrawDialog = false + navigateToLogin() + }, + onDismiss = { + showWithdrawDialog = false + } + ) } @Preview @Composable fun ProfileScreenPreview() { ProfileScreen( - navigateToBack = { } + navigateToBack = { }, + navigateToLogin = { } ) } \ No newline at end of file From 31677e9d994affb3c0f4d5a7c14d544d7fa2a373 Mon Sep 17 00:00:00 2001 From: hyeonseo Date: Mon, 20 Oct 2025 18:07:55 +0900 Subject: [PATCH 5/6] =?UTF-8?q?:lipstick:=20::=20MSDialog=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/idiotfrogs/profile/ProfileScreen.kt | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt b/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt index 6100ada..d21b904 100644 --- a/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt +++ b/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt @@ -142,36 +142,38 @@ fun ProfileScreen( ) Spacer(modifier = Modifier.height(16.dp)) } - MSDialog( - isShow = showLogoutDialog, - title = "로그아웃", - content = "메실에서 로그아웃 하시겠습니까?", - primaryText = "로그아웃", - secondaryText = "유지", - onAction = { - /** TODO: 로그아웃 로직 */ - showLogoutDialog = false - navigateToLogin() - }, - onDismiss = { - showLogoutDialog = false - } - ) - MSDialog( - isShow = showWithdrawDialog, - title = "회원탈퇴", - content = "메실 회원을 탈퇴하시겠습니까?\n티켓에 저장된 내용은 삭제되지 않습니다.", - primaryText = "탈퇴", - secondaryText = "취소", - onAction = { - /** TODO: 탈퇴 로직 */ - showWithdrawDialog = false - navigateToLogin() - }, - onDismiss = { - showWithdrawDialog = false - } - ) + if (showLogoutDialog) { + MSDialog( + title = "로그아웃", + content = "메실에서 로그아웃 하시겠습니까?", + confirmText = "로그아웃", + cancelText = "유지", + onConfirm = { + /** TODO: 로그아웃 로직 */ + showLogoutDialog = false + navigateToLogin() + }, + onCancel = { + showLogoutDialog = false + } + ) + } + if (showWithdrawDialog) { + MSDialog( + title = "회원탈퇴", + content = "메실 회원을 탈퇴하시겠습니까?\n티켓에 저장된 내용은 삭제되지 않습니다.", + confirmText = "탈퇴", + cancelText = "취소", + onConfirm = { + /** TODO: 탈퇴 로직 */ + showWithdrawDialog = false + navigateToLogin() + }, + onCancel = { + showWithdrawDialog = false + } + ) + } } @Preview From 3499e7122aa58d6c585821159e6e962455dfb540 Mon Sep 17 00:00:00 2001 From: hyeonseo Date: Thu, 6 Nov 2025 09:59:04 +0900 Subject: [PATCH 6/6] =?UTF-8?q?:art:=20::=20PR=20=EB=A6=AC=EB=B7=B0=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Compose convention에 맞도록 파라미터 순서 변경 - Dialog는 최상단에 위치하도록 변경 --- .../com/idiotfrogs/profile/ProfileScreen.kt | 66 ++++++++++--------- .../profile/component/ProfileHeader.kt | 2 +- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt b/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt index d21b904..ef844d7 100644 --- a/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt +++ b/feature/profile/src/main/java/com/idiotfrogs/profile/ProfileScreen.kt @@ -48,6 +48,39 @@ fun ProfileScreen( val (imageUri, launchImagePicker) = rememberPickerState() val textFieldState = rememberTextFieldState() + if (showLogoutDialog) { + MSDialog( + title = "로그아웃", + content = "메실에서 로그아웃 하시겠습니까?", + confirmText = "로그아웃", + cancelText = "유지", + onConfirm = { + /** TODO: 로그아웃 로직 */ + showLogoutDialog = false + navigateToLogin() + }, + onCancel = { + showLogoutDialog = false + } + ) + } + if (showWithdrawDialog) { + MSDialog( + title = "회원탈퇴", + content = "메실 회원을 탈퇴하시겠습니까?\n티켓에 저장된 내용은 삭제되지 않습니다.", + confirmText = "탈퇴", + cancelText = "취소", + onConfirm = { + /** TODO: 탈퇴 로직 */ + showWithdrawDialog = false + navigateToLogin() + }, + onCancel = { + showWithdrawDialog = false + } + ) + } + Column( modifier = Modifier .fillMaxSize() @@ -142,38 +175,7 @@ fun ProfileScreen( ) Spacer(modifier = Modifier.height(16.dp)) } - if (showLogoutDialog) { - MSDialog( - title = "로그아웃", - content = "메실에서 로그아웃 하시겠습니까?", - confirmText = "로그아웃", - cancelText = "유지", - onConfirm = { - /** TODO: 로그아웃 로직 */ - showLogoutDialog = false - navigateToLogin() - }, - onCancel = { - showLogoutDialog = false - } - ) - } - if (showWithdrawDialog) { - MSDialog( - title = "회원탈퇴", - content = "메실 회원을 탈퇴하시겠습니까?\n티켓에 저장된 내용은 삭제되지 않습니다.", - confirmText = "탈퇴", - cancelText = "취소", - onConfirm = { - /** TODO: 탈퇴 로직 */ - showWithdrawDialog = false - navigateToLogin() - }, - onCancel = { - showWithdrawDialog = false - } - ) - } + } @Preview diff --git a/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt b/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt index 7edc9ff..4971730 100644 --- a/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt +++ b/feature/profile/src/main/java/com/idiotfrogs/profile/component/ProfileHeader.kt @@ -23,8 +23,8 @@ import com.idiotfrogs.resource.R @Composable fun ProfileHeader( - modifier: Modifier = Modifier, isChanged: Boolean, + modifier: Modifier = Modifier, onBack: () -> Unit, onSave: () -> Unit, ) {