From de3711f1dca729d02889aad915efda9a65cf2de0 Mon Sep 17 00:00:00 2001 From: seoyeonsw Date: Wed, 6 Nov 2024 00:49:06 +0900 Subject: [PATCH 1/8] =?UTF-8?q?#11=20=ED=94=84=EB=A1=9C=ED=95=84=20&=20?= =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core_ui/component/BottomSheetButton.kt | 4 + .../core_ui/component/SignUpLoginTextfield.kt | 1 - .../presentation/auth/SignUpScreen1.kt | 8 +- .../main/screen/LikeListScreen.kt | 4 + .../profile/screen/ProfileScreen.kt | 214 +++++++++++++++++- .../profile/screen/ProfileScreenItem.kt | 70 ++++++ app/src/main/res/values/strings.xml | 1 + 7 files changed, 290 insertions(+), 12 deletions(-) create mode 100644 app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/BottomSheetButton.kt create mode 100644 app/src/main/java/com/hackathon/alddeul_babsang/presentation/main/screen/LikeListScreen.kt create mode 100644 app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/BottomSheetButton.kt b/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/BottomSheetButton.kt new file mode 100644 index 0000000..221e2de --- /dev/null +++ b/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/BottomSheetButton.kt @@ -0,0 +1,4 @@ +package com.hackathon.alddeul_babsang.core_ui.component + +class BottomSheetButton { +} \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/SignUpLoginTextfield.kt b/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/SignUpLoginTextfield.kt index f7d168c..6bf6db0 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/SignUpLoginTextfield.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/SignUpLoginTextfield.kt @@ -5,7 +5,6 @@ import androidx.compose.material3.TextField import androidx.compose.material3.TextFieldDefaults import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color -import androidx.compose.ui.unit.sp import com.hackathon.alddeul_babsang.core_ui.theme.* @Composable diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/auth/SignUpScreen1.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/auth/SignUpScreen1.kt index 55d8ed4..0bb72da 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/auth/SignUpScreen1.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/auth/SignUpScreen1.kt @@ -48,7 +48,7 @@ fun SignUpScreen1(navController: NavController) { verticalArrangement = Arrangement.Top ) { Text( - stringResource(R.string.setIdPassword), + stringResource(R.string.tv_signup_setIdPassword), textAlign = TextAlign.Center, style = head4Bold, lineHeight = 25.sp @@ -59,7 +59,7 @@ fun SignUpScreen1(navController: NavController) { SignUpLoginTextField( value = id, onValueChange = setId, - placeholderText = stringResource(R.string.setId) + placeholderText = stringResource(R.string.tf_signup_setId) ) Spacer(modifier = Modifier.height(16.dp)) @@ -67,13 +67,13 @@ fun SignUpScreen1(navController: NavController) { SignUpLoginTextField( value = password, onValueChange = setPassword, - placeholderText = stringResource(R.string.setPassword) + placeholderText = stringResource(R.string.tf_signup_setPassword) ) Spacer(modifier = Modifier.weight(1f)) AlddeulButton( - text = R.string.next, + text = R.string.btn_signup_next, onClick = { if (id.isNotEmpty() && password.isNotEmpty()) { //navController.navigate("signUp2") diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/main/screen/LikeListScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/main/screen/LikeListScreen.kt new file mode 100644 index 0000000..b49bbb5 --- /dev/null +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/main/screen/LikeListScreen.kt @@ -0,0 +1,4 @@ +package com.hackathon.alddeul_babsang.presentation.main.screen + +class LikeListScreen { +} \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt index 0315bee..ed74c51 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt @@ -1,28 +1,228 @@ package com.hackathon.alddeul_babsang.presentation.profile.screen +import android.content.Context +import android.content.Intent +import android.net.Uri +import androidx.compose.foundation.BorderStroke +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.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.layout.width +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.ArrowForward +import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.filled.ArrowForward +import androidx.compose.material3.Divider +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.navigation.NavController +import androidx.navigation.compose.rememberNavController +import coil.compose.AsyncImage +import com.hackathon.alddeul_babsang.R +import com.hackathon.alddeul_babsang.core_ui.theme.AlddeulBabsangTheme +import com.hackathon.alddeul_babsang.core_ui.theme.Gray200 +import com.hackathon.alddeul_babsang.core_ui.theme.Gray300 +import com.hackathon.alddeul_babsang.core_ui.theme.Gray400 +import com.hackathon.alddeul_babsang.core_ui.theme.Gray500 +import com.hackathon.alddeul_babsang.core_ui.theme.Orange700 +import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold +import com.hackathon.alddeul_babsang.core_ui.theme.head6Semi +import com.hackathon.alddeul_babsang.core_ui.theme.head7Semi import com.hackathon.alddeul_babsang.presentation.profile.navigation.ProfileNavigator + + @Composable fun ProfileRoute( navigator: ProfileNavigator ) { - ProfileScreen() + ProfileScreen( + navController = navigator.navController, + ) } @Composable -fun ProfileScreen() { +fun ProfileScreen( + navController: NavController, +) { + val context = LocalContext.current + Column( - modifier = Modifier.fillMaxSize(), - verticalArrangement = Arrangement.Center, - horizontalAlignment = Alignment.CenterHorizontally + modifier = Modifier + .fillMaxSize() + .background(Color.White), + ) { - Text(text = "프로필") + Row(modifier = Modifier.padding(top=60.dp) + .fillMaxWidth()){ + Spacer(modifier = Modifier.width(30.dp)) + AsyncImage( + modifier = Modifier + .size(107.dp) + .clip(CircleShape) + .border(5.dp, Color(0xFFFAB935), CircleShape), + model = "", + contentDescription = null, + contentScale = ContentScale.Crop + ) + + Spacer(modifier = Modifier.width(30.dp)) + + Column { + Spacer(modifier = Modifier.height(25.dp)) + Text("닉네임", style = head4Bold) + Spacer(modifier = Modifier.height(10.dp)) + Row(){ + Text(stringResource(R.string.tv_profile_likelist), style = head7Semi, color=Gray300) + Spacer(modifier = Modifier.width(10.dp)) + + Image( + painter = painterResource(id = R.drawable.ic_back), + contentDescription = null, + colorFilter = ColorFilter.tint(Gray300), + modifier = Modifier + .graphicsLayer(scaleX = -1f) // 좌우 반전 + //.clickable(onClick={ + //navController.navigate("signUp2") + //}) + ) + } + } + + } + Spacer(modifier = Modifier.height(80.dp)) + + Column( + modifier = Modifier + .height(200.dp) + ){ + Text("이용안내",style= head6Semi, modifier = Modifier + .padding(start=30.dp) + .fillMaxWidth() + .height(30.dp)) + + Spacer(modifier = Modifier.height(20.dp)) + ProfileScreenItem( + text = "서비스 이용약관", + onClick = { + navigateToWebsite( + context = context, + "https://massive-maple-b53.notion.site/426578b24235447abccaae359549cdb7?pvs=4" + ) + } + ) + + Spacer(modifier = Modifier.height(20.dp)) + ProfileScreenItem( + text = "개인정보 처리방침", + onClick = { + navigateToWebsite( + context = context, + "https://massive-maple-b53.notion.site/430e2c92b8694ad6a8b4497f3a3b4452" + ) + } + ) + + Spacer(modifier = Modifier.height(20.dp)) + ProfileScreenItem( + text = "버전 정보", + onClick = {} + ) + + Spacer(modifier = Modifier.height(20.dp)) + + HorizontalDivider( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 10.dp) + ) + + } + + Spacer(modifier = Modifier.height(30.dp)) + + Column( + modifier = Modifier + .height(200.dp) + ){ + Text("기타",style= head6Semi, modifier = Modifier + .padding(start=30.dp) + .fillMaxWidth() + .height(30.dp)) + + Spacer(modifier = Modifier.height(20.dp)) + ProfileScreenItem( + text = "고객센터", + onClick = {} + ) + + Spacer(modifier = Modifier.height(20.dp)) + ProfileScreenItem( + text = "로그아웃", + onClick = {} + ) + + Spacer(modifier = Modifier.height(20.dp)) + ProfileScreenItem( + text = "회원 탈퇴", + onClick = {} + ) + + Spacer(modifier = Modifier.height(20.dp)) + + } + + + + + } -} \ No newline at end of file +} + + +fun navigateToWebsite(context: Context, url: String) { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + context.startActivity(intent) +} + + + +@Preview +@Composable +fun ProfileScreenPreview() { + AlddeulBabsangTheme { + ProfileScreen( + navController = rememberNavController() + ) + } +} diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt new file mode 100644 index 0000000..8c26b0f --- /dev/null +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt @@ -0,0 +1,70 @@ +package com.hackathon.alddeul_babsang.presentation.profile.screen + +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Box +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.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.hackathon.alddeul_babsang.R +import com.hackathon.alddeul_babsang.core_ui.theme.Gray300 +import com.hackathon.alddeul_babsang.core_ui.theme.Gray400 +import com.hackathon.alddeul_babsang.core_ui.theme.body1Semi +import com.hackathon.alddeul_babsang.core_ui.theme.head5Semi +import com.hackathon.alddeul_babsang.core_ui.theme.head7Semi + + +@Composable +fun ProfileScreenItem( + text: String, + onClick: () -> Unit +) { + Box( + modifier = Modifier + .fillMaxWidth() + .height(30.dp) + .clickable { onClick() } + ) { + Text( + modifier = Modifier.align(Alignment.CenterStart) + .padding(start = 30.dp), + text = text, + color = Gray400, + style = head7Semi + ) + IconButton( + modifier = Modifier + .align(Alignment.CenterEnd) + .graphicsLayer(scaleX = -1f), + onClick = { onClick() } + ) { + Icon( + imageVector = ImageVector.vectorResource(id = R.drawable.ic_back), + contentDescription = null, + tint = Gray300 + ) + } + } +} + +@Preview +@Composable +fun ProfileScreenItemPreview() { + ProfileScreenItem( + text = "개인정보 수정", + onClick = {} + ) +} \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ed4bc54..ab9ee98 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -28,5 +28,6 @@ 아이디와 비밀번호를\n설정해주세요 아이디 입력 비밀번호 입력 + 좋아요 목록 \ No newline at end of file From ed9f7fdda4b22d1aeca3a46949cd2d6bb91ba06e Mon Sep 17 00:00:00 2001 From: seoyeonsw Date: Wed, 6 Nov 2024 06:01:49 +0900 Subject: [PATCH 2/8] =?UTF-8?q?#11=20=ED=94=84=EB=A1=9C=ED=95=84=20&=20?= =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core_ui/component/SignUpLoginTextfield.kt | 34 --- .../main/screen/LikeListScreen.kt | 4 - .../profile/navigation/ProfileNavGraph.kt | 11 + .../profile/navigation/ProfileNavigator.kt | 8 + .../presentation/profile/screen/LikeItem.kt | 183 ++++++++++++++++ .../profile/screen/LikeListViewModel.kt | 88 ++++++++ .../profile/screen/ProfileLikeListScreen.kt | 163 ++++++++++++++ .../profile/screen/ProfileScreen.kt | 207 ++++++++++++++---- app/src/main/res/values/strings.xml | 7 + 9 files changed, 621 insertions(+), 84 deletions(-) delete mode 100644 app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/SignUpLoginTextfield.kt delete mode 100644 app/src/main/java/com/hackathon/alddeul_babsang/presentation/main/screen/LikeListScreen.kt create mode 100644 app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt create mode 100644 app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt create mode 100644 app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/SignUpLoginTextfield.kt b/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/SignUpLoginTextfield.kt deleted file mode 100644 index 6bf6db0..0000000 --- a/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/SignUpLoginTextfield.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.hackathon.alddeul_babsang.core_ui.component - -import androidx.compose.material3.Text -import androidx.compose.material3.TextField -import androidx.compose.material3.TextFieldDefaults -import androidx.compose.runtime.Composable -import androidx.compose.ui.graphics.Color -import com.hackathon.alddeul_babsang.core_ui.theme.* - -@Composable -fun SignUpLoginTextField( - value: String, - onValueChange: (String) -> Unit, - placeholderText: String -) { - TextField( - value = value, - onValueChange = onValueChange, - placeholder = { - Text( - text = placeholderText, - style = head4Bold, - color = Gray300, - ) - }, - colors = TextFieldDefaults.colors( - focusedContainerColor = Color.White, // 포커스된 상태에서 배경색을 흰색으로 설정 - unfocusedContainerColor = Color.White, // 비포커스 상태에서 배경색을 흰색으로 설정 - cursorColor = Color.Black, - focusedIndicatorColor = Orange900, - unfocusedIndicatorColor = Gray300 - ) - ) -} diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/main/screen/LikeListScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/main/screen/LikeListScreen.kt deleted file mode 100644 index b49bbb5..0000000 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/main/screen/LikeListScreen.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.hackathon.alddeul_babsang.presentation.main.screen - -class LikeListScreen { -} \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt index 8d1efdb..92ee9c7 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt @@ -2,7 +2,10 @@ package com.hackathon.alddeul_babsang.presentation.profile.navigation import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable +import com.hackathon.alddeul_babsang.presentation.profile.screen.ProfileLikeListRoute import com.hackathon.alddeul_babsang.presentation.profile.screen.ProfileRoute +import com.hackathon.alddeul_babsang.presentation.report.navigation.ReportNavigator +import com.hackathon.alddeul_babsang.presentation.report.screen.ReportWriteRoute fun NavGraphBuilder.profileNavGraph( navigator: ProfileNavigator @@ -10,4 +13,12 @@ fun NavGraphBuilder.profileNavGraph( composable(route = "profile") { ProfileRoute(navigator = navigator) } +} + +fun NavGraphBuilder.profileLikeListNavGraph( + navigator: ProfileNavigator +) { + composable(route = "profileLikeList") { + ProfileLikeListRoute(navigator = navigator) + } } \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt index 856376d..b5e2bb2 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt @@ -5,4 +5,12 @@ import androidx.navigation.NavController class ProfileNavigator( val navController: NavController ) { + + fun profileLikeList() { + navController.navigate("profileLikeList") + } + + fun navigateBack() { + navController.popBackStack() + } } \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt new file mode 100644 index 0000000..1f11653 --- /dev/null +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt @@ -0,0 +1,183 @@ +package com.hackathon.alddeul_babsang.presentation.profile.screen + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement.Bottom +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxHeight +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.width +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.hilt.navigation.compose.hiltViewModel +import coil.compose.AsyncImage +import com.hackathon.alddeul_babsang.R +import com.hackathon.alddeul_babsang.core_ui.theme.AlddeulBabsangTheme +import com.hackathon.alddeul_babsang.core_ui.theme.Font_B04 +import com.hackathon.alddeul_babsang.core_ui.theme.Gray200 +import com.hackathon.alddeul_babsang.core_ui.theme.Gray300 +import com.hackathon.alddeul_babsang.core_ui.theme.Gray600 +import com.hackathon.alddeul_babsang.core_ui.theme.Orange700 +import com.hackathon.alddeul_babsang.core_ui.theme.Orange800 +import com.hackathon.alddeul_babsang.core_ui.theme.Orange900 +import com.hackathon.alddeul_babsang.core_ui.theme.body2Regular +import com.hackathon.alddeul_babsang.core_ui.theme.body3Semi +import com.hackathon.alddeul_babsang.core_ui.theme.body4Regular +import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold +import com.hackathon.alddeul_babsang.domain.entity.BabsangDetailEntity +import com.hackathon.alddeul_babsang.domain.entity.ReviewEntity +import com.hackathon.alddeul_babsang.presentation.detail.screen.DetailViewModel +import kotlin.math.round + +@Composable +fun LikeItem( + data: BabsangDetailEntity +) { + Column( + modifier = Modifier + .width(350.dp) + .border( + width = 1.dp, + color = Orange700, + shape = RoundedCornerShape(14.dp) + ) + .height(240.dp) + ) { + Box( + modifier = Modifier + .fillMaxWidth() + .height(140.dp) + .clip(RoundedCornerShape(topStart = 14.dp, topEnd = 14.dp)) + ) { + // AsyncImage 로드를 위한 함수 호출 + LoadImageWithPlaceholder(data.codeName, data.avatar) + + // 아이콘을 이미지 위에 오버레이 + Image( + painter = painterResource(id = R.drawable.ic_heart_white), + contentDescription = null, + modifier = Modifier + .padding(end = 10.dp, top = 10.dp) + .align(Alignment.TopEnd) // Box 내에서 오른쪽 끝으로 배치 + ) + } + + Spacer(modifier = Modifier.height(15.dp)) + + Row { + Text( + text = data.name, + style = head4Bold, + color = Orange900, + modifier = Modifier.padding(start = 20.dp) + ) + + Spacer(modifier = Modifier.width(15.dp)) + + Text( + text = data.codeName, + style = body2Regular, + color = Orange800, + modifier = Modifier + .align(Alignment.Bottom) + .padding(bottom = 3.dp) + ) + } + + Spacer(modifier = Modifier.height(12.dp)) + + Text( + text = data.address, + style = body4Regular, + color = Gray300, + modifier = Modifier.padding(start = 20.dp) + ) + + Spacer(modifier = Modifier.height(7.dp)) + + Text( + text = data.phone, + style = body4Regular, + color = Gray300, + modifier = Modifier.padding(start = 20.dp) + ) + } +} + +@Composable +fun LoadImageWithPlaceholder(codeName: String, imageUrl: String?) { + var imageId =R.drawable.ic_korean_food + if (codeName =="경양식/일식"){ + imageId=R.drawable.ic_japanese_food + } + else if (codeName =="한식"){ + imageId=R.drawable.ic_korean_food + } + else if (codeName =="중식"){ + imageId=R.drawable.ic_chinese_food + } + else { + imageId=R.drawable.ic_etc_food + } + + + Box( + modifier = Modifier + .fillMaxWidth() + .fillMaxHeight() + .background(color= Orange700) // 배경색 설정 + ) { + AsyncImage( + model = imageUrl, + contentDescription = null, + placeholder = painterResource(id = imageId), // codeName에 따라 다른 placeholder 제공 + modifier = Modifier + .fillMaxWidth() + .fillMaxHeight() + .padding(vertical = 15.dp) + ) + } +} + +@Preview(showBackground = true) +@Composable +fun ReviewItemPreview() { + val LikeListViewModel: LikeListViewModel = hiltViewModel() + AlddeulBabsangTheme { + LikeItem( + data = BabsangDetailEntity( + id = 1, + avatar = "", + name = "송이네 밥상", + codeName = "경양식/일식", + address = "서울특별시 용산구 청파동 11", + phone = "02-210-0220", + rating = 4.3, + menu = "김치찌개: 8000, 된장찌개 9000", + review = LikeListViewModel.mockReviews + ) + ) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt new file mode 100644 index 0000000..ea0d590 --- /dev/null +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt @@ -0,0 +1,88 @@ +package com.hackathon.alddeul_babsang.presentation.profile.screen + + +import androidx.lifecycle.ViewModel +import com.hackathon.alddeul_babsang.domain.entity.BabsangDetailEntity +import com.hackathon.alddeul_babsang.domain.entity.MenuEntity +import com.hackathon.alddeul_babsang.domain.entity.ReviewEntity +import dagger.hilt.android.lifecycle.HiltViewModel +import javax.inject.Inject + +@HiltViewModel +class LikeListViewModel @Inject constructor() : ViewModel() { + val mockMenuList = listOf( + MenuEntity("김치찌개", 8000), + MenuEntity("된장찌개", 9000), + ) + + val mockReviews = listOf( + ReviewEntity( + id = 1, + avatar = "https://avatars.githubusercontent.com/u/12345678?v=4", + nickname = "김개발", + createdAt = "24.03.12", + star = 4.56, + content = "맛있어요!" + ), + ReviewEntity( + id = 2, + avatar = "https://avatars.githubusercontent.com/u/12345678?v=4", + nickname = "김디자인", + createdAt = "24.03.12", + star = 3.28, + content = "그저 그랬어요 블라블라블라!" + ), + ReviewEntity( + id = 3, + avatar = "https://avatars.githubusercontent.com/u/12345678?v=4", + nickname = "김마케팅", + createdAt = "24.03.12", + star = 2.49, + content = "위생이 별로에요!" + ), + + ) + + val mockLikeList = listOf( + BabsangDetailEntity( + id = 1, + name = "송이네 밥상", + codeName = "경양식/일식", + address = "서울특별시 용산구 청파동 1211", + phone = "02-295-0220", + rating = 4.3, + menu = "김치찌개: 8000, 된장찌개 9000", + review = mockReviews + ), + BabsangDetailEntity( + id = 2, + name = "송이네 밥상2", + codeName = "한식", + address = "서울특별시 용산구 청파동 911", + phone = "02-230-0220", + rating = 4.3, + menu = "김치찌개: 8000, 된장찌개 9000", + review = mockReviews + ), + BabsangDetailEntity( + id = 3, + name = "송이네 밥상3", + codeName = "중식", + address = "서울특별시 용산구 청파동 321", + phone = "02-210-2097", + rating = 4.3, + menu = "김치찌개: 8000, 된장찌개 9000", + review = mockReviews + ), + BabsangDetailEntity( + id = 4, + name = "송이네 밥상4", + codeName = "기타외식업", + address = "서울특별시 용산구 청파동 14", + phone = "02-210-0270", + rating = 4.3, + menu = "김치찌개: 8000, 된장찌개 9000", + review = mockReviews + ) + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt new file mode 100644 index 0000000..d6cf882 --- /dev/null +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt @@ -0,0 +1,163 @@ +package com.hackathon.alddeul_babsang.presentation.profile.screen + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.CenterAlignedTopAppBar +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.buildAnnotatedString +import androidx.compose.ui.text.withStyle +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.hilt.navigation.compose.hiltViewModel +import com.hackathon.alddeul_babsang.R +import com.hackathon.alddeul_babsang.core_ui.theme.AlddeulBabsangTheme +import com.hackathon.alddeul_babsang.core_ui.theme.Gray900 +import com.hackathon.alddeul_babsang.core_ui.theme.Orange800 +import com.hackathon.alddeul_babsang.core_ui.theme.White +import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold +import com.hackathon.alddeul_babsang.core_ui.theme.head6Semi +import com.hackathon.alddeul_babsang.domain.entity.BabsangDetailEntity +import com.hackathon.alddeul_babsang.presentation.profile.navigation.ProfileNavigator + +@Composable +fun ProfileLikeListRoute( + navigator: ProfileNavigator +) { + val LikeListViewModel: LikeListViewModel = hiltViewModel() + ProfileLikeListScreen( + data = BabsangDetailEntity( + id = 1, + name = "송이네 밥상", + codeName = "경양식/일식", + address = "서울특별시 용산구 청파동 11", + phone = "02-210-0220", + rating = 4.3, + menu = "김치찌개: 8000, 된장찌개 9000", + review = LikeListViewModel.mockReviews + ), + onBackClick = { navigator.navigateBack() }, + LikeListViewModel = LikeListViewModel + ) +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun ProfileLikeListScreen( + data: BabsangDetailEntity, + onBackClick: () -> Unit = {}, + LikeListViewModel: LikeListViewModel +) { + + val scrollState = rememberScrollState() + + Scaffold( + topBar = { + CenterAlignedTopAppBar( + modifier = Modifier.background(White), + title = { + Text( + text = stringResource(R.string.tv_profilelikelist_title), + style = head4Bold, + color = Gray900 + ) + }, + navigationIcon = { + IconButton(onClick = { onBackClick() }) { + Icon( + imageVector = ImageVector.vectorResource(id = R.drawable.ic_back), + contentDescription = null + ) + } + }, + colors = TopAppBarDefaults.centerAlignedTopAppBarColors( + containerColor = White + ) + ) + } + ) { innerPadding -> + Column( + modifier = Modifier + .padding(innerPadding) + .fillMaxSize() + .padding(horizontal = 20.dp, vertical = 16.dp) + .verticalScroll(scrollState), + ) { + + Spacer(modifier = Modifier.height(8.dp)) + + Text( + text = buildAnnotatedString { + withStyle(style = SpanStyle(color = Orange800)) { + append("좋아요 히스토리") + } + append("를 바탕으로\n") + withStyle(style = SpanStyle(color = Orange800)) { + append("밥상을 추천") + } + append("해드려요") + }, + style = head6Semi + + ) + + Spacer(modifier = Modifier.height(12.dp)) + + Column( + verticalArrangement = Arrangement.spacedBy(16.dp), + horizontalAlignment = Alignment.CenterHorizontally + ) { + for (item in LikeListViewModel.mockLikeList) { + LikeItem( + data = item + ) + } + } + + } + } + + +} + +@Preview +@Composable +fun ProfileLikeListScreenPreview() { + val LikeListViewModel: LikeListViewModel = hiltViewModel() + AlddeulBabsangTheme { + ProfileLikeListScreen( + data = BabsangDetailEntity( + id = 1, + avatar = "", + name = "송이네 밥상", + codeName = "경양식/일식", + address = "서울특별시 용산구 청파동 11", + phone = "02-210-0220", + rating = 4.3, + menu = "김치찌개: 8000, 된장찌개 9000", + review = LikeListViewModel.mockReviews + ), + onBackClick = { }, + LikeListViewModel = LikeListViewModel + + ) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt index ed74c51..c183bb6 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt @@ -3,13 +3,13 @@ package com.hackathon.alddeul_babsang.presentation.profile.screen import android.content.Context import android.content.Intent import android.net.Uri -import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.clickable 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.fillMaxSize @@ -18,31 +18,30 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.automirrored.filled.ArrowForward -import androidx.compose.material.icons.filled.ArrowBack -import androidx.compose.material.icons.filled.ArrowForward -import androidx.compose.material3.Divider +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults +import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.HorizontalDivider -import androidx.compose.material3.Icon +import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.Text +import androidx.compose.material3.rememberModalBottomSheetState 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.graphics.Color import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.graphicsLayer -import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource -import androidx.compose.ui.res.vectorResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.navigation.NavController @@ -50,18 +49,10 @@ import androidx.navigation.compose.rememberNavController import coil.compose.AsyncImage import com.hackathon.alddeul_babsang.R import com.hackathon.alddeul_babsang.core_ui.theme.AlddeulBabsangTheme -import com.hackathon.alddeul_babsang.core_ui.theme.Gray200 -import com.hackathon.alddeul_babsang.core_ui.theme.Gray300 -import com.hackathon.alddeul_babsang.core_ui.theme.Gray400 -import com.hackathon.alddeul_babsang.core_ui.theme.Gray500 -import com.hackathon.alddeul_babsang.core_ui.theme.Orange700 -import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold -import com.hackathon.alddeul_babsang.core_ui.theme.head6Semi -import com.hackathon.alddeul_babsang.core_ui.theme.head7Semi +import com.hackathon.alddeul_babsang.core_ui.theme.* import com.hackathon.alddeul_babsang.presentation.profile.navigation.ProfileNavigator - @Composable fun ProfileRoute( navigator: ProfileNavigator @@ -73,18 +64,24 @@ fun ProfileRoute( @Composable fun ProfileScreen( - navController: NavController, + navController: NavController ) { val context = LocalContext.current + var showBottomSheet by remember { mutableStateOf(false) } + var bottomSheetKeyword by remember { mutableStateOf("") } + var bottomSheetQuery by remember { mutableStateOf("") } Column( modifier = Modifier .fillMaxSize() .background(Color.White), - ) { - Row(modifier = Modifier.padding(top=60.dp) - .fillMaxWidth()){ + ) { + Row( + modifier = Modifier + .padding(top = 60.dp) + .fillMaxWidth() + ) { Spacer(modifier = Modifier.width(30.dp)) AsyncImage( modifier = Modifier @@ -102,8 +99,12 @@ fun ProfileScreen( Spacer(modifier = Modifier.height(25.dp)) Text("닉네임", style = head4Bold) Spacer(modifier = Modifier.height(10.dp)) - Row(){ - Text(stringResource(R.string.tv_profile_likelist), style = head7Semi, color=Gray300) + Row { + Text( + stringResource(R.string.tv_profile_likelist), + style = head7Semi, + color = Gray300 + ) Spacer(modifier = Modifier.width(10.dp)) Image( @@ -112,9 +113,9 @@ fun ProfileScreen( colorFilter = ColorFilter.tint(Gray300), modifier = Modifier .graphicsLayer(scaleX = -1f) // 좌우 반전 - //.clickable(onClick={ - //navController.navigate("signUp2") - //}) + .clickable(onClick={ + navController.navigate("profileLikeList") + }) ) } } @@ -125,11 +126,13 @@ fun ProfileScreen( Column( modifier = Modifier .height(200.dp) - ){ - Text("이용안내",style= head6Semi, modifier = Modifier - .padding(start=30.dp) - .fillMaxWidth() - .height(30.dp)) + ) { + Text( + "이용안내", style = head6Semi, modifier = Modifier + .padding(start = 30.dp) + .fillMaxWidth() + .height(30.dp) + ) Spacer(modifier = Modifier.height(20.dp)) ProfileScreenItem( @@ -174,11 +177,13 @@ fun ProfileScreen( Column( modifier = Modifier .height(200.dp) - ){ - Text("기타",style= head6Semi, modifier = Modifier - .padding(start=30.dp) - .fillMaxWidth() - .height(30.dp)) + ) { + Text( + "기타", style = head6Semi, modifier = Modifier + .padding(start = 30.dp) + .fillMaxWidth() + .height(30.dp) + ) Spacer(modifier = Modifier.height(20.dp)) ProfileScreenItem( @@ -189,23 +194,43 @@ fun ProfileScreen( Spacer(modifier = Modifier.height(20.dp)) ProfileScreenItem( text = "로그아웃", - onClick = {} + onClick = { + bottomSheetKeyword = "로그아웃" + bottomSheetQuery = "logout_query" // 여기에 실제 쿼리문을 넣을 수 있음 + showBottomSheet = true + } ) Spacer(modifier = Modifier.height(20.dp)) ProfileScreenItem( text = "회원 탈퇴", - onClick = {} + onClick = { + bottomSheetKeyword = "회원 탈퇴" + bottomSheetQuery = "logout_query" // 여기에 실제 쿼리문을 넣을 수 있음 + showBottomSheet = true + } ) Spacer(modifier = Modifier.height(20.dp)) } - - - - - + if (showBottomSheet) { + BottomSheetContent( + keyword = bottomSheetKeyword, + onDismiss = { + showBottomSheet = false + }, + onConfirm = { + //백엔드로 쿼리 전달 + navController.navigate("login"){ + popUpTo("profile") { inclusive = true } + launchSingleTop = true + } + + showBottomSheet = false + } + ) + } } } @@ -215,6 +240,96 @@ fun navigateToWebsite(context: Context, url: String) { context.startActivity(intent) } +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun BottomSheetContent( + keyword: String, + onDismiss: () -> Unit, + onConfirm: () -> Unit +) { + val sheetState = rememberModalBottomSheetState() + var tv1 = "" + var tv2 = "" + if (keyword == "로그아웃"){ + tv1= stringResource(R.string.tv_profile_asklogout) + tv2= stringResource(R.string.tv_profile_asklogout2) + } + + if (keyword == "회원 탈퇴"){ + tv1= stringResource(R.string.tv_profile_askdelete) + tv2= stringResource(R.string.tv_profile_askdelete2) + } + + ModalBottomSheet( + sheetState = sheetState, + onDismissRequest = { onDismiss() }, + containerColor = White, + ) { + Column( + modifier = Modifier + .padding(16.dp) + .fillMaxWidth(), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Text( + text = tv1, + color = Gray500, + style = head5Semi, + modifier = Modifier.padding(bottom = 2.dp) + ) + Spacer(modifier = Modifier.height(20.dp)) + + Text( + text = tv2, + color = Gray500, + style = body2Semi, + modifier = Modifier.padding(bottom = 2.dp) + ) + Spacer(modifier = Modifier.height(41.dp)) + + Row( + modifier = Modifier + .fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween + ) { + Button( + modifier = Modifier.weight(1f), + colors = ButtonDefaults.buttonColors( + containerColor = Gray500, + ), + shape = RoundedCornerShape(40.dp), + contentPadding = PaddingValues(vertical = 19.dp), + onClick = { onDismiss() + } + ) { + Text( + text = stringResource(R.string.btn_profile_cancel), + color = White, + style = head7Bold + ) + } + + Spacer(modifier = Modifier.width(8.dp)) + + Button( + modifier = Modifier.weight(1f), + colors = ButtonDefaults.buttonColors( + containerColor = Orange900, + ), + shape = RoundedCornerShape(40.dp), + contentPadding = PaddingValues(vertical = 19.dp), + onClick = { onConfirm() } + ) { + Text( + text = keyword, + color = White, + style = head7Bold + ) + } + } + } + } +} @Preview diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a4ae979..fd2180a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -69,5 +69,12 @@ %1$s/10자 닉네임은 10자 이하로 입력해주세요. 좋아요 목록 + 회원 탈퇴 하시겠습니까? + 회원 탈퇴 시 회원 정보가 초기화 됩니다 + 취소 + 회원 탈퇴 + 로그아웃 시 로그인 화면으로 이동합니다 + 로그아웃 하시겠습니까? + 좋아요 목록 \ No newline at end of file From c0f7b4e427778d2569807b3ffba1ed8d367cd769 Mon Sep 17 00:00:00 2001 From: seoyeonsw Date: Wed, 6 Nov 2024 15:25:35 +0900 Subject: [PATCH 3/8] =?UTF-8?q?#11=20=ED=94=84=EB=A1=9C=ED=95=84=20&=20?= =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/entity/ProfileLikeListEntity.kt | 11 ++ .../profile/navigation/ProfileNavGraph.kt | 10 +- .../profile/navigation/ProfileNavigator.kt | 4 - .../presentation/profile/screen/LikeItem.kt | 109 ++++++++++-------- .../profile/screen/LikeListViewModel.kt | 105 +++++++---------- .../profile/screen/ProfileLikeListScreen.kt | 21 ++-- .../profile/screen/ProfileScreen.kt | 6 +- 7 files changed, 122 insertions(+), 144 deletions(-) create mode 100644 app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/ProfileLikeListEntity.kt diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/ProfileLikeListEntity.kt b/app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/ProfileLikeListEntity.kt new file mode 100644 index 0000000..56ad75e --- /dev/null +++ b/app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/ProfileLikeListEntity.kt @@ -0,0 +1,11 @@ +package com.hackathon.alddeul_babsang.domain.entity + +data class ProfileLikeListEntity( + val id: Long, + val avatar: String? = null, + val name: String, + val codeName: String, + val address: String, + val phone: String, + val favorite: Boolean=false, +) \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt index 92ee9c7..ea99be0 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt @@ -4,8 +4,7 @@ import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import com.hackathon.alddeul_babsang.presentation.profile.screen.ProfileLikeListRoute import com.hackathon.alddeul_babsang.presentation.profile.screen.ProfileRoute -import com.hackathon.alddeul_babsang.presentation.report.navigation.ReportNavigator -import com.hackathon.alddeul_babsang.presentation.report.screen.ReportWriteRoute + fun NavGraphBuilder.profileNavGraph( navigator: ProfileNavigator @@ -13,12 +12,7 @@ fun NavGraphBuilder.profileNavGraph( composable(route = "profile") { ProfileRoute(navigator = navigator) } -} - -fun NavGraphBuilder.profileLikeListNavGraph( - navigator: ProfileNavigator -) { composable(route = "profileLikeList") { ProfileLikeListRoute(navigator = navigator) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt index b5e2bb2..8953845 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt @@ -6,10 +6,6 @@ class ProfileNavigator( val navController: NavController ) { - fun profileLikeList() { - navController.navigate("profileLikeList") - } - fun navigateBack() { navController.popBackStack() } diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt index 1f11653..dcde40d 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt @@ -3,7 +3,7 @@ package com.hackathon.alddeul_babsang.presentation.profile.screen import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.border -import androidx.compose.foundation.layout.Arrangement.Bottom +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -12,49 +12,47 @@ import androidx.compose.foundation.layout.fillMaxHeight 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.width -import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape 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.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.ColorFilter -import androidx.compose.ui.graphics.graphicsLayer -import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.vectorResource -import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import androidx.hilt.navigation.compose.hiltViewModel import coil.compose.AsyncImage import com.hackathon.alddeul_babsang.R import com.hackathon.alddeul_babsang.core_ui.theme.AlddeulBabsangTheme -import com.hackathon.alddeul_babsang.core_ui.theme.Font_B04 -import com.hackathon.alddeul_babsang.core_ui.theme.Gray200 import com.hackathon.alddeul_babsang.core_ui.theme.Gray300 -import com.hackathon.alddeul_babsang.core_ui.theme.Gray600 import com.hackathon.alddeul_babsang.core_ui.theme.Orange700 import com.hackathon.alddeul_babsang.core_ui.theme.Orange800 import com.hackathon.alddeul_babsang.core_ui.theme.Orange900 import com.hackathon.alddeul_babsang.core_ui.theme.body2Regular -import com.hackathon.alddeul_babsang.core_ui.theme.body3Semi import com.hackathon.alddeul_babsang.core_ui.theme.body4Regular import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold -import com.hackathon.alddeul_babsang.domain.entity.BabsangDetailEntity -import com.hackathon.alddeul_babsang.domain.entity.ReviewEntity -import com.hackathon.alddeul_babsang.presentation.detail.screen.DetailViewModel -import kotlin.math.round +import com.hackathon.alddeul_babsang.domain.entity.ProfileLikeListEntity @Composable fun LikeItem( - data: BabsangDetailEntity + data: ProfileLikeListEntity ) { + var isFavorite by remember { mutableStateOf(data.favorite ?: false) } + + // 클릭할 때마다 favorite 값 토글 + val heartIconId = if (isFavorite) { + R.drawable.ic_heart_red + } else { + R.drawable.ic_heart_white + } + + Column( modifier = Modifier .width(350.dp) @@ -71,16 +69,19 @@ fun LikeItem( .height(140.dp) .clip(RoundedCornerShape(topStart = 14.dp, topEnd = 14.dp)) ) { - // AsyncImage 로드를 위한 함수 호출 + // AsyncImage 로드 LoadImageWithPlaceholder(data.codeName, data.avatar) - // 아이콘을 이미지 위에 오버레이 Image( - painter = painterResource(id = R.drawable.ic_heart_white), + painter = painterResource(heartIconId), contentDescription = null, modifier = Modifier .padding(end = 10.dp, top = 10.dp) .align(Alignment.TopEnd) // Box 내에서 오른쪽 끝으로 배치 + .clickable { + // 클릭 시 좋아요 상태를 토글 + isFavorite = !isFavorite + } ) } @@ -128,18 +129,15 @@ fun LikeItem( @Composable fun LoadImageWithPlaceholder(codeName: String, imageUrl: String?) { - var imageId =R.drawable.ic_korean_food - if (codeName =="경양식/일식"){ - imageId=R.drawable.ic_japanese_food - } - else if (codeName =="한식"){ - imageId=R.drawable.ic_korean_food - } - else if (codeName =="중식"){ - imageId=R.drawable.ic_chinese_food - } - else { - imageId=R.drawable.ic_etc_food + var imageId = R.drawable.ic_korean_food + if (codeName == "경양식/일식") { + imageId = R.drawable.ic_japanese_food + } else if (codeName == "한식") { + imageId = R.drawable.ic_korean_food + } else if (codeName == "중식") { + imageId = R.drawable.ic_chinese_food + } else { + imageId = R.drawable.ic_etc_food } @@ -147,36 +145,47 @@ fun LoadImageWithPlaceholder(codeName: String, imageUrl: String?) { modifier = Modifier .fillMaxWidth() .fillMaxHeight() - .background(color= Orange700) // 배경색 설정 + .background(color = Orange700) // 배경색 설정 ) { - AsyncImage( - model = imageUrl, - contentDescription = null, - placeholder = painterResource(id = imageId), // codeName에 따라 다른 placeholder 제공 - modifier = Modifier - .fillMaxWidth() - .fillMaxHeight() - .padding(vertical = 15.dp) - ) + if (imageUrl.isNullOrEmpty()) { + // imageUrl이 null이나 empty일 경우 대체 이미지 표시 + Image( + painter = painterResource(id = imageId), // 대체 이미지 + contentDescription = null, + modifier = Modifier + .fillMaxWidth() + .fillMaxHeight() + .padding(vertical = 15.dp) + ) + } else { + // imageUrl이 null이 아니면 AsyncImage로 비동기 이미지 로드 + AsyncImage( + model = imageUrl, + contentDescription = null, + placeholder = painterResource(id = imageId), // codeName에 따라 다른 placeholder 제공 + contentScale = ContentScale.Crop, + modifier = Modifier + .fillMaxWidth() + .fillMaxHeight() + .padding(vertical = 15.dp) + ) + } } } @Preview(showBackground = true) @Composable fun ReviewItemPreview() { - val LikeListViewModel: LikeListViewModel = hiltViewModel() AlddeulBabsangTheme { LikeItem( - data = BabsangDetailEntity( + data = ProfileLikeListEntity( id = 1, - avatar = "", + avatar = null, name = "송이네 밥상", codeName = "경양식/일식", address = "서울특별시 용산구 청파동 11", phone = "02-210-0220", - rating = 4.3, - menu = "김치찌개: 8000, 된장찌개 9000", - review = LikeListViewModel.mockReviews + favorite = true ) ) } diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt index ea0d590..5ad549e 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt @@ -2,87 +2,60 @@ package com.hackathon.alddeul_babsang.presentation.profile.screen import androidx.lifecycle.ViewModel -import com.hackathon.alddeul_babsang.domain.entity.BabsangDetailEntity -import com.hackathon.alddeul_babsang.domain.entity.MenuEntity -import com.hackathon.alddeul_babsang.domain.entity.ReviewEntity +import com.hackathon.alddeul_babsang.domain.entity.ProfileLikeListEntity import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject @HiltViewModel class LikeListViewModel @Inject constructor() : ViewModel() { - val mockMenuList = listOf( - MenuEntity("김치찌개", 8000), - MenuEntity("된장찌개", 9000), - ) - - val mockReviews = listOf( - ReviewEntity( - id = 1, - avatar = "https://avatars.githubusercontent.com/u/12345678?v=4", - nickname = "김개발", - createdAt = "24.03.12", - star = 4.56, - content = "맛있어요!" - ), - ReviewEntity( - id = 2, - avatar = "https://avatars.githubusercontent.com/u/12345678?v=4", - nickname = "김디자인", - createdAt = "24.03.12", - star = 3.28, - content = "그저 그랬어요 블라블라블라!" - ), - ReviewEntity( - id = 3, - avatar = "https://avatars.githubusercontent.com/u/12345678?v=4", - nickname = "김마케팅", - createdAt = "24.03.12", - star = 2.49, - content = "위생이 별로에요!" - ), - ) val mockLikeList = listOf( - BabsangDetailEntity( - id = 1, + ProfileLikeListEntity( + id=1, + avatar = null, name = "송이네 밥상", + codeName = "기타외식업", + address = "서울특별시 용산구 청파동 81", + phone = "02-210-0120", + favorite = true + ), + ProfileLikeListEntity( + id=2, + avatar = null, + name = "송이네 일식", codeName = "경양식/일식", - address = "서울특별시 용산구 청파동 1211", - phone = "02-295-0220", - rating = 4.3, - menu = "김치찌개: 8000, 된장찌개 9000", - review = mockReviews + address = "서울특별시 용산구 청파동 11", + phone = "02-210-0220", + favorite = true ), - BabsangDetailEntity( - id = 2, - name = "송이네 밥상2", + ProfileLikeListEntity( + id=3, + avatar = null, + name = "송이네 한식", codeName = "한식", - address = "서울특별시 용산구 청파동 911", - phone = "02-230-0220", - rating = 4.3, - menu = "김치찌개: 8000, 된장찌개 9000", - review = mockReviews + address = "서울특별시 용산구 청파동 31", + phone = "02-223-0220", + favorite = true ), - BabsangDetailEntity( - id = 3, - name = "송이네 밥상3", + ProfileLikeListEntity( + id=4, + avatar = null, + name = "송이네 중식", codeName = "중식", - address = "서울특별시 용산구 청파동 321", - phone = "02-210-2097", - rating = 4.3, - menu = "김치찌개: 8000, 된장찌개 9000", - review = mockReviews + address = "서울특별시 용산구 청파동 31", + phone = "02-223-0220", + favorite = true ), - BabsangDetailEntity( - id = 4, - name = "송이네 밥상4", - codeName = "기타외식업", - address = "서울특별시 용산구 청파동 14", - phone = "02-210-0270", - rating = 4.3, - menu = "김치찌개: 8000, 된장찌개 9000", - review = mockReviews + ProfileLikeListEntity( + id=4, + avatar = "https://avatars.githubusercontent.com/u/166610834?s=400&u=568eacc2e4696d563a4fd732c148edba2196e4f6&v=4", + name = "송이네 밥상", + codeName = "중식", + address = "서울특별시 용산구 청파동 31", + phone = "02-223-0220", + favorite = true ) + ) } \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt index d6cf882..9c517b2 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt @@ -35,7 +35,7 @@ import com.hackathon.alddeul_babsang.core_ui.theme.Orange800 import com.hackathon.alddeul_babsang.core_ui.theme.White import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold import com.hackathon.alddeul_babsang.core_ui.theme.head6Semi -import com.hackathon.alddeul_babsang.domain.entity.BabsangDetailEntity +import com.hackathon.alddeul_babsang.domain.entity.ProfileLikeListEntity import com.hackathon.alddeul_babsang.presentation.profile.navigation.ProfileNavigator @Composable @@ -44,15 +44,14 @@ fun ProfileLikeListRoute( ) { val LikeListViewModel: LikeListViewModel = hiltViewModel() ProfileLikeListScreen( - data = BabsangDetailEntity( - id = 1, + data = ProfileLikeListEntity( + id=1, + avatar = "", name = "송이네 밥상", codeName = "경양식/일식", address = "서울특별시 용산구 청파동 11", phone = "02-210-0220", - rating = 4.3, - menu = "김치찌개: 8000, 된장찌개 9000", - review = LikeListViewModel.mockReviews + favorite = true ), onBackClick = { navigator.navigateBack() }, LikeListViewModel = LikeListViewModel @@ -62,7 +61,7 @@ fun ProfileLikeListRoute( @OptIn(ExperimentalMaterial3Api::class) @Composable fun ProfileLikeListScreen( - data: BabsangDetailEntity, + data: ProfileLikeListEntity, onBackClick: () -> Unit = {}, LikeListViewModel: LikeListViewModel ) { @@ -144,16 +143,14 @@ fun ProfileLikeListScreenPreview() { val LikeListViewModel: LikeListViewModel = hiltViewModel() AlddeulBabsangTheme { ProfileLikeListScreen( - data = BabsangDetailEntity( - id = 1, + data = ProfileLikeListEntity( + id=1, avatar = "", name = "송이네 밥상", codeName = "경양식/일식", address = "서울특별시 용산구 청파동 11", phone = "02-210-0220", - rating = 4.3, - menu = "김치찌개: 8000, 된장찌개 9000", - review = LikeListViewModel.mockReviews + favorite = true ), onBackClick = { }, LikeListViewModel = LikeListViewModel diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt index c183bb6..40665df 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt @@ -140,7 +140,7 @@ fun ProfileScreen( onClick = { navigateToWebsite( context = context, - "https://massive-maple-b53.notion.site/426578b24235447abccaae359549cdb7?pvs=4" + "https://flowery-alloy-47e.notion.site/1336b8d0ab7b8019a7a9da0d80ff285b" ) } ) @@ -151,7 +151,7 @@ fun ProfileScreen( onClick = { navigateToWebsite( context = context, - "https://massive-maple-b53.notion.site/430e2c92b8694ad6a8b4497f3a3b4452" + "https://flowery-alloy-47e.notion.site/1336b8d0ab7b80949a59fe847a7e94d8" ) } ) @@ -273,7 +273,6 @@ fun BottomSheetContent( ) { Text( text = tv1, - color = Gray500, style = head5Semi, modifier = Modifier.padding(bottom = 2.dp) ) @@ -281,7 +280,6 @@ fun BottomSheetContent( Text( text = tv2, - color = Gray500, style = body2Semi, modifier = Modifier.padding(bottom = 2.dp) ) From e3a6ae8486b95b740ef11759a95eb31af8075d74 Mon Sep 17 00:00:00 2001 From: seoyeonsw Date: Thu, 7 Nov 2024 00:27:22 +0900 Subject: [PATCH 4/8] =?UTF-8?q?#11=20=ED=94=84=EB=A1=9C=ED=95=84=20&=20?= =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20UI=20=EC=88=98=EC=A0=95=20&=20?= =?UTF-8?q?=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...LikeListEntity.kt => BabsangListEntity.kt} | 4 +- .../profile/navigation/ProfileNavGraph.kt | 2 +- .../profile/navigation/ProfileNavigator.kt | 13 +++++ .../{LikeItem.kt => BabsangListItem.kt} | 47 ++++++++++------- ...stViewModel.kt => BabsangListViewModel.kt} | 24 ++++----- .../profile/screen/ProfileLikeListScreen.kt | 46 ++++++++++++----- .../profile/screen/ProfileScreen.kt | 51 +++++++++++++------ .../profile/screen/ProfileScreenItem.kt | 3 +- app/src/main/res/values/strings.xml | 2 + 9 files changed, 128 insertions(+), 64 deletions(-) rename app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/{ProfileLikeListEntity.kt => BabsangListEntity.kt} (74%) rename app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/{LikeItem.kt => BabsangListItem.kt} (82%) rename app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/{LikeListViewModel.kt => BabsangListViewModel.kt} (80%) diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/ProfileLikeListEntity.kt b/app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/BabsangListEntity.kt similarity index 74% rename from app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/ProfileLikeListEntity.kt rename to app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/BabsangListEntity.kt index 56ad75e..8a09967 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/ProfileLikeListEntity.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/domain/entity/BabsangListEntity.kt @@ -1,11 +1,11 @@ package com.hackathon.alddeul_babsang.domain.entity -data class ProfileLikeListEntity( +data class BabsangListEntity( val id: Long, val avatar: String? = null, val name: String, val codeName: String, val address: String, val phone: String, - val favorite: Boolean=false, + val favorite: Boolean = false, ) \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt index ea99be0..f6b6ee9 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavGraph.kt @@ -15,4 +15,4 @@ fun NavGraphBuilder.profileNavGraph( composable(route = "profileLikeList") { ProfileLikeListRoute(navigator = navigator) } -} +} \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt index 8953845..04ea985 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/navigation/ProfileNavigator.kt @@ -6,7 +6,20 @@ class ProfileNavigator( val navController: NavController ) { + fun navigateDetail(id: Long) { + navController.navigate("detail?id=$id") + } + fun navigateBack() { navController.popBackStack() } + + fun navigateLogin() { + navController.navigate("login") { + popUpTo("profile") { inclusive = true } + launchSingleTop = true + } + + } + } \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/BabsangListItem.kt similarity index 82% rename from app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt rename to app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/BabsangListItem.kt index dcde40d..b63e9f2 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeItem.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/BabsangListItem.kt @@ -27,6 +27,7 @@ import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import androidx.navigation.compose.rememberNavController import coil.compose.AsyncImage import com.hackathon.alddeul_babsang.R import com.hackathon.alddeul_babsang.core_ui.theme.AlddeulBabsangTheme @@ -37,12 +38,15 @@ import com.hackathon.alddeul_babsang.core_ui.theme.Orange900 import com.hackathon.alddeul_babsang.core_ui.theme.body2Regular import com.hackathon.alddeul_babsang.core_ui.theme.body4Regular import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold -import com.hackathon.alddeul_babsang.domain.entity.ProfileLikeListEntity +import com.hackathon.alddeul_babsang.domain.entity.BabsangListEntity +import com.hackathon.alddeul_babsang.presentation.profile.navigation.ProfileNavigator @Composable fun LikeItem( - data: ProfileLikeListEntity + navigator: ProfileNavigator, + data: BabsangListEntity ) { + var isFavorite by remember { mutableStateOf(data.favorite ?: false) } // 클릭할 때마다 favorite 값 토글 @@ -55,13 +59,16 @@ fun LikeItem( Column( modifier = Modifier - .width(350.dp) + .fillMaxWidth() .border( width = 1.dp, color = Orange700, shape = RoundedCornerShape(14.dp) ) .height(240.dp) + .clickable(onClick = { + navigator.navigateDetail(data.id) + }) ) { Box( modifier = Modifier @@ -129,15 +136,11 @@ fun LikeItem( @Composable fun LoadImageWithPlaceholder(codeName: String, imageUrl: String?) { - var imageId = R.drawable.ic_korean_food - if (codeName == "경양식/일식") { - imageId = R.drawable.ic_japanese_food - } else if (codeName == "한식") { - imageId = R.drawable.ic_korean_food - } else if (codeName == "중식") { - imageId = R.drawable.ic_chinese_food - } else { - imageId = R.drawable.ic_etc_food + val imageId = when (codeName) { + "경양식/일식" -> R.drawable.ic_japanese_food + "한식" -> R.drawable.ic_korean_food + "중식" -> R.drawable.ic_chinese_food + else -> R.drawable.ic_etc_food } @@ -162,23 +165,29 @@ fun LoadImageWithPlaceholder(codeName: String, imageUrl: String?) { AsyncImage( model = imageUrl, contentDescription = null, - placeholder = painterResource(id = imageId), // codeName에 따라 다른 placeholder 제공 - contentScale = ContentScale.Crop, + placeholder = painterResource(id = imageId), + contentScale = ContentScale.Crop, // 이미지 비율 유지, 크기 확대 또는 자르기 modifier = Modifier - .fillMaxWidth() - .fillMaxHeight() - .padding(vertical = 15.dp) + .fillMaxWidth() // 가로는 꽉 차게 + .fillMaxHeight() // 세로도 꽉 차게 + .clip(RoundedCornerShape(topStart = 14.dp, topEnd = 14.dp)) + ) + } } } @Preview(showBackground = true) @Composable -fun ReviewItemPreview() { +fun LikeItemPreview() { + val navController = rememberNavController() + val navigator = ProfileNavigator(navController) + AlddeulBabsangTheme { LikeItem( - data = ProfileLikeListEntity( + navigator = navigator, + data = BabsangListEntity( id = 1, avatar = null, name = "송이네 밥상", diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/BabsangListViewModel.kt similarity index 80% rename from app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt rename to app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/BabsangListViewModel.kt index 5ad549e..30e668c 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/LikeListViewModel.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/BabsangListViewModel.kt @@ -2,17 +2,17 @@ package com.hackathon.alddeul_babsang.presentation.profile.screen import androidx.lifecycle.ViewModel -import com.hackathon.alddeul_babsang.domain.entity.ProfileLikeListEntity +import com.hackathon.alddeul_babsang.domain.entity.BabsangListEntity import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject @HiltViewModel -class LikeListViewModel @Inject constructor() : ViewModel() { +class BabsangListViewModel @Inject constructor() : ViewModel() { val mockLikeList = listOf( - ProfileLikeListEntity( - id=1, + BabsangListEntity( + id = 1, avatar = null, name = "송이네 밥상", codeName = "기타외식업", @@ -20,8 +20,8 @@ class LikeListViewModel @Inject constructor() : ViewModel() { phone = "02-210-0120", favorite = true ), - ProfileLikeListEntity( - id=2, + BabsangListEntity( + id = 2, avatar = null, name = "송이네 일식", codeName = "경양식/일식", @@ -29,8 +29,8 @@ class LikeListViewModel @Inject constructor() : ViewModel() { phone = "02-210-0220", favorite = true ), - ProfileLikeListEntity( - id=3, + BabsangListEntity( + id = 3, avatar = null, name = "송이네 한식", codeName = "한식", @@ -38,8 +38,8 @@ class LikeListViewModel @Inject constructor() : ViewModel() { phone = "02-223-0220", favorite = true ), - ProfileLikeListEntity( - id=4, + BabsangListEntity( + id = 4, avatar = null, name = "송이네 중식", codeName = "중식", @@ -47,8 +47,8 @@ class LikeListViewModel @Inject constructor() : ViewModel() { phone = "02-223-0220", favorite = true ), - ProfileLikeListEntity( - id=4, + BabsangListEntity( + id = 4, avatar = "https://avatars.githubusercontent.com/u/166610834?s=400&u=568eacc2e4696d563a4fd732c148edba2196e4f6&v=4", name = "송이네 밥상", codeName = "중식", diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt index 9c517b2..5f6badb 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt @@ -17,6 +17,7 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable +import androidx.compose.runtime.SideEffect import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector @@ -28,6 +29,8 @@ import androidx.compose.ui.text.withStyle import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import androidx.navigation.compose.rememberNavController +import com.google.accompanist.systemuicontroller.rememberSystemUiController import com.hackathon.alddeul_babsang.R import com.hackathon.alddeul_babsang.core_ui.theme.AlddeulBabsangTheme import com.hackathon.alddeul_babsang.core_ui.theme.Gray900 @@ -35,17 +38,27 @@ import com.hackathon.alddeul_babsang.core_ui.theme.Orange800 import com.hackathon.alddeul_babsang.core_ui.theme.White import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold import com.hackathon.alddeul_babsang.core_ui.theme.head6Semi -import com.hackathon.alddeul_babsang.domain.entity.ProfileLikeListEntity +import com.hackathon.alddeul_babsang.domain.entity.BabsangListEntity import com.hackathon.alddeul_babsang.presentation.profile.navigation.ProfileNavigator @Composable fun ProfileLikeListRoute( navigator: ProfileNavigator ) { - val LikeListViewModel: LikeListViewModel = hiltViewModel() + + val systemUiController = rememberSystemUiController() + + SideEffect { + systemUiController.setStatusBarColor( + color = White + ) + } + + val babsangListViewModel: BabsangListViewModel = hiltViewModel() ProfileLikeListScreen( - data = ProfileLikeListEntity( - id=1, + navigator = navigator, // navController 대신 navigator 전달 + data = BabsangListEntity( + id = 1, avatar = "", name = "송이네 밥상", codeName = "경양식/일식", @@ -54,16 +67,17 @@ fun ProfileLikeListRoute( favorite = true ), onBackClick = { navigator.navigateBack() }, - LikeListViewModel = LikeListViewModel + babsangListViewModel = babsangListViewModel ) } @OptIn(ExperimentalMaterial3Api::class) @Composable fun ProfileLikeListScreen( - data: ProfileLikeListEntity, + navigator: ProfileNavigator, + data: BabsangListEntity, onBackClick: () -> Unit = {}, - LikeListViewModel: LikeListViewModel + babsangListViewModel: BabsangListViewModel ) { val scrollState = rememberScrollState() @@ -124,8 +138,9 @@ fun ProfileLikeListScreen( verticalArrangement = Arrangement.spacedBy(16.dp), horizontalAlignment = Alignment.CenterHorizontally ) { - for (item in LikeListViewModel.mockLikeList) { + for (item in babsangListViewModel.mockLikeList) { LikeItem( + navigator = navigator, data = item ) } @@ -140,11 +155,15 @@ fun ProfileLikeListScreen( @Preview @Composable fun ProfileLikeListScreenPreview() { - val LikeListViewModel: LikeListViewModel = hiltViewModel() + val babsangListViewModel: BabsangListViewModel = hiltViewModel() + val navController = rememberNavController() + val navigator = ProfileNavigator(navController) + AlddeulBabsangTheme { ProfileLikeListScreen( - data = ProfileLikeListEntity( - id=1, + navigator = navigator, + data = BabsangListEntity( + id = 1, avatar = "", name = "송이네 밥상", codeName = "경양식/일식", @@ -153,8 +172,9 @@ fun ProfileLikeListScreenPreview() { favorite = true ), onBackClick = { }, - LikeListViewModel = LikeListViewModel - + babsangListViewModel = babsangListViewModel ) + + } } \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt index 40665df..effc4ae 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt @@ -28,6 +28,7 @@ import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.Text import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable +import androidx.compose.runtime.SideEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -47,9 +48,19 @@ import androidx.compose.ui.unit.dp import androidx.navigation.NavController import androidx.navigation.compose.rememberNavController import coil.compose.AsyncImage +import com.google.accompanist.systemuicontroller.rememberSystemUiController import com.hackathon.alddeul_babsang.R import com.hackathon.alddeul_babsang.core_ui.theme.AlddeulBabsangTheme -import com.hackathon.alddeul_babsang.core_ui.theme.* +import com.hackathon.alddeul_babsang.core_ui.theme.Gray300 +import com.hackathon.alddeul_babsang.core_ui.theme.Gray500 +import com.hackathon.alddeul_babsang.core_ui.theme.Orange900 +import com.hackathon.alddeul_babsang.core_ui.theme.White +import com.hackathon.alddeul_babsang.core_ui.theme.body2Semi +import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold +import com.hackathon.alddeul_babsang.core_ui.theme.head5Semi +import com.hackathon.alddeul_babsang.core_ui.theme.head6Semi +import com.hackathon.alddeul_babsang.core_ui.theme.head7Bold +import com.hackathon.alddeul_babsang.core_ui.theme.head7Semi import com.hackathon.alddeul_babsang.presentation.profile.navigation.ProfileNavigator @@ -57,14 +68,24 @@ import com.hackathon.alddeul_babsang.presentation.profile.navigation.ProfileNavi fun ProfileRoute( navigator: ProfileNavigator ) { + val systemUiController = rememberSystemUiController() + + SideEffect { + systemUiController.setStatusBarColor( + color = White + ) + } + ProfileScreen( navController = navigator.navController, + onBackClick = { navigator.navigateLogin() } ) } @Composable fun ProfileScreen( - navController: NavController + navController: NavController, + onBackClick: () -> Unit = {}, ) { val context = LocalContext.current var showBottomSheet by remember { mutableStateOf(false) } @@ -113,9 +134,9 @@ fun ProfileScreen( colorFilter = ColorFilter.tint(Gray300), modifier = Modifier .graphicsLayer(scaleX = -1f) // 좌우 반전 - .clickable(onClick={ - navController.navigate("profileLikeList") - }) + .clickable(onClick = { + navController.navigate("profileLikeList") + }) ) } } @@ -222,10 +243,7 @@ fun ProfileScreen( }, onConfirm = { //백엔드로 쿼리 전달 - navController.navigate("login"){ - popUpTo("profile") { inclusive = true } - launchSingleTop = true - } + onBackClick() showBottomSheet = false } @@ -250,14 +268,14 @@ fun BottomSheetContent( val sheetState = rememberModalBottomSheetState() var tv1 = "" var tv2 = "" - if (keyword == "로그아웃"){ - tv1= stringResource(R.string.tv_profile_asklogout) - tv2= stringResource(R.string.tv_profile_asklogout2) + if (keyword == "로그아웃") { + tv1 = stringResource(R.string.tv_profile_asklogout) + tv2 = stringResource(R.string.tv_profile_asklogout2) } - if (keyword == "회원 탈퇴"){ - tv1= stringResource(R.string.tv_profile_askdelete) - tv2= stringResource(R.string.tv_profile_askdelete2) + if (keyword == "회원 탈퇴") { + tv1 = stringResource(R.string.tv_profile_askdelete) + tv2 = stringResource(R.string.tv_profile_askdelete2) } ModalBottomSheet( @@ -297,7 +315,8 @@ fun BottomSheetContent( ), shape = RoundedCornerShape(40.dp), contentPadding = PaddingValues(vertical = 19.dp), - onClick = { onDismiss() + onClick = { + onDismiss() } ) { Text( diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt index 8c26b0f..fca6619 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt @@ -39,7 +39,8 @@ fun ProfileScreenItem( .clickable { onClick() } ) { Text( - modifier = Modifier.align(Alignment.CenterStart) + modifier = Modifier + .align(Alignment.CenterStart) .padding(start = 30.dp), text = text, color = Gray400, diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fd2180a..677def5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -68,6 +68,8 @@ 닉네임과 프로필 사진을 입력해주세요. %1$s/10자 닉네임은 10자 이하로 입력해주세요. + + 좋아요 목록 회원 탈퇴 하시겠습니까? 회원 탈퇴 시 회원 정보가 초기화 됩니다 From 037429bc2a5396cb403e0e0dbac20167dc95ac91 Mon Sep 17 00:00:00 2001 From: seoyeonsw Date: Thu, 7 Nov 2024 00:28:36 +0900 Subject: [PATCH 5/8] =?UTF-8?q?#11=20=ED=94=84=EB=A1=9C=ED=95=84=20&=20?= =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20UI=20=EC=88=98=EC=A0=95=20&=20?= =?UTF-8?q?=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/profile/screen/ProfileScreen.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt index effc4ae..67673c0 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt @@ -217,7 +217,6 @@ fun ProfileScreen( text = "로그아웃", onClick = { bottomSheetKeyword = "로그아웃" - bottomSheetQuery = "logout_query" // 여기에 실제 쿼리문을 넣을 수 있음 showBottomSheet = true } ) @@ -227,7 +226,6 @@ fun ProfileScreen( text = "회원 탈퇴", onClick = { bottomSheetKeyword = "회원 탈퇴" - bottomSheetQuery = "logout_query" // 여기에 실제 쿼리문을 넣을 수 있음 showBottomSheet = true } ) From 601e0fe5bfa0e998e2fb2ae55dfc56deccfdba04 Mon Sep 17 00:00:00 2001 From: seoyeonsw Date: Thu, 7 Nov 2024 00:38:01 +0900 Subject: [PATCH 6/8] =?UTF-8?q?#11=20=ED=94=84=EB=A1=9C=ED=95=84=20&=20?= =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20UI=20=EC=88=98=EC=A0=95=20&=20?= =?UTF-8?q?=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alddeul_babsang/core_ui/component/BottomSheetButton.kt | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/BottomSheetButton.kt diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/BottomSheetButton.kt b/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/BottomSheetButton.kt deleted file mode 100644 index 221e2de..0000000 --- a/app/src/main/java/com/hackathon/alddeul_babsang/core_ui/component/BottomSheetButton.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.hackathon.alddeul_babsang.core_ui.component - -class BottomSheetButton { -} \ No newline at end of file From 41f88089f60e940337e67b5f6a55431e9933083a Mon Sep 17 00:00:00 2001 From: seoyeonsw Date: Thu, 7 Nov 2024 00:52:39 +0900 Subject: [PATCH 7/8] =?UTF-8?q?#11=20=ED=94=84=EB=A1=9C=ED=95=84=20&=20?= =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20UI=20=EC=88=98=EC=A0=95=20&=20?= =?UTF-8?q?=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile/screen/ProfileScreen.kt | 25 ++++++++++--------- .../profile/screen/ProfileScreenItem.kt | 5 ++-- app/src/main/res/values/strings.xml | 9 +++++++ 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt index 67673c0..a21fdec 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt @@ -90,7 +90,6 @@ fun ProfileScreen( val context = LocalContext.current var showBottomSheet by remember { mutableStateOf(false) } var bottomSheetKeyword by remember { mutableStateOf("") } - var bottomSheetQuery by remember { mutableStateOf("") } Column( modifier = Modifier @@ -118,7 +117,7 @@ fun ProfileScreen( Column { Spacer(modifier = Modifier.height(25.dp)) - Text("닉네임", style = head4Bold) + Text(stringResource(R.string.tv_profile_nickname), style = head4Bold) Spacer(modifier = Modifier.height(10.dp)) Row { Text( @@ -147,17 +146,17 @@ fun ProfileScreen( Column( modifier = Modifier .height(200.dp) + .padding(horizontal = 30.dp) ) { Text( - "이용안내", style = head6Semi, modifier = Modifier - .padding(start = 30.dp) + stringResource(R.string.tv_profile_userservice), style = head6Semi, modifier = Modifier .fillMaxWidth() .height(30.dp) ) Spacer(modifier = Modifier.height(20.dp)) ProfileScreenItem( - text = "서비스 이용약관", + text = stringResource(R.string.tv_profile_userservice1), onClick = { navigateToWebsite( context = context, @@ -168,7 +167,7 @@ fun ProfileScreen( Spacer(modifier = Modifier.height(20.dp)) ProfileScreenItem( - text = "개인정보 처리방침", + text = stringResource(R.string.tv_profile_userservice2), onClick = { navigateToWebsite( context = context, @@ -179,7 +178,7 @@ fun ProfileScreen( Spacer(modifier = Modifier.height(20.dp)) ProfileScreenItem( - text = "버전 정보", + text = stringResource(R.string.tv_profile_userservice3), onClick = {} ) @@ -198,23 +197,24 @@ fun ProfileScreen( Column( modifier = Modifier .height(200.dp) + .padding(horizontal = 30.dp) ) { Text( - "기타", style = head6Semi, modifier = Modifier - .padding(start = 30.dp) + stringResource(R.string.tv_profile_userservice4), style = head6Semi, modifier = Modifier + .fillMaxWidth() .height(30.dp) ) Spacer(modifier = Modifier.height(20.dp)) ProfileScreenItem( - text = "고객센터", + text = stringResource(R.string.tv_profile_userservice5), onClick = {} ) Spacer(modifier = Modifier.height(20.dp)) ProfileScreenItem( - text = "로그아웃", + text = stringResource(R.string.tv_profile_userservicelogout), onClick = { bottomSheetKeyword = "로그아웃" showBottomSheet = true @@ -223,7 +223,7 @@ fun ProfileScreen( Spacer(modifier = Modifier.height(20.dp)) ProfileScreenItem( - text = "회원 탈퇴", + text = stringResource(R.string.tv_profile_userservicedelete), onClick = { bottomSheetKeyword = "회원 탈퇴" showBottomSheet = true @@ -341,6 +341,7 @@ fun BottomSheetContent( style = head7Bold ) } + Spacer(modifier = Modifier.width(8.dp)) } } } diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt index fca6619..0fa90f0 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreenItem.kt @@ -35,13 +35,14 @@ fun ProfileScreenItem( Box( modifier = Modifier .fillMaxWidth() - .height(30.dp) + .height(40.dp) .clickable { onClick() } + .padding(vertical = 8.dp) ) { Text( modifier = Modifier .align(Alignment.CenterStart) - .padding(start = 30.dp), + , text = text, color = Gray400, style = head7Semi diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 677def5..c12c1f4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -78,5 +78,14 @@ 로그아웃 시 로그인 화면으로 이동합니다 로그아웃 하시겠습니까? 좋아요 목록 + 닉네임 + 이용안내 + 서비스 이용약관 + 개인정보 처리방침 + 버전 정보 + 기타 + 고객센터 + 로그아웃 + 회원 탈퇴 \ No newline at end of file From 78fced68a928eed4f833c64b14a40eae5b1bf8c5 Mon Sep 17 00:00:00 2001 From: seoyeonsw Date: Thu, 7 Nov 2024 03:01:33 +0900 Subject: [PATCH 8/8] =?UTF-8?q?#11=20=ED=94=84=EB=A1=9C=ED=95=84=20&=20?= =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20UI=20=EC=88=98=EC=A0=95=20&=20?= =?UTF-8?q?=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile/screen/ProfileLikeListScreen.kt | 19 ------------------- .../profile/screen/ProfileScreen.kt | 6 +++--- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt index 5f6badb..a3929af 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileLikeListScreen.kt @@ -57,15 +57,6 @@ fun ProfileLikeListRoute( val babsangListViewModel: BabsangListViewModel = hiltViewModel() ProfileLikeListScreen( navigator = navigator, // navController 대신 navigator 전달 - data = BabsangListEntity( - id = 1, - avatar = "", - name = "송이네 밥상", - codeName = "경양식/일식", - address = "서울특별시 용산구 청파동 11", - phone = "02-210-0220", - favorite = true - ), onBackClick = { navigator.navigateBack() }, babsangListViewModel = babsangListViewModel ) @@ -75,7 +66,6 @@ fun ProfileLikeListRoute( @Composable fun ProfileLikeListScreen( navigator: ProfileNavigator, - data: BabsangListEntity, onBackClick: () -> Unit = {}, babsangListViewModel: BabsangListViewModel ) { @@ -162,15 +152,6 @@ fun ProfileLikeListScreenPreview() { AlddeulBabsangTheme { ProfileLikeListScreen( navigator = navigator, - data = BabsangListEntity( - id = 1, - avatar = "", - name = "송이네 밥상", - codeName = "경양식/일식", - address = "서울특별시 용산구 청파동 11", - phone = "02-210-0220", - favorite = true - ), onBackClick = { }, babsangListViewModel = babsangListViewModel ) diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt index a21fdec..bc08ce4 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/profile/screen/ProfileScreen.kt @@ -145,7 +145,7 @@ fun ProfileScreen( Column( modifier = Modifier - .height(200.dp) + .height(240.dp) .padding(horizontal = 30.dp) ) { Text( @@ -182,7 +182,7 @@ fun ProfileScreen( onClick = {} ) - Spacer(modifier = Modifier.height(20.dp)) + Spacer(modifier = Modifier.height(30.dp)) HorizontalDivider( modifier = Modifier @@ -196,7 +196,7 @@ fun ProfileScreen( Column( modifier = Modifier - .height(200.dp) + .height(220.dp) .padding(horizontal = 30.dp) ) { Text(