From 32686a49c1f99fb6c31e95fd25ee980be122f4b1 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 7 Sep 2024 10:04:47 +0900 Subject: [PATCH 01/10] =?UTF-8?q?[FEAT/#221]=20=EB=84=A4=EB=B9=84=EA=B2=8C?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=8A=A4=ED=83=9D=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/main/MainNavigator.kt | 9 ++++-- .../com/terning/feature/main/MainScreen.kt | 28 +++++++++++++++++++ .../feature/mypage/mypage/MyPageRoute.kt | 12 ++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index f0598bf1f..8455eb2a6 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -31,9 +31,12 @@ class MainNavigator( fun navigate(tab: MainTab) { val navOptions = navOptions { - popUpTo(navController.graph.findStartDestination().id) { - saveState = true - } + navController.currentDestination?.route?.let { + popUpTo(it){ + inclusive = true + saveState = true + } + } launchSingleTop = true restoreState = true } diff --git a/feature/src/main/java/com/terning/feature/main/MainScreen.kt b/feature/src/main/java/com/terning/feature/main/MainScreen.kt index d78934eba..f294cf9e1 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -1,5 +1,9 @@ package com.terning.feature.main +import android.app.Activity +import android.content.Intent +import android.widget.Toast +import androidx.activity.compose.BackHandler import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.EnterTransition import androidx.compose.animation.ExitTransition @@ -15,11 +19,18 @@ import androidx.compose.material3.NavigationBarItem import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.sp +import androidx.core.content.ContextCompat.startActivity import androidx.navigation.compose.NavHost import com.terning.core.designsystem.theme.Grey300 import com.terning.core.designsystem.theme.TerningMain @@ -33,6 +44,7 @@ import com.terning.feature.filtering.startfiltering.navigation.startFilteringNav import com.terning.feature.filtering.starthome.navigation.startHomeNavGraph import com.terning.feature.home.changefilter.navigation.changeFilterNavGraph import com.terning.feature.home.home.navigation.homeNavGraph +import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.intern.navigation.internNavGraph import com.terning.feature.mypage.mypage.navigation.myPageNavGraph import com.terning.feature.mypage.profileedit.navigation.profileEditNavGraph @@ -41,11 +53,27 @@ import com.terning.feature.onboarding.signup.navigation.signUpNavGraph import com.terning.feature.onboarding.splash.navigation.splashNavGraph import com.terning.feature.search.search.navigation.searchNavGraph import com.terning.feature.search.searchprocess.navigation.searchProcessNavGraph +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch @Composable fun MainScreen( navigator: MainNavigator = rememberMainNavigator(), ) { + val context = LocalContext.current + var backPressedState by remember { mutableStateOf(true) } + var backPressedTime = 0L + + BackHandler(enabled = backPressedState) { + if(System.currentTimeMillis() - backPressedTime <= 3000) { + (context as Activity).finish() + } else { + backPressedState = true + Toast.makeText(context, "한 번 더 누르시면 앱이 종료됩니다.", Toast.LENGTH_SHORT).show() + } + backPressedTime = System.currentTimeMillis() + } + Scaffold( bottomBar = { MainBottomBar( diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt index e520d3504..b31050de1 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt @@ -15,11 +15,15 @@ import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Text import androidx.compose.material3.VerticalDivider import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.SideEffect +import androidx.compose.runtime.compositionLocalOf import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview @@ -63,6 +67,14 @@ fun MyPageRoute( ) } + DisposableEffect(lifecycleOwner) { + onDispose { + systemUiController.setStatusBarColor( + color = White + ) + } + } + LaunchedEffect(viewModel.sideEffects, lifecycleOwner) { viewModel.sideEffects.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle) .collect { sideEffect -> From a854109b13c7e5a4c662b729ae3a8688fd465f0e Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 7 Sep 2024 11:50:42 +0900 Subject: [PATCH 02/10] =?UTF-8?q?[FEAT/#221]=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=84=9C=EB=B2=84=ED=86=B5=EC=8B=A0=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bottomsheet/ProfileBottomSheet.kt | 41 ++-- .../component/item/ProfileWithPlusButton.kt | 16 +- .../com/terning/core/type/ProfileImage.kt | 31 +++ .../res/drawable/ic_terning_profile_00.xml | 179 +++++----------- .../res/drawable/ic_terning_profile_01.xml | 200 +++++++----------- .../ic_terning_profile_01_selected.png | Bin 6221 -> 0 bytes .../res/drawable/ic_terning_profile_02.xml | 161 ++++++-------- .../res/drawable/ic_terning_profile_03.xml | 195 ++++++----------- .../res/drawable/ic_terning_profile_04.xml | 180 +++++----------- .../res/drawable/ic_terning_profile_05.xml | 172 ++++++--------- .../data/dto/request/SignUpRequestDto.kt | 2 +- .../data/dto/response/MyPageResponseDto.kt | 2 + .../data/mapper/mypage/MyPageMapper.kt | 7 +- .../entity/mypage/MyPageProfileModel.kt | 1 + .../domain/entity/onboarding/SignUpRequest.kt | 2 +- .../feature/mypage/mypage/MyPageRoute.kt | 27 +-- .../feature/mypage/mypage/MyPageState.kt | 2 +- .../feature/mypage/mypage/MyPageViewModel.kt | 1 + .../mypage/mypage/component/MyPageProfile.kt | 25 +-- .../mypage/navigation/MyPageNavigation.kt | 4 +- .../mypage/profileedit/ProfileEditRoute.kt | 15 +- .../mypage/profileedit/ProfileEditState.kt | 2 +- .../profileedit/ProfileEditViewModel.kt | 14 +- .../navigation/ProfileEditNavigation.kt | 8 +- .../feature/onboarding/signup/SignUpRoute.kt | 8 +- .../feature/onboarding/signup/SignUpState.kt | 2 +- .../onboarding/signup/SignUpViewModel.kt | 2 +- 27 files changed, 504 insertions(+), 795 deletions(-) create mode 100644 core/src/main/java/com/terning/core/type/ProfileImage.kt delete mode 100644 core/src/main/res/drawable/ic_terning_profile_01_selected.png diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt index 9382ceb7a..640952599 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt @@ -30,6 +30,7 @@ import com.terning.core.R import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.noRippleClickable +import com.terning.core.type.ProfileImage import kotlinx.coroutines.launch /** @@ -45,8 +46,8 @@ import kotlinx.coroutines.launch fun ProfileBottomSheet( modifier: Modifier = Modifier, onDismiss: () -> Unit, - onSaveClick: (Int) -> Unit, - initialSelectedOption: Int + onSaveClick: (ProfileImage) -> Unit, + initialSelectedOption: String ) { val scope = rememberCoroutineScope() val sheetState = rememberModalBottomSheetState() @@ -64,11 +65,11 @@ fun ProfileBottomSheet( ), ) RadioButtonGroup( - onOptionSelected = { index -> + onOptionSelected = { selectedProfile -> scope.launch { sheetState.hide() } .invokeOnCompletion { if (!sheetState.isVisible) { - onSaveClick(index) + onSaveClick(selectedProfile) } } }, @@ -82,6 +83,7 @@ fun ProfileBottomSheet( ) } + /** * 6개의 프로필 이미지 중, 하나의 이미지만 선택할 수 있는 라디오 버튼입니다. * @@ -91,20 +93,17 @@ fun ProfileBottomSheet( */ @Composable fun RadioButtonGroup( - onOptionSelected: (Int) -> Unit, - initialSelectedOption: Int, + onOptionSelected: (ProfileImage) -> Unit, + initialSelectedOption: String, modifier: Modifier = Modifier, ) { - val options = listOf( - R.drawable.ic_terning_profile_00, - R.drawable.ic_terning_profile_01, - R.drawable.ic_terning_profile_02, - R.drawable.ic_terning_profile_03, - R.drawable.ic_terning_profile_04, - R.drawable.ic_terning_profile_05 - ) + // 모든 ProfileImage 옵션을 가져옵니다. + val options = ProfileImage.entries - var selectedOption by rememberSaveable { mutableIntStateOf(options[initialSelectedOption]) } + // 초기 선택된 옵션을 ProfileImage로 변환하여 인덱스를 저장합니다. + var selectedOptionIndex by rememberSaveable { + mutableIntStateOf(ProfileImage.toIndex(ProfileImage.fromString(initialSelectedOption))) + } LazyVerticalGrid( columns = GridCells.Fixed(3), @@ -113,7 +112,7 @@ fun RadioButtonGroup( modifier = modifier.padding(horizontal = 34.dp) ) { itemsIndexed(options) { index, option -> - val imageModifier = if (selectedOption == options[index]) { + val imageModifier = if (selectedOptionIndex == index) { Modifier .border( color = TerningMain, @@ -126,14 +125,12 @@ fun RadioButtonGroup( } Image( - painter = painterResource( - id = option - ), + painter = painterResource(id = option.drawableResId), contentDescription = "profile image", modifier = imageModifier .noRippleClickable { - onOptionSelected(index) - selectedOption = option + onOptionSelected(option) + selectedOptionIndex = index } .clip(shape = CircleShape) .size(76.dp) @@ -141,4 +138,4 @@ fun RadioButtonGroup( ) } } -} \ No newline at end of file +} diff --git a/core/src/main/java/com/terning/core/designsystem/component/item/ProfileWithPlusButton.kt b/core/src/main/java/com/terning/core/designsystem/component/item/ProfileWithPlusButton.kt index 659f27b03..a8bccb6da 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/item/ProfileWithPlusButton.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/item/ProfileWithPlusButton.kt @@ -14,26 +14,20 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.terning.core.R +import com.terning.core.type.ProfileImage @Composable fun ProfileWithPlusButton( - index: Int, + profileImage: String, modifier: Modifier = Modifier, ) { - val grade = when (index) { - 0 -> R.drawable.ic_terning_profile_00 - 1 -> R.drawable.ic_terning_profile_01 - 2 -> R.drawable.ic_terning_profile_02 - 3 -> R.drawable.ic_terning_profile_03 - 4 -> R.drawable.ic_terning_profile_04 - else -> R.drawable.ic_terning_profile_05 - } + val userProfile = ProfileImage.fromString(profileImage) Box( modifier = modifier.wrapContentWidth() ) { Image( - painterResource(id = grade), + painterResource(id = userProfile.drawableResId), contentDescription = "profile image", modifier = modifier .clip(shape = CircleShape) @@ -51,5 +45,5 @@ fun ProfileWithPlusButton( @Preview(showBackground = true) @Composable fun ProfileWithPlusButtonPreview() { - ProfileWithPlusButton(index = 1) + ProfileWithPlusButton(profileImage = "basic") } \ No newline at end of file diff --git a/core/src/main/java/com/terning/core/type/ProfileImage.kt b/core/src/main/java/com/terning/core/type/ProfileImage.kt new file mode 100644 index 000000000..79fd6a1a4 --- /dev/null +++ b/core/src/main/java/com/terning/core/type/ProfileImage.kt @@ -0,0 +1,31 @@ +package com.terning.core.type + +import com.terning.core.R + +enum class ProfileImage( + val drawableResId: Int, + val stringValue: String +) { + + BASIC(drawableResId = R.drawable.ic_terning_profile_00, stringValue = "basic"), + LUCKY(drawableResId = R.drawable.ic_terning_profile_01, stringValue = "lucky"), + SMART(drawableResId = R.drawable.ic_terning_profile_02, stringValue = "smart"), + GLASS(drawableResId = R.drawable.ic_terning_profile_03, stringValue = "glass"), + CALENDAR(drawableResId = R.drawable.ic_terning_profile_04, stringValue = "calendar"), + PASSION(drawableResId = R.drawable.ic_terning_profile_05, stringValue = "passion"); + + companion object { + fun fromString(value: String): ProfileImage = when (value) { + "basic" -> BASIC + "lucky" -> LUCKY + "smart" -> SMART + "glass" -> GLASS + "calendar" -> CALENDAR + else -> PASSION + } + + fun toIndex(profileImage: ProfileImage): Int { + return entries.indexOf(profileImage) + } + } +} diff --git a/core/src/main/res/drawable/ic_terning_profile_00.xml b/core/src/main/res/drawable/ic_terning_profile_00.xml index f34f8769c..99edfdf96 100644 --- a/core/src/main/res/drawable/ic_terning_profile_00.xml +++ b/core/src/main/res/drawable/ic_terning_profile_00.xml @@ -1,137 +1,60 @@ - - - - - - - + android:width="76dp" + android:height="76dp" + android:viewportWidth="76" + android:viewportHeight="76"> + android:pathData="M38,0L38,0A38,38 0,0 1,76 38L76,38A38,38 0,0 1,38 76L38,76A38,38 0,0 1,0 38L0,38A38,38 0,0 1,38 0z"/> - - - - - - - - - - - - - - - - + android:pathData="M76,0H0V76H76V0Z" + android:fillColor="#FBF8CB"/> - - - - + android:pathData="M57.95,77.966L67.64,49.542C68.314,47.472 67.574,45.192 65.807,43.909L41.971,26.59C40.204,25.308 37.819,25.308 36.053,26.59L12.217,43.909C10.45,45.192 9.718,47.462 10.384,49.542L19.494,77.567C20.169,79.638 22.097,81.045 24.282,81.045H53.751" + android:fillColor="#ffffff"/> - - - - - - + android:pathData="M57.95,77.966L67.64,49.542C68.314,47.472 67.574,45.192 65.807,43.909L41.971,26.59C40.204,25.308 37.819,25.308 36.053,26.59L12.217,43.909C10.45,45.192 9.718,47.462 10.384,49.542L19.494,77.567C20.169,79.638 22.097,81.045 24.282,81.045H53.751" + android:strokeWidth="1.425" + android:fillColor="#00000000" + android:strokeColor="#171717" + android:strokeLineCap="round"/> + + + + + + + + + android:pathData="M35.444,53.884C35.444,53.884 36.243,55.613 38.114,55.613C39.986,55.613 40.565,53.884 40.565,53.884" + android:strokeWidth="1.425" + android:fillColor="#00000000" + android:strokeColor="#171717" + android:strokeLineCap="round"/> - diff --git a/core/src/main/res/drawable/ic_terning_profile_01.xml b/core/src/main/res/drawable/ic_terning_profile_01.xml index 557c169b6..0bfcc7b29 100644 --- a/core/src/main/res/drawable/ic_terning_profile_01.xml +++ b/core/src/main/res/drawable/ic_terning_profile_01.xml @@ -1,132 +1,80 @@ - - - - - - + android:width="76dp" + android:height="76dp" + android:viewportWidth="76" + android:viewportHeight="76"> + android:pathData="M38,0L38,0A38,38 0,0 1,76 38L76,38A38,38 0,0 1,38 76L38,76A38,38 0,0 1,0 38L0,38A38,38 0,0 1,38 0z"/> + android:pathData="M76,0H0V76H76V0Z" + android:fillColor="#ECF9CA"/> + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - diff --git a/core/src/main/res/drawable/ic_terning_profile_01_selected.png b/core/src/main/res/drawable/ic_terning_profile_01_selected.png deleted file mode 100644 index f85119d4b6130d20396c478ade2f721f58868ddf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6221 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 diff --git a/core/src/main/res/drawable/ic_terning_profile_02.xml b/core/src/main/res/drawable/ic_terning_profile_02.xml index 1ad3e5dd8..8ba5ffc15 100644 --- a/core/src/main/res/drawable/ic_terning_profile_02.xml +++ b/core/src/main/res/drawable/ic_terning_profile_02.xml @@ -1,98 +1,75 @@ - - - - - - + android:width="76dp" + android:height="76dp" + android:viewportWidth="76" + android:viewportHeight="76"> + android:pathData="M38,0L38,0A38,38 0,0 1,76 38L76,38A38,38 0,0 1,38 76L38,76A38,38 0,0 1,0 38L0,38A38,38 0,0 1,38 0z"/> + android:pathData="M76,0H0V76H76V0Z" + android:fillColor="#D4F9DE"/> + + + + + + + + + + + + + - - - - - - - - - - - - - - diff --git a/core/src/main/res/drawable/ic_terning_profile_03.xml b/core/src/main/res/drawable/ic_terning_profile_03.xml index fc45cad6a..25e878efb 100644 --- a/core/src/main/res/drawable/ic_terning_profile_03.xml +++ b/core/src/main/res/drawable/ic_terning_profile_03.xml @@ -1,131 +1,76 @@ - - - - - + android:width="76dp" + android:height="76dp" + android:viewportWidth="76" + android:viewportHeight="76"> + android:pathData="M38,0L38,0A38,38 0,0 1,76 38L76,38A38,38 0,0 1,38 76L38,76A38,38 0,0 1,0 38L0,38A38,38 0,0 1,38 0z"/> + android:pathData="M76.209,0H0.209V76H76.209V0Z" + android:fillColor="#C5DEF2"/> + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/src/main/res/drawable/ic_terning_profile_04.xml b/core/src/main/res/drawable/ic_terning_profile_04.xml index 228909ea8..8b27c5c6c 100644 --- a/core/src/main/res/drawable/ic_terning_profile_04.xml +++ b/core/src/main/res/drawable/ic_terning_profile_04.xml @@ -1,150 +1,74 @@ + android:width="76dp" + android:height="76dp" + android:viewportWidth="76" + android:viewportHeight="76"> + android:pathData="M76,0H0V76H76V0Z" + android:fillColor="#E9F1E4"/> - - - - - - - - - - - - - - - - - - - - - - + android:pathData="M64.676,32.956H11.324V85.035H64.676V32.956Z" + android:strokeLineJoin="round" + android:strokeWidth="1.425" + android:fillColor="#ffffff" + android:strokeColor="#171717" + android:strokeLineCap="round"/> + android:pathData="M31.663,53.447C31.663,53.779 31.616,54.131 31.502,54.416C31.388,54.701 31.036,54.872 30.808,55.1C30.58,55.328 30.409,55.623 30.105,55.746C29.801,55.869 29.488,55.841 29.155,55.841C28.823,55.841 28.509,55.822 28.224,55.699C27.939,55.575 27.654,55.395 27.426,55.167C27.198,54.938 26.999,54.682 26.875,54.378C26.752,54.074 26.638,53.761 26.638,53.438C26.638,53.114 26.837,52.811 26.961,52.526C27.084,52.241 27.274,52.003 27.502,51.775C27.73,51.547 27.939,51.319 28.234,51.195C28.528,51.072 28.832,51.072 29.165,51.072C29.497,51.072 29.801,51.082 30.086,51.205C30.371,51.328 30.647,51.509 30.875,51.728C31.103,51.946 31.293,52.212 31.416,52.507C31.54,52.801 31.682,53.105 31.682,53.438L31.663,53.447Z" + android:fillColor="#F9DBDE"/> + android:pathData="M31.663,53.447C31.663,53.779 31.616,54.131 31.502,54.416C31.388,54.701 31.036,54.872 30.808,55.1C30.58,55.328 30.409,55.623 30.105,55.746C29.801,55.869 29.488,55.841 29.155,55.841C28.823,55.841 28.509,55.822 28.224,55.699C27.939,55.575 27.654,55.395 27.426,55.167C27.198,54.938 26.999,54.682 26.875,54.378C26.752,54.074 26.638,53.761 26.638,53.438C26.638,53.114 26.837,52.811 26.961,52.526C27.084,52.241 27.274,52.003 27.502,51.775C27.73,51.547 27.939,51.319 28.234,51.195C28.528,51.072 28.832,51.072 29.165,51.072C29.497,51.072 29.801,51.082 30.086,51.205C30.371,51.328 30.647,51.509 30.875,51.728C31.103,51.946 31.293,52.212 31.416,52.507C31.54,52.801 31.682,53.105 31.682,53.438L31.663,53.447Z" + android:strokeWidth="0.7315" + android:fillColor="#00000000" + android:strokeColor="#F9DBDE"/> + android:pathData="M49.343,53.267C49.343,53.599 49.267,53.932 49.143,54.226C49.02,54.521 48.839,54.825 48.611,55.043C48.383,55.262 48.079,55.433 47.785,55.556C47.49,55.68 47.167,55.651 46.835,55.651C46.502,55.651 46.217,55.585 45.923,55.461C45.628,55.338 45.267,55.281 45.049,55.053C44.83,54.825 44.669,54.511 44.545,54.217C44.422,53.922 44.422,53.599 44.422,53.267C44.422,52.934 44.45,52.611 44.564,52.326C44.678,52.041 44.897,51.775 45.125,51.557C45.353,51.338 45.638,51.215 45.932,51.091C46.227,50.968 46.502,50.92 46.835,50.92C47.167,50.92 47.49,50.863 47.785,50.987C48.079,51.11 48.355,51.3 48.583,51.528C48.811,51.756 49.01,52.022 49.134,52.326C49.257,52.63 49.343,52.944 49.343,53.276V53.267Z" + android:fillColor="#F9DBDE"/> + android:strokeColor="#F9DBDE"/> + android:pathData="M37.506,63.441H38.598C38.988,63.441 39.32,63.707 39.396,64.077L41.762,75.8C41.828,76.199 41.705,76.608 41.42,76.902L39.016,79.372C38.503,79.895 37.648,79.914 37.126,79.401L34.618,76.978C34.314,76.684 34.171,76.256 34.247,75.838L36.717,64.077C36.793,63.707 37.126,63.441 37.515,63.441H37.506Z" + android:strokeWidth="1.425" + android:fillColor="#A6B7FF" + android:strokeColor="#171717"/> + android:pathData="M39.168,63.907H36.955C36.518,63.907 36.147,63.603 36.053,63.185L35.54,60.952C35.407,60.373 35.853,59.812 36.442,59.812H39.701C40.299,59.812 40.745,60.373 40.603,60.952L40.071,63.185C39.976,63.603 39.596,63.897 39.168,63.897V63.907Z" + android:strokeWidth="1.425" + android:fillColor="#A6B7FF" + android:strokeColor="#171717"/> + android:pathData="M34.818,52.497C35.384,52.497 35.843,51.791 35.843,50.92C35.843,50.049 35.384,49.343 34.818,49.343C34.251,49.343 33.792,50.049 33.792,50.92C33.792,51.791 34.251,52.497 34.818,52.497Z" + android:fillColor="#171717"/> + android:pathData="M41.182,52.497C41.749,52.497 42.208,51.791 42.208,50.92C42.208,50.049 41.749,49.343 41.182,49.343C40.616,49.343 40.157,50.049 40.157,50.92C40.157,51.791 40.616,52.497 41.182,52.497Z" + android:fillColor="#171717"/> + diff --git a/core/src/main/res/drawable/ic_terning_profile_05.xml b/core/src/main/res/drawable/ic_terning_profile_05.xml index 2d21f7990..9a32c789e 100644 --- a/core/src/main/res/drawable/ic_terning_profile_05.xml +++ b/core/src/main/res/drawable/ic_terning_profile_05.xml @@ -1,111 +1,73 @@ - - - - + android:width="76dp" + android:height="76dp" + android:viewportWidth="76" + android:viewportHeight="76"> + android:pathData="M38,0L38,0A38,38 0,0 1,76 38L76,38A38,38 0,0 1,38 76L38,76A38,38 0,0 1,0 38L0,38A38,38 0,0 1,38 0z"/> + android:pathData="M76,0H0V76H76V0Z" + android:fillColor="#E6FFF6"/> + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - diff --git a/data/src/main/java/com/terning/data/dto/request/SignUpRequestDto.kt b/data/src/main/java/com/terning/data/dto/request/SignUpRequestDto.kt index fbfc3d0bf..9cea3722d 100644 --- a/data/src/main/java/com/terning/data/dto/request/SignUpRequestDto.kt +++ b/data/src/main/java/com/terning/data/dto/request/SignUpRequestDto.kt @@ -8,7 +8,7 @@ data class SignUpRequestDto( @SerialName("name") val name: String, @SerialName("profileImage") - val profileImage: Int, + val profileImage: String, @SerialName("authType") val authType: String ) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/dto/response/MyPageResponseDto.kt b/data/src/main/java/com/terning/data/dto/response/MyPageResponseDto.kt index 035919f84..3afedf5b3 100644 --- a/data/src/main/java/com/terning/data/dto/response/MyPageResponseDto.kt +++ b/data/src/main/java/com/terning/data/dto/response/MyPageResponseDto.kt @@ -7,6 +7,8 @@ import kotlinx.serialization.Serializable data class MyPageResponseDto( @SerialName("name") val name: String, + @SerialName("profileImage") + val profileImage: String, @SerialName("authType") val authType: String ) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt b/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt index 2ae84fa1b..cfc5c65ba 100644 --- a/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt +++ b/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt @@ -3,4 +3,9 @@ package com.terning.data.mapper.mypage import com.terning.data.dto.response.MyPageResponseDto import com.terning.domain.entity.mypage.MyPageProfileModel -fun MyPageResponseDto.toMyPageProfile() = MyPageProfileModel(name = name, authType = authType) +fun MyPageResponseDto.toMyPageProfile() = + MyPageProfileModel( + name = name, + profileImage = profileImage, + authType = authType + ) diff --git a/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileModel.kt b/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileModel.kt index 9576d68dc..b9a617564 100644 --- a/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileModel.kt @@ -2,5 +2,6 @@ package com.terning.domain.entity.mypage data class MyPageProfileModel( val name: String, + val profileImage: String, val authType: String ) \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/entity/onboarding/SignUpRequest.kt b/domain/src/main/java/com/terning/domain/entity/onboarding/SignUpRequest.kt index 7b24e160e..dc74f8bdb 100644 --- a/domain/src/main/java/com/terning/domain/entity/onboarding/SignUpRequest.kt +++ b/domain/src/main/java/com/terning/domain/entity/onboarding/SignUpRequest.kt @@ -2,6 +2,6 @@ package com.terning.domain.entity.onboarding data class SignUpRequest ( val name : String, - val profileImage : Int, + val profileImage : String, val authType : String ) \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt index b31050de1..8dec567d4 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt @@ -1,5 +1,6 @@ package com.terning.feature.mypage.mypage +import android.util.Log import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -15,15 +16,12 @@ import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Text import androidx.compose.material3.VerticalDivider import androidx.compose.runtime.Composable -import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.SideEffect -import androidx.compose.runtime.compositionLocalOf import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview @@ -52,7 +50,7 @@ import com.terning.feature.mypage.mypage.component.MyPageItem @Composable fun MyPageRoute( paddingValues: PaddingValues, - navigateToProfileEdit: (String, Int) -> Unit, + navigateToProfileEdit: (String, String) -> Unit, viewModel: MyPageViewModel = hiltViewModel(), ) { val state by viewModel.state.collectAsStateWithLifecycle() @@ -81,7 +79,7 @@ fun MyPageRoute( when (sideEffect) { is MyPageSideEffect.NavigateToProfileEdit -> navigateToProfileEdit( state.name, - state.profile + state.profileImage ) } } @@ -127,13 +125,18 @@ fun MyPageRoute( onServiceClick = {}, onPersonalClick = {}, name = state.name, - profile = state.profile + profileImage = state.profileImage ) } - is UiState.Loading -> {} + is UiState.Loading -> { + Log.d("LYB", "로딩중") + } is UiState.Empty -> {} - is UiState.Failure -> {} + is UiState.Failure -> { + Log.d("LYB", "실패") + + } } if (state.showNotice) { @@ -158,7 +161,7 @@ fun MyPageScreen( onPersonalClick: () -> Unit, paddingValues: PaddingValues = PaddingValues(), name: String = "", - profile: Int = 0 + profileImage: String = "" ) { Column( modifier = Modifier @@ -168,7 +171,7 @@ fun MyPageScreen( ) { UserProfile( name = name, - profile = profile, + profileImage = profileImage, onEditClick = onEditClick ) TerningCommunity( @@ -221,7 +224,7 @@ fun UserProfile( name: String, onEditClick: () -> Unit, modifier: Modifier = Modifier, - profile: Int = 0, + profileImage: String = "", ) { Row( modifier = modifier.padding( @@ -230,7 +233,7 @@ fun UserProfile( bottom = 32.dp ) ) { - MyPageProfile(profile = profile) + MyPageProfile(profileImage = profileImage) Column { Text( text = name, diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageState.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageState.kt index bf072cb13..24f76c1ae 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageState.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageState.kt @@ -6,7 +6,7 @@ data class MyPageState( val isLogoutAndQuitSuccess: UiState = UiState.Loading, val isGetSuccess: UiState = UiState.Loading, val name: String = "", - val profile: Int = 0, + val profileImage: String = "", val authType : String ="", val showNotice: Boolean = false, val showOpinion: Boolean = false, diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt index b4f39bb61..b079d413b 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt @@ -104,6 +104,7 @@ class MyPageViewModel @Inject constructor( _state.value = _state.value.copy( isGetSuccess = UiState.Success(true), name = response.name, + profileImage = response.profileImage, authType = response.authType ) }.onFailure { diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/component/MyPageProfile.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/component/MyPageProfile.kt index cd12d2623..a0d985004 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/component/MyPageProfile.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/component/MyPageProfile.kt @@ -10,36 +10,21 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import com.terning.core.R +import com.terning.core.type.ProfileImage @Composable fun MyPageProfile( modifier: Modifier = Modifier, - profile: Int + profileImage: String ) { - val options = listOf( - R.drawable.ic_terning_profile_00, - R.drawable.ic_terning_profile_01, - R.drawable.ic_terning_profile_02, - R.drawable.ic_terning_profile_03, - R.drawable.ic_terning_profile_04, - R.drawable.ic_terning_profile_05 - ) - - val option = when (profile) { - 0 -> options[0] - 1 -> options[1] - 2 -> options[2] - 3 -> options[3] - 4 -> options[4] - else -> options[5] - } + val userProfile = ProfileImage.fromString(profileImage) Image( - painter = painterResource(id = option), + painter = painterResource(id = userProfile.drawableResId), modifier = modifier .size(72.dp) .clip(shape = CircleShape) .aspectRatio(1f), contentDescription = "profile image" ) -} +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/navigation/MyPageNavigation.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/navigation/MyPageNavigation.kt index 7248c8a2a..e2543a085 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/navigation/MyPageNavigation.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/navigation/MyPageNavigation.kt @@ -25,10 +25,10 @@ fun NavGraphBuilder.myPageNavGraph( composable { MyPageRoute( paddingValues = paddingValues, - navigateToProfileEdit = { name, profile -> + navigateToProfileEdit = { name, profileImage -> navHostController.navigateProfileEdit( name, - profile + profileImage ) } ) diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt index 577c5689b..24a81239a 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt @@ -35,13 +35,14 @@ import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White import com.terning.core.extension.addFocusCleaner import com.terning.core.extension.noRippleClickable +import com.terning.core.type.ProfileImage import com.terning.feature.R @Composable fun ProfileEditRoute( navigateUp: () -> Unit, initialName: String, - initialProfile: Int, + initialProfile: String, viewModel: ProfileEditViewModel = hiltViewModel(), ) { val state by viewModel.state.collectAsStateWithLifecycle() @@ -57,7 +58,10 @@ fun ProfileEditRoute( } LaunchedEffect(key1 = true) { - viewModel.updateInitialInfo(initialName = initialName, initialProfile = initialProfile) + viewModel.updateInitialInfo( + initialName = initialName, + initialProfile = initialProfile + ) } LaunchedEffect(viewModel.sideEffects, lifecycleOwner) { @@ -72,14 +76,15 @@ fun ProfileEditRoute( if (state.showBottomSheet) { ProfileBottomSheet( onDismiss = { viewModel.updateBottomSheet(false) }, - onSaveClick = { index -> + onSaveClick = { profileImage -> viewModel.updateBottomSheet(false) - viewModel.updateProfile(index) + viewModel.updateProfile(profileImage.stringValue) }, initialSelectedOption = state.profile ) } + ProfileEditScreen( profileEditState = state, onProfileEditClick = { isVisible -> @@ -137,7 +142,7 @@ fun ProfileEditScreen( onProfileEditClick(true) } .align(Alignment.CenterHorizontally), - index = profileEditState.profile + profileImage = profileEditState.profile ) Spacer(modifier = Modifier.height(48.dp)) Text( diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditState.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditState.kt index eb34b9548..a8f1d2b96 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditState.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditState.kt @@ -3,7 +3,7 @@ package com.terning.feature.mypage.profileedit data class ProfileEditState( val name: String = "", val initialName: String = "", - val profile: Int = 0, + val profile: String = "", val initialView: Boolean = true, val isButtonValid: Boolean = false, val authType: String = "", diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt index 58bf6349f..ecc575a98 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt @@ -27,7 +27,7 @@ class ProfileEditViewModel @Inject constructor() : ViewModel() { _state.value = _state.value.copy(showBottomSheet = isVisible) } - fun updateInitialInfo(initialName: String, initialProfile: Int) { + fun updateInitialInfo(initialName: String, initialProfile: String) { _state.value = _state.value.copy( name = initialName, initialName = initialName, @@ -36,11 +36,17 @@ class ProfileEditViewModel @Inject constructor() : ViewModel() { } fun updateName(name: String) { - _state.value = _state.value.copy(name = name, initialView = false) + _state.value = _state.value.copy( + name = name, + initialView = false + ) } - fun updateProfile(profile: Int) { - _state.value = _state.value.copy(profile = profile, initialView = false) + fun updateProfile(profile: String) { + _state.value = _state.value.copy( + profile = profile, + initialView = false + ) } fun updateButtonValidation(isValid: Boolean) { diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/navigation/ProfileEditNavigation.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/navigation/ProfileEditNavigation.kt index 71ef7f910..61b250f75 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/navigation/ProfileEditNavigation.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/navigation/ProfileEditNavigation.kt @@ -16,11 +16,11 @@ import kotlinx.serialization.Serializable fun NavController.navigateProfileEdit( name: String, - profile: Int, + profileImage: String, navOptions: NavOptions? = null ) { navigate( - route = ProfileEdit(name = name, profile = profile), + route = ProfileEdit(name = name, profileImage = profileImage), navOptions = navOptions ) } @@ -45,7 +45,7 @@ fun NavGraphBuilder.profileEditNavGraph( val args = it.toRoute() ProfileEditRoute( initialName = args.name, - initialProfile = args.profile, + initialProfile = args.profileImage, navigateUp = { navHostController.navigateUp() } ) } @@ -54,5 +54,5 @@ fun NavGraphBuilder.profileEditNavGraph( @Serializable data class ProfileEdit( val name: String, - val profile: Int + val profileImage: String ) : Route \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt index 4be2f12c7..ba7e5c715 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt @@ -63,9 +63,9 @@ fun SignUpRoute( if (state.showBottomSheet) { ProfileBottomSheet( onDismiss = { viewModel.updateBottomSheet(false) }, - onSaveClick = { index -> + onSaveClick = { profileImage -> viewModel.updateBottomSheet(false) - viewModel.updateProfileImage(index) + viewModel.updateProfileImage(profileImage.stringValue) }, initialSelectedOption = state.profileImage ) @@ -127,7 +127,7 @@ fun SignUpScreen( modifier = Modifier.noRippleClickable { onProfileEditClick(true) }, - index = state.profileImage + profileImage = state.profileImage ) } Column( @@ -167,7 +167,7 @@ fun SignUpScreenPreview() { onSignUpClick = {}, onInputChange = {}, onProfileEditClick = {}, - onValidationChanged = {} + onValidationChanged = {}, ) } } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt index 5a3f8b253..02c6c1796 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt @@ -2,7 +2,7 @@ package com.terning.feature.onboarding.signup data class SignUpState( val name: String = "", - val profileImage: Int = 0, + val profileImage: String = "", val isButtonValid: Boolean = false, val authId: String = "", val showBottomSheet: Boolean = false diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt index 504bf3ada..6493c627b 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt @@ -36,7 +36,7 @@ class SignUpViewModel @Inject constructor( _state.value = _state.value.copy(name = name) } - fun updateProfileImage(profileImage: Int) { + fun updateProfileImage(profileImage: String) { _state.value = _state.value.copy(profileImage = profileImage) } From e34d4d99e2015eca54e1a6eb229794c40d89185c Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 7 Sep 2024 12:12:14 +0900 Subject: [PATCH 03/10] =?UTF-8?q?[FEAT/#221]=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=8B=A4=ED=8C=A8=20=ED=99=94=EB=A9=B4=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 --- .../bottomsheet/ProfileBottomSheet.kt | 4 +- .../com/terning/core/type/ProfileImage.kt | 6 +- .../drawable/ic_terning_profile_default.xml | 9 +++ .../feature/mypage/mypage/MyPageRoute.kt | 28 ++++--- .../feature/mypage/mypage/MyPageSideEffect.kt | 3 + .../feature/mypage/mypage/MyPageViewModel.kt | 2 + .../mypage/profileedit/ProfileEditRoute.kt | 1 - .../res/drawable/ic_terning_profile_00.xml | 60 -------------- .../res/drawable/ic_terning_profile_01.xml | 80 ------------------- .../res/drawable/ic_terning_profile_02.xml | 75 ----------------- .../res/drawable/ic_terning_profile_03.xml | 76 ------------------ .../res/drawable/ic_terning_profile_04.xml | 74 ----------------- .../res/drawable/ic_terning_profile_05.xml | 73 ----------------- 13 files changed, 34 insertions(+), 457 deletions(-) create mode 100644 core/src/main/res/drawable/ic_terning_profile_default.xml delete mode 100644 feature/src/main/res/drawable/ic_terning_profile_00.xml delete mode 100644 feature/src/main/res/drawable/ic_terning_profile_01.xml delete mode 100644 feature/src/main/res/drawable/ic_terning_profile_02.xml delete mode 100644 feature/src/main/res/drawable/ic_terning_profile_03.xml delete mode 100644 feature/src/main/res/drawable/ic_terning_profile_04.xml delete mode 100644 feature/src/main/res/drawable/ic_terning_profile_05.xml diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt index 640952599..9ed4fbe71 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt @@ -97,10 +97,8 @@ fun RadioButtonGroup( initialSelectedOption: String, modifier: Modifier = Modifier, ) { - // 모든 ProfileImage 옵션을 가져옵니다. val options = ProfileImage.entries - // 초기 선택된 옵션을 ProfileImage로 변환하여 인덱스를 저장합니다. var selectedOptionIndex by rememberSaveable { mutableIntStateOf(ProfileImage.toIndex(ProfileImage.fromString(initialSelectedOption))) } @@ -111,7 +109,7 @@ fun RadioButtonGroup( horizontalArrangement = Arrangement.spacedBy(20.dp), modifier = modifier.padding(horizontal = 34.dp) ) { - itemsIndexed(options) { index, option -> + itemsIndexed(options.take(6)) { index, option -> val imageModifier = if (selectedOptionIndex == index) { Modifier .border( diff --git a/core/src/main/java/com/terning/core/type/ProfileImage.kt b/core/src/main/java/com/terning/core/type/ProfileImage.kt index 79fd6a1a4..eac0fda9d 100644 --- a/core/src/main/java/com/terning/core/type/ProfileImage.kt +++ b/core/src/main/java/com/terning/core/type/ProfileImage.kt @@ -12,7 +12,8 @@ enum class ProfileImage( SMART(drawableResId = R.drawable.ic_terning_profile_02, stringValue = "smart"), GLASS(drawableResId = R.drawable.ic_terning_profile_03, stringValue = "glass"), CALENDAR(drawableResId = R.drawable.ic_terning_profile_04, stringValue = "calendar"), - PASSION(drawableResId = R.drawable.ic_terning_profile_05, stringValue = "passion"); + PASSION(drawableResId = R.drawable.ic_terning_profile_05, stringValue = "passion"), + DEFAULT(drawableResId = R.drawable.ic_terning_profile_default, stringValue = "default"); companion object { fun fromString(value: String): ProfileImage = when (value) { @@ -21,7 +22,8 @@ enum class ProfileImage( "smart" -> SMART "glass" -> GLASS "calendar" -> CALENDAR - else -> PASSION + "passion" -> PASSION + else -> DEFAULT } fun toIndex(profileImage: ProfileImage): Int { diff --git a/core/src/main/res/drawable/ic_terning_profile_default.xml b/core/src/main/res/drawable/ic_terning_profile_default.xml new file mode 100644 index 000000000..e3a32368c --- /dev/null +++ b/core/src/main/res/drawable/ic_terning_profile_default.xml @@ -0,0 +1,9 @@ + + + diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt index 8dec567d4..4ec22dbcc 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt @@ -1,6 +1,5 @@ package com.terning.feature.mypage.mypage -import android.util.Log import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -42,6 +41,7 @@ import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White import com.terning.core.extension.noRippleClickable +import com.terning.core.extension.toast import com.terning.core.state.UiState import com.terning.feature.R import com.terning.feature.mypage.component.MyPageProfile @@ -81,6 +81,8 @@ fun MyPageRoute( state.name, state.profileImage ) + + is MyPageSideEffect.ShowToast -> context.toast(sideEffect.message) } } } @@ -129,13 +131,13 @@ fun MyPageRoute( ) } - is UiState.Loading -> { - Log.d("LYB", "로딩중") - } + is UiState.Loading -> {} is UiState.Empty -> {} is UiState.Failure -> { - Log.d("LYB", "실패") - + MyPageScreen( + paddingValues = paddingValues, + profileImage = state.profileImage, + ) } } @@ -152,13 +154,13 @@ fun MyPageRoute( @Composable fun MyPageScreen( - onEditClick: () -> Unit, - onLogoutClick: () -> Unit, - onQuitClick: () -> Unit, - onNoticeClick: () -> Unit, - onOpinionClick: () -> Unit, - onServiceClick: () -> Unit, - onPersonalClick: () -> Unit, + onEditClick: () -> Unit = {}, + onLogoutClick: () -> Unit = {}, + onQuitClick: () -> Unit = {}, + onNoticeClick: () -> Unit = {}, + onOpinionClick: () -> Unit = {}, + onServiceClick: () -> Unit = {}, + onPersonalClick: () -> Unit = {}, paddingValues: PaddingValues = PaddingValues(), name: String = "", profileImage: String = "" diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageSideEffect.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageSideEffect.kt index 26d1e5856..edeb627ea 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageSideEffect.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageSideEffect.kt @@ -1,5 +1,8 @@ package com.terning.feature.mypage.mypage +import androidx.annotation.StringRes + sealed class MyPageSideEffect { data object NavigateToProfileEdit : MyPageSideEffect() + data class ShowToast(@StringRes val message: Int) : MyPageSideEffect() } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt index b079d413b..535cf4b6d 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt @@ -13,6 +13,7 @@ import com.kakao.sdk.user.UserApiClient import com.terning.core.state.UiState import com.terning.domain.repository.MyPageRepository import com.terning.domain.repository.TokenRepository +import com.terning.feature.R import com.terning.feature.main.MainActivity import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableSharedFlow @@ -108,6 +109,7 @@ class MyPageViewModel @Inject constructor( authType = response.authType ) }.onFailure { + _sideEffects.emit(MyPageSideEffect.ShowToast(R.string.server_failure)) _state.value = _state.value.copy(isGetSuccess = UiState.Failure(it.toString())) } } diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt index 24a81239a..4e33d719f 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt @@ -84,7 +84,6 @@ fun ProfileEditRoute( ) } - ProfileEditScreen( profileEditState = state, onProfileEditClick = { isVisible -> diff --git a/feature/src/main/res/drawable/ic_terning_profile_00.xml b/feature/src/main/res/drawable/ic_terning_profile_00.xml deleted file mode 100644 index 99edfdf96..000000000 --- a/feature/src/main/res/drawable/ic_terning_profile_00.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/feature/src/main/res/drawable/ic_terning_profile_01.xml b/feature/src/main/res/drawable/ic_terning_profile_01.xml deleted file mode 100644 index 0bfcc7b29..000000000 --- a/feature/src/main/res/drawable/ic_terning_profile_01.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/feature/src/main/res/drawable/ic_terning_profile_02.xml b/feature/src/main/res/drawable/ic_terning_profile_02.xml deleted file mode 100644 index 8ba5ffc15..000000000 --- a/feature/src/main/res/drawable/ic_terning_profile_02.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/feature/src/main/res/drawable/ic_terning_profile_03.xml b/feature/src/main/res/drawable/ic_terning_profile_03.xml deleted file mode 100644 index 25e878efb..000000000 --- a/feature/src/main/res/drawable/ic_terning_profile_03.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/feature/src/main/res/drawable/ic_terning_profile_04.xml b/feature/src/main/res/drawable/ic_terning_profile_04.xml deleted file mode 100644 index 8b27c5c6c..000000000 --- a/feature/src/main/res/drawable/ic_terning_profile_04.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/feature/src/main/res/drawable/ic_terning_profile_05.xml b/feature/src/main/res/drawable/ic_terning_profile_05.xml deleted file mode 100644 index 9a32c789e..000000000 --- a/feature/src/main/res/drawable/ic_terning_profile_05.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - From f116f312cf41f29a6e77e0a5cc2fd35ccf49d4c6 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 7 Sep 2024 12:15:48 +0900 Subject: [PATCH 04/10] =?UTF-8?q?[FEAT/#221]=20=EC=A3=BC=EC=84=9D=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 --- .../component/bottomsheet/ProfileBottomSheet.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt index 9ed4fbe71..8067b2af7 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt @@ -39,7 +39,7 @@ import kotlinx.coroutines.launch * @param modifier 바텀시트에 적용할 Modifier입니다. * @param onDismiss 바텀시트가 닫힐 때 호출되는 콜백 함수입니다. * @param onSaveClick 저장하기 버튼 클릭 시, 호출되는 콜백 함수입니다. - * @param initialSelectedOption 초기에 선택된 이미지를 나타내는 인덱스 값입니다. + * @param initialSelectedOption 초기에 선택된 이미지의 이름을 string 값입니다. */ @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -87,8 +87,8 @@ fun ProfileBottomSheet( /** * 6개의 프로필 이미지 중, 하나의 이미지만 선택할 수 있는 라디오 버튼입니다. * - * @param onOptionSelected 선택된 이미지의 인덱스 값을 나타내는 콜백 함수입니다. - * @param initialSelectedOption 초기에 선택된 이미지를 나타내는 인덱스 값입니다. + * @param onOptionSelected 선택된 이미지의 이름을 나타내는 콜백 함수입니다. + * @param initialSelectedOption 초기에 선택된 이미지의 이름을 나타내는 string 값입니다. * @param modifier 라디오 버튼에 적용할 Modifier입니다. */ @Composable From dcf7894c126a14e3f4129a40e03929006f675787 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 7 Sep 2024 19:06:25 +0900 Subject: [PATCH 05/10] =?UTF-8?q?[FEAT/#221]=20=ED=94=84=EB=A1=9C=ED=95=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20=EB=B7=B0=20=EC=84=9C=EB=B2=84=ED=86=B5?= =?UTF-8?q?=EC=8B=A0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datasource/MyPageDataSource.kt | 5 +++++ .../datasourceimpl/MyPageDataSourceImpl.kt | 5 +++++ .../request/MyPageProfileEditRequestDto.kt | 12 ++++++++++ .../data/mapper/mypage/MyPageMapper.kt | 4 ++-- .../mapper/mypage/MyPageProfileEditMapper.kt | 10 +++++++++ .../repositoryimpl/MyPageRepositoryImpl.kt | 15 +++++++++++-- .../com/terning/data/service/MyPageService.kt | 4 ++++ ...MyPageProfileModel.kt => MyPageProfile.kt} | 2 +- .../domain/entity/mypage/MyPageProfileEdit.kt | 6 +++++ .../domain/repository/MyPageRepository.kt | 9 ++++++-- .../mypage/profileedit/ProfileEditRoute.kt | 10 +++++++-- .../profileedit/ProfileEditSideEffect.kt | 3 +++ .../profileedit/ProfileEditViewModel.kt | 22 ++++++++++++++++++- 13 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 data/src/main/java/com/terning/data/dto/request/MyPageProfileEditRequestDto.kt create mode 100644 data/src/main/java/com/terning/data/mapper/mypage/MyPageProfileEditMapper.kt rename domain/src/main/java/com/terning/domain/entity/mypage/{MyPageProfileModel.kt => MyPageProfile.kt} (79%) create mode 100644 domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileEdit.kt diff --git a/data/src/main/java/com/terning/data/datasource/MyPageDataSource.kt b/data/src/main/java/com/terning/data/datasource/MyPageDataSource.kt index 5eee61e1b..60361d5f2 100644 --- a/data/src/main/java/com/terning/data/datasource/MyPageDataSource.kt +++ b/data/src/main/java/com/terning/data/datasource/MyPageDataSource.kt @@ -2,6 +2,7 @@ package com.terning.data.datasource import com.terning.data.dto.BaseResponse import com.terning.data.dto.NonDataBaseResponse +import com.terning.data.dto.request.MyPageProfileEditRequestDto import com.terning.data.dto.response.MyPageResponseDto interface MyPageDataSource { @@ -10,4 +11,8 @@ interface MyPageDataSource { suspend fun deleteQuit(): NonDataBaseResponse suspend fun getProfile(): BaseResponse + + suspend fun editProfile( + request: MyPageProfileEditRequestDto + ): NonDataBaseResponse } \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt b/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt index d1636d0d5..faf607c61 100644 --- a/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt +++ b/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt @@ -3,6 +3,7 @@ package com.terning.data.datasourceimpl import com.terning.data.datasource.MyPageDataSource import com.terning.data.dto.BaseResponse import com.terning.data.dto.NonDataBaseResponse +import com.terning.data.dto.request.MyPageProfileEditRequestDto import com.terning.data.dto.response.MyPageResponseDto import com.terning.data.service.MyPageService import javax.inject.Inject @@ -15,4 +16,8 @@ class MyPageDataSourceImpl @Inject constructor( override suspend fun deleteQuit(): NonDataBaseResponse = myPageService.deleteQuit() override suspend fun getProfile(): BaseResponse = myPageService.getProfile() + + override suspend fun editProfile( + request: MyPageProfileEditRequestDto + ): NonDataBaseResponse = myPageService.modifyProfile() } \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/dto/request/MyPageProfileEditRequestDto.kt b/data/src/main/java/com/terning/data/dto/request/MyPageProfileEditRequestDto.kt new file mode 100644 index 000000000..3f4c7ef8a --- /dev/null +++ b/data/src/main/java/com/terning/data/dto/request/MyPageProfileEditRequestDto.kt @@ -0,0 +1,12 @@ +package com.terning.data.dto.request + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class MyPageProfileEditRequestDto( + @SerialName("name") + val name: String, + @SerialName("profileImage") + val profileImage: String, +) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt b/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt index cfc5c65ba..0a19f6e76 100644 --- a/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt +++ b/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt @@ -1,10 +1,10 @@ package com.terning.data.mapper.mypage import com.terning.data.dto.response.MyPageResponseDto -import com.terning.domain.entity.mypage.MyPageProfileModel +import com.terning.domain.entity.mypage.MyPageProfile fun MyPageResponseDto.toMyPageProfile() = - MyPageProfileModel( + MyPageProfile( name = name, profileImage = profileImage, authType = authType diff --git a/data/src/main/java/com/terning/data/mapper/mypage/MyPageProfileEditMapper.kt b/data/src/main/java/com/terning/data/mapper/mypage/MyPageProfileEditMapper.kt new file mode 100644 index 000000000..892bbd425 --- /dev/null +++ b/data/src/main/java/com/terning/data/mapper/mypage/MyPageProfileEditMapper.kt @@ -0,0 +1,10 @@ +package com.terning.data.mapper.mypage + +import com.terning.data.dto.request.MyPageProfileEditRequestDto +import com.terning.domain.entity.mypage.MyPageProfileEdit + +fun MyPageProfileEdit.toMyPageProfileEditRequestDto(): MyPageProfileEditRequestDto = + MyPageProfileEditRequestDto( + name = name, + profileImage = profileImage + ) diff --git a/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt index 45cafad9b..76aa84af2 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt @@ -2,7 +2,9 @@ package com.terning.data.repositoryimpl import com.terning.data.datasource.MyPageDataSource import com.terning.data.mapper.mypage.toMyPageProfile -import com.terning.domain.entity.mypage.MyPageProfileModel +import com.terning.data.mapper.mypage.toMyPageProfileEditRequestDto +import com.terning.domain.entity.mypage.MyPageProfile +import com.terning.domain.entity.mypage.MyPageProfileEdit import com.terning.domain.repository.MyPageRepository import javax.inject.Inject @@ -19,8 +21,17 @@ class MyPageRepositoryImpl @Inject constructor( myPageDataSource.deleteQuit() } - override suspend fun getProfile(): Result = + override suspend fun getProfile(): Result = runCatching { myPageDataSource.getProfile().result.toMyPageProfile() } + + override suspend fun editProfile( + request: MyPageProfileEdit + ): Result = + runCatching { + myPageDataSource.editProfile( + request.toMyPageProfileEditRequestDto() + ) + } } \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/service/MyPageService.kt b/data/src/main/java/com/terning/data/service/MyPageService.kt index 26a7d76ca..d033094d0 100644 --- a/data/src/main/java/com/terning/data/service/MyPageService.kt +++ b/data/src/main/java/com/terning/data/service/MyPageService.kt @@ -5,6 +5,7 @@ import com.terning.data.dto.NonDataBaseResponse import com.terning.data.dto.response.MyPageResponseDto import retrofit2.http.DELETE import retrofit2.http.GET +import retrofit2.http.PATCH import retrofit2.http.POST interface MyPageService { @@ -16,4 +17,7 @@ interface MyPageService { @GET("api/v1/mypage/profile") suspend fun getProfile(): BaseResponse + + @PATCH("api/v1/mypage/profile") + suspend fun modifyProfile(): NonDataBaseResponse } \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileModel.kt b/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfile.kt similarity index 79% rename from domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileModel.kt rename to domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfile.kt index b9a617564..356758d3e 100644 --- a/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfile.kt @@ -1,6 +1,6 @@ package com.terning.domain.entity.mypage -data class MyPageProfileModel( +data class MyPageProfile( val name: String, val profileImage: String, val authType: String diff --git a/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileEdit.kt b/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileEdit.kt new file mode 100644 index 000000000..398575b04 --- /dev/null +++ b/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileEdit.kt @@ -0,0 +1,6 @@ +package com.terning.domain.entity.mypage + +data class MyPageProfileEdit( + val name: String, + val profileImage: String +) \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt b/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt index 26eaed11f..917b82c17 100644 --- a/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt @@ -1,11 +1,16 @@ package com.terning.domain.repository -import com.terning.domain.entity.mypage.MyPageProfileModel +import com.terning.domain.entity.mypage.MyPageProfile +import com.terning.domain.entity.mypage.MyPageProfileEdit interface MyPageRepository { suspend fun postLogout(): Result suspend fun deleteQuit(): Result - suspend fun getProfile(): Result + suspend fun getProfile(): Result + + suspend fun editProfile( + request: MyPageProfileEdit + ): Result } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt index 4e33d719f..565969645 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt @@ -15,6 +15,7 @@ import androidx.compose.runtime.SideEffect import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview @@ -35,7 +36,7 @@ import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White import com.terning.core.extension.addFocusCleaner import com.terning.core.extension.noRippleClickable -import com.terning.core.type.ProfileImage +import com.terning.core.extension.toast import com.terning.feature.R @Composable @@ -48,6 +49,7 @@ fun ProfileEditRoute( val state by viewModel.state.collectAsStateWithLifecycle() val lifecycleOwner = LocalLifecycleOwner.current + val context = LocalContext.current val systemUiController = rememberSystemUiController() @@ -69,6 +71,7 @@ fun ProfileEditRoute( .collect { sideEffect -> when (sideEffect) { is ProfileEditSideEffect.NavigateUp -> navigateUp() + is ProfileEditSideEffect.ShowToast -> context.toast(sideEffect.message) } } } @@ -92,7 +95,10 @@ fun ProfileEditRoute( onInputChange = { editName -> viewModel.updateName(editName) }, - onSaveClick = { viewModel.navigateUp() }, + onSaveClick = { + viewModel.modifyUserInfo() + // viewModel.navigateUp() + }, name = state.name, onBackButtonClick = { viewModel.navigateUp() }, onValidationChanged = { isValid -> diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditSideEffect.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditSideEffect.kt index 6fd2f3668..9d16e2bc8 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditSideEffect.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditSideEffect.kt @@ -1,5 +1,8 @@ package com.terning.feature.mypage.profileedit +import androidx.annotation.StringRes + sealed class ProfileEditSideEffect { data object NavigateUp : ProfileEditSideEffect() + data class ShowToast(@StringRes val message: Int) : ProfileEditSideEffect() } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt index ecc575a98..5516b79c2 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt @@ -2,6 +2,9 @@ package com.terning.feature.mypage.profileedit import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope +import com.terning.domain.entity.mypage.MyPageProfileEdit +import com.terning.domain.repository.MyPageRepository +import com.terning.feature.R import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow @@ -13,7 +16,9 @@ import kotlinx.coroutines.launch import javax.inject.Inject @HiltViewModel -class ProfileEditViewModel @Inject constructor() : ViewModel() { +class ProfileEditViewModel @Inject constructor( + private val myPageRepository: MyPageRepository, +) : ViewModel() { private val _state: MutableStateFlow = MutableStateFlow(ProfileEditState()) val state: StateFlow get() = _state.asStateFlow() @@ -53,4 +58,19 @@ class ProfileEditViewModel @Inject constructor() : ViewModel() { _state.value = _state.value.copy(isButtonValid = isValid) } + fun modifyUserInfo() { + viewModelScope.launch { + myPageRepository.editProfile( + MyPageProfileEdit( + name = _state.value.name, + profileImage = _state.value.profile + ) + ).onSuccess { + _sideEffects.emit(ProfileEditSideEffect.NavigateUp) + }.onFailure { + _sideEffects.emit(ProfileEditSideEffect.ShowToast(R.string.server_failure)) + } + } + } + } \ No newline at end of file From b668696cb40c86fdbd606c4281fd5632e25d08d0 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 7 Sep 2024 19:11:31 +0900 Subject: [PATCH 06/10] =?UTF-8?q?[FEAT/#221]=20=EC=BD=94=EB=93=9C=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 --- core/src/main/java/com/terning/core/type/ProfileImage.kt | 5 ++--- .../com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt | 2 +- data/src/main/java/com/terning/data/service/MyPageService.kt | 2 +- .../terning/feature/mypage/profileedit/ProfileEditRoute.kt | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/terning/core/type/ProfileImage.kt b/core/src/main/java/com/terning/core/type/ProfileImage.kt index eac0fda9d..df24f2d39 100644 --- a/core/src/main/java/com/terning/core/type/ProfileImage.kt +++ b/core/src/main/java/com/terning/core/type/ProfileImage.kt @@ -26,8 +26,7 @@ enum class ProfileImage( else -> DEFAULT } - fun toIndex(profileImage: ProfileImage): Int { - return entries.indexOf(profileImage) - } + fun toIndex(profileImage: ProfileImage): Int = + entries.indexOf(profileImage) } } diff --git a/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt b/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt index faf607c61..bc96ce7b0 100644 --- a/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt +++ b/data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.kt @@ -19,5 +19,5 @@ class MyPageDataSourceImpl @Inject constructor( override suspend fun editProfile( request: MyPageProfileEditRequestDto - ): NonDataBaseResponse = myPageService.modifyProfile() + ): NonDataBaseResponse = myPageService.editProfile() } \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/service/MyPageService.kt b/data/src/main/java/com/terning/data/service/MyPageService.kt index d033094d0..6ce2d16ae 100644 --- a/data/src/main/java/com/terning/data/service/MyPageService.kt +++ b/data/src/main/java/com/terning/data/service/MyPageService.kt @@ -19,5 +19,5 @@ interface MyPageService { suspend fun getProfile(): BaseResponse @PATCH("api/v1/mypage/profile") - suspend fun modifyProfile(): NonDataBaseResponse + suspend fun editProfile(): NonDataBaseResponse } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt index 565969645..7dba0d325 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt @@ -97,7 +97,6 @@ fun ProfileEditRoute( }, onSaveClick = { viewModel.modifyUserInfo() - // viewModel.navigateUp() }, name = state.name, onBackButtonClick = { viewModel.navigateUp() }, From 34cab10ce1c5648948d02773380b478e9b012ad7 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 7 Sep 2024 19:18:55 +0900 Subject: [PATCH 07/10] =?UTF-8?q?[FEAT/#221]=20@DrawableRes=20=EC=96=B4?= =?UTF-8?q?=EB=85=B8=ED=85=8C=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/main/java/com/terning/core/type/ProfileImage.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/terning/core/type/ProfileImage.kt b/core/src/main/java/com/terning/core/type/ProfileImage.kt index df24f2d39..8ccc58040 100644 --- a/core/src/main/java/com/terning/core/type/ProfileImage.kt +++ b/core/src/main/java/com/terning/core/type/ProfileImage.kt @@ -1,9 +1,10 @@ package com.terning.core.type +import androidx.annotation.DrawableRes import com.terning.core.R enum class ProfileImage( - val drawableResId: Int, + @DrawableRes val drawableResId: Int, val stringValue: String ) { From a4f1c0c081921cb25af21b742350f2d6fe6e1f35 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 7 Sep 2024 19:20:38 +0900 Subject: [PATCH 08/10] =?UTF-8?q?[MOD/#221]=20=EC=A3=BC=EC=84=9D=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 --- .../designsystem/component/bottomsheet/ProfileBottomSheet.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt index 8067b2af7..9109deb87 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/ProfileBottomSheet.kt @@ -39,7 +39,7 @@ import kotlinx.coroutines.launch * @param modifier 바텀시트에 적용할 Modifier입니다. * @param onDismiss 바텀시트가 닫힐 때 호출되는 콜백 함수입니다. * @param onSaveClick 저장하기 버튼 클릭 시, 호출되는 콜백 함수입니다. - * @param initialSelectedOption 초기에 선택된 이미지의 이름을 string 값입니다. + * @param initialSelectedOption 초기에 선택된 이미지의 이름을 나타내는 string 값입니다. */ @OptIn(ExperimentalMaterial3Api::class) @Composable From fdba10ce2f6041dffea6ab996a3f3c6b03bfe8c4 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sat, 7 Sep 2024 20:27:02 +0900 Subject: [PATCH 09/10] =?UTF-8?q?[FEAT/#221]=20SnackBar=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 --- .../snackbar/TerningBasicSnackBar.kt | 23 ++++++++++++++ .../com/terning/feature/main/MainScreen.kt | 31 ++++++++++++++----- 2 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 core/src/main/java/com/terning/core/designsystem/component/snackbar/TerningBasicSnackBar.kt diff --git a/core/src/main/java/com/terning/core/designsystem/component/snackbar/TerningBasicSnackBar.kt b/core/src/main/java/com/terning/core/designsystem/component/snackbar/TerningBasicSnackBar.kt new file mode 100644 index 000000000..0d12f3811 --- /dev/null +++ b/core/src/main/java/com/terning/core/designsystem/component/snackbar/TerningBasicSnackBar.kt @@ -0,0 +1,23 @@ +package com.terning.core.designsystem.component.snackbar + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.theme.Grey500 + +@Composable +fun TerningBasicSnackBar(content: @Composable () -> Unit) { + Box( + modifier = Modifier + .clip(CircleShape) + .background(Grey500) + .padding(vertical = 7.dp, horizontal = 20.dp) + ) { + content() + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/main/MainScreen.kt b/feature/src/main/java/com/terning/feature/main/MainScreen.kt index 5836eeeb1..516f63bf1 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -1,8 +1,6 @@ package com.terning.feature.main import android.app.Activity -import android.content.Intent -import android.widget.Toast import androidx.activity.compose.BackHandler import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.EnterTransition @@ -17,6 +15,9 @@ import androidx.compose.material3.Icon import androidx.compose.material3.NavigationBar import androidx.compose.material3.NavigationBarItem import androidx.compose.material3.Scaffold +import androidx.compose.material3.SnackbarDuration +import androidx.compose.material3.SnackbarHost +import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -30,8 +31,8 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.sp -import androidx.core.content.ContextCompat.startActivity import androidx.navigation.compose.NavHost +import com.terning.core.designsystem.component.snackbar.TerningBasicSnackBar import com.terning.core.designsystem.theme.Grey300 import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.White @@ -44,7 +45,6 @@ import com.terning.feature.filtering.startfiltering.navigation.startFilteringNav import com.terning.feature.filtering.starthome.navigation.startHomeNavGraph import com.terning.feature.home.changefilter.navigation.changeFilterNavGraph import com.terning.feature.home.home.navigation.homeNavGraph -import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.intern.navigation.internNavGraph import com.terning.feature.mypage.mypage.navigation.myPageNavGraph import com.terning.feature.mypage.profileedit.navigation.profileEditNavGraph @@ -53,7 +53,6 @@ import com.terning.feature.onboarding.signup.navigation.signUpNavGraph import com.terning.feature.onboarding.splash.navigation.splashNavGraph import com.terning.feature.search.search.navigation.searchNavGraph import com.terning.feature.search.searchprocess.navigation.searchProcessNavGraph -import kotlinx.coroutines.delay import kotlinx.coroutines.launch @Composable @@ -64,17 +63,35 @@ fun MainScreen( var backPressedState by remember { mutableStateOf(true) } var backPressedTime = 0L + val snackBarHostState = remember { SnackbarHostState() } + val coroutineScope = rememberCoroutineScope() + BackHandler(enabled = backPressedState) { - if(System.currentTimeMillis() - backPressedTime <= 3000) { + if (System.currentTimeMillis() - backPressedTime <= 3000) { (context as Activity).finish() } else { backPressedState = true - Toast.makeText(context, "한 번 더 누르시면 앱이 종료됩니다.", Toast.LENGTH_SHORT).show() + coroutineScope.launch { + snackBarHostState.showSnackbar( + message = "버튼을 한 번 더 누르면 종료돼요", + duration = SnackbarDuration.Short + ) + } } backPressedTime = System.currentTimeMillis() } Scaffold( + snackbarHost = { + SnackbarHost(hostState = snackBarHostState) { snackBarData -> + TerningBasicSnackBar { + Text( + text = snackBarData.visuals.message, + color = White, + ) + } + } + }, bottomBar = { MainBottomBar( isVisible = navigator.showBottomBar(), From 348b2a03101ccaecb8241a4a3c1c8ccf775ab3e4 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 8 Sep 2024 14:25:27 +0900 Subject: [PATCH 10/10] =?UTF-8?q?[FEAT/#221]=20=EC=9E=84=EC=8B=9C=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 --- core/src/main/java/com/terning/core/type/ProfileImage.kt | 2 +- .../java/com/terning/feature/onboarding/signup/SignUpState.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/terning/core/type/ProfileImage.kt b/core/src/main/java/com/terning/core/type/ProfileImage.kt index 8ccc58040..f4836df27 100644 --- a/core/src/main/java/com/terning/core/type/ProfileImage.kt +++ b/core/src/main/java/com/terning/core/type/ProfileImage.kt @@ -24,7 +24,7 @@ enum class ProfileImage( "glass" -> GLASS "calendar" -> CALENDAR "passion" -> PASSION - else -> DEFAULT + else -> BASIC } fun toIndex(profileImage: ProfileImage): Int = diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt index 02c6c1796..773904e4c 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpState.kt @@ -2,7 +2,7 @@ package com.terning.feature.onboarding.signup data class SignUpState( val name: String = "", - val profileImage: String = "", + val profileImage: String = "basic", val isButtonValid: Boolean = false, val authId: String = "", val showBottomSheet: Boolean = false