From 442a37f447ad3e08b3f66cb4e45690c03e6fbca8 Mon Sep 17 00:00:00 2001 From: seoyeonsw Date: Thu, 7 Nov 2024 23:26:15 +0900 Subject: [PATCH] =?UTF-8?q?#16=20=EC=B0=A9=ED=95=9C=EB=B0=A5=EC=83=81=20&?= =?UTF-8?q?=20=EC=98=88=EB=B9=84=EC=B0=A9=ED=95=9C=20=EB=B0=A5=EC=83=81=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EA=B5=AC=ED=98=84=20(=EC=88=98?= =?UTF-8?q?=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../babsang/screen/BabsangListItem.kt | 48 +++------- .../babsang/screen/BabsangRecommendItem.kt | 25 +----- .../screen/BabsangRecommendViewModel.kt | 1 - .../babsang/screen/BabsangScreen.kt | 58 ++++++------ .../report/screen/ReportBabsangListItem.kt | 21 ++--- .../report/screen/ReportScreen.kt | 90 +++++++++---------- app/src/main/res/values/strings.xml | 10 +++ 7 files changed, 102 insertions(+), 151 deletions(-) diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangListItem.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangListItem.kt index d0dd96e..e95a1c7 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangListItem.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangListItem.kt @@ -27,7 +27,6 @@ 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 @@ -38,16 +37,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.BabsangListEntity -import com.hackathon.alddeul_babsang.presentation.babsang.navigation.BabsangNavigator +import com.hackathon.alddeul_babsang.domain.entity.LikesEntity +import com.hackathon.alddeul_babsang.presentation.profile.screen.LikeItem @Composable fun BabsangListItem( - navigator: BabsangNavigator, - data: BabsangListEntity + onClick: () -> Unit = {}, + data: LikesEntity ) { - - var isFavorite by remember { mutableStateOf(data.favorite ?: false) } + var isFavorite by remember { mutableStateOf(data.favorite) } // 클릭할 때마다 favorite 값 토글 val heartIconId = if (isFavorite) { @@ -56,7 +54,6 @@ fun BabsangListItem( R.drawable.ic_heart_white } - Column( modifier = Modifier .fillMaxWidth() @@ -65,10 +62,7 @@ fun BabsangListItem( color = Orange700, shape = RoundedCornerShape(14.dp) ) - .height(240.dp) - .clickable(onClick = { - navigator.navigateDetail(data.id) - }) + .clickable(onClick = { onClick() }) ) { Box( modifier = Modifier @@ -77,23 +71,20 @@ fun BabsangListItem( .clip(RoundedCornerShape(topStart = 14.dp, topEnd = 14.dp)) ) { // AsyncImage 로드 - ReplaceBabsangListImage(data.codeName, data.avatar) - + ReplaceImage2(data.codeName, data.avatar) Image( painter = painterResource(heartIconId), contentDescription = null, modifier = Modifier .padding(end = 10.dp, top = 10.dp) - .align(Alignment.TopEnd) // Box 내에서 오른쪽 끝으로 배치 + .align(Alignment.TopEnd) .clickable { // 클릭 시 좋아요 상태를 토글 isFavorite = !isFavorite } ) } - Spacer(modifier = Modifier.height(15.dp)) - Row { Text( text = data.name, @@ -101,9 +92,7 @@ fun BabsangListItem( color = Orange900, modifier = Modifier.padding(start = 20.dp) ) - Spacer(modifier = Modifier.width(15.dp)) - Text( text = data.codeName, style = body2Regular, @@ -113,29 +102,25 @@ fun BabsangListItem( .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) + modifier = Modifier.padding(start = 20.dp, bottom = 20.dp) ) } } @Composable -fun ReplaceBabsangListImage(codeName: String, imageUrl: String?) { +fun ReplaceImage2(codeName: String, imageUrl: String?) { val imageId = when (codeName) { "경양식/일식" -> R.drawable.ic_japanese_food "한식" -> R.drawable.ic_korean_food @@ -143,7 +128,6 @@ fun ReplaceBabsangListImage(codeName: String, imageUrl: String?) { else -> R.drawable.ic_etc_food } - Box( modifier = Modifier .fillMaxWidth() @@ -171,9 +155,7 @@ fun ReplaceBabsangListImage(codeName: String, imageUrl: String?) { .fillMaxWidth() // 가로는 꽉 차게 .fillMaxHeight() // 세로도 꽉 차게 .clip(RoundedCornerShape(topStart = 14.dp, topEnd = 14.dp)) - ) - } } } @@ -181,13 +163,9 @@ fun ReplaceBabsangListImage(codeName: String, imageUrl: String?) { @Preview(showBackground = true) @Composable fun BabsangListItemPreview() { - val navController = rememberNavController() - val navigator = BabsangNavigator(navController) - AlddeulBabsangTheme { - BabsangListItem( - navigator = navigator, - data = BabsangListEntity( + LikeItem( + data = LikesEntity( id = 1, avatar = null, name = "송이네 밥상", @@ -198,4 +176,4 @@ fun BabsangListItemPreview() { ) ) } -} +} \ No newline at end of file diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangRecommendItem.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangRecommendItem.kt index b1e74a6..1ce2f80 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangRecommendItem.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangRecommendItem.kt @@ -2,11 +2,9 @@ package com.hackathon.alddeul_babsang.presentation.babsang.screen 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.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 @@ -17,21 +15,14 @@ import androidx.compose.foundation.layout.width 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.focus.focusModifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.style.TextAlign 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 @@ -48,13 +39,11 @@ import com.hackathon.alddeul_babsang.core_ui.theme.body4Regular import com.hackathon.alddeul_babsang.core_ui.theme.body7Semi import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold import com.hackathon.alddeul_babsang.core_ui.theme.head5Bold -import com.hackathon.alddeul_babsang.domain.entity.BabsangListEntity import com.hackathon.alddeul_babsang.domain.entity.BabsangRecommendEntity -import com.hackathon.alddeul_babsang.presentation.babsang.navigation.BabsangNavigator @Composable fun BabsangRecommendItem( - navigator: BabsangNavigator, + onClick: () -> Unit = {}, data: BabsangRecommendEntity ) { @@ -62,15 +51,13 @@ fun BabsangRecommendItem( modifier = Modifier .width(170.dp) .height(192.dp) - .clickable(onClick = { - navigator.navigateDetail(data.id) - }) + .clickable(onClick = { onClick() }) ) { Box( modifier = Modifier .fillMaxWidth() .fillMaxHeight() - .clip(RoundedCornerShape(10.dp)) + .clip(RoundedCornerShape(14.dp)) ) { // AsyncImage 로드 ReplaceImage(data.codeName, data.avatar) @@ -84,7 +71,7 @@ fun BabsangRecommendItem( modifier = Modifier .width(34.dp) .height(17.dp) - .clip(RoundedCornerShape(50.dp)) + .clip(RoundedCornerShape(6.dp)) .background(White), contentAlignment = Alignment.Center @@ -196,12 +183,8 @@ fun ReplaceImage(codeName: String, imageUrl: String?) { @Preview(showBackground = true) @Composable fun BabsangRecommendItemPreview() { - val navController = rememberNavController() - val navigator = BabsangNavigator(navController) - AlddeulBabsangTheme { BabsangRecommendItem( - navigator = navigator, data = BabsangRecommendEntity( id = 1, avatar = null, diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangRecommendViewModel.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangRecommendViewModel.kt index df54691..8c43596 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangRecommendViewModel.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangRecommendViewModel.kt @@ -1,7 +1,6 @@ package com.hackathon.alddeul_babsang.presentation.babsang.screen import androidx.lifecycle.ViewModel -import com.hackathon.alddeul_babsang.domain.entity.BabsangListEntity import com.hackathon.alddeul_babsang.domain.entity.BabsangRecommendEntity import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangScreen.kt index e647d92..b29d714 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/babsang/screen/BabsangScreen.kt @@ -1,14 +1,16 @@ package com.hackathon.alddeul_babsang.presentation.babsang.screen import androidx.compose.foundation.background -import androidx.compose.foundation.horizontalScroll 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.lazy.LazyColumn +import androidx.compose.foundation.lazy.LazyRow +import androidx.compose.foundation.lazy.items import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.CenterAlignedTopAppBar @@ -27,26 +29,23 @@ 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 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.White import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold -import com.hackathon.alddeul_babsang.core_ui.theme.head6Bold import com.hackathon.alddeul_babsang.core_ui.theme.head6Semi -import com.hackathon.alddeul_babsang.core_ui.theme.head7Bold import com.hackathon.alddeul_babsang.presentation.babsang.navigation.BabsangNavigator -import com.hackathon.alddeul_babsang.presentation.profile.screen.BabsangListViewModel +import com.hackathon.alddeul_babsang.presentation.profile.screen.LikeViewModel +import com.hackathon.alddeul_babsang.presentation.report.screen.BabsangItem @Composable fun BabsangRoute( navigator: BabsangNavigator ) { - val babsangListViewModel: BabsangListViewModel = hiltViewModel() + val babsangListViewModel: LikeViewModel = hiltViewModel() val babsangRecommendViewModel: BabsangRecommendViewModel = hiltViewModel() val systemUiController = rememberSystemUiController() @@ -57,7 +56,7 @@ fun BabsangRoute( } BabsangScreen( - navigator = navigator, // navController 대신 navigator 전달 + onItemClick = { id -> navigator.navigateDetail(id) }, babsangListViewModel = babsangListViewModel, babsangRecommendViewModel = babsangRecommendViewModel ) @@ -66,12 +65,12 @@ fun BabsangRoute( @OptIn(ExperimentalMaterial3Api::class) @Composable fun BabsangScreen( - navigator: BabsangNavigator, - babsangListViewModel: BabsangListViewModel, + onItemClick: (Long) -> Unit = {}, + babsangListViewModel: LikeViewModel, babsangRecommendViewModel: BabsangRecommendViewModel ) { val scrollState = rememberScrollState() - val rowScrollState = rememberScrollState() + Scaffold( topBar = { CenterAlignedTopAppBar( @@ -101,26 +100,26 @@ fun BabsangScreen( Text( text = buildAnnotatedString { withStyle(style = SpanStyle(color = Orange800)) { - append("알뜰 밥상") + append(stringResource(R.string.tv_babsang_recommend1)) } - append("이 ") + append(stringResource(R.string.tv_babsang_recommend2)) withStyle(style = SpanStyle(color = Orange800)) { - append("추천") + append(stringResource(R.string.tv_babsang_recommend3)) } - append("하는 밥상") + append(stringResource(R.string.tv_babsang_recommend4)) }, style = head6Semi ) Spacer(modifier = Modifier.height(10.dp)) - Row( + LazyRow( horizontalArrangement = Arrangement.spacedBy(16.dp), modifier = Modifier - .horizontalScroll(rowScrollState) + .fillMaxWidth() ) { - for (item in babsangRecommendViewModel.mockBabsangRecommendList) { + items(babsangRecommendViewModel.mockBabsangRecommendList) { item -> BabsangRecommendItem( - navigator = navigator, + onClick = { onItemClick(item.id) }, data = item ) } @@ -129,7 +128,7 @@ fun BabsangScreen( Spacer(modifier = Modifier.height(30.dp)) - Text("착한 밥상 리스트", style = head6Semi) + Text(stringResource(R.string.tv_babsang_list), style = head6Semi) Spacer(modifier = Modifier.height(15.dp)) @@ -137,9 +136,9 @@ fun BabsangScreen( verticalArrangement = Arrangement.spacedBy(16.dp), horizontalAlignment = Alignment.CenterHorizontally ) { - for (item in babsangListViewModel.mockLikeList) { - BabsangListItem( - navigator = navigator, + for (item in babsangListViewModel.mockLikes) { + BabsangItem( + onClick = { onItemClick(item.id) }, data = item ) } @@ -148,22 +147,15 @@ fun BabsangScreen( - } @Preview(showBackground = true) @Composable fun BabsangScreenPreview() { - val babsangListViewModel: BabsangListViewModel = hiltViewModel() - val babsangRecommendViewModel: BabsangRecommendViewModel = hiltViewModel() - val navController = rememberNavController() - val navigator = BabsangNavigator(navController) - AlddeulBabsangTheme { BabsangScreen( - navigator = navigator, - babsangListViewModel = babsangListViewModel, - babsangRecommendViewModel = babsangRecommendViewModel + babsangListViewModel = hiltViewModel(), + babsangRecommendViewModel = hiltViewModel(), ) } } diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/report/screen/ReportBabsangListItem.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/report/screen/ReportBabsangListItem.kt index 32b3652..060fb4e 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/report/screen/ReportBabsangListItem.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/report/screen/ReportBabsangListItem.kt @@ -27,7 +27,6 @@ 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 @@ -38,17 +37,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.BabsangListEntity -import com.hackathon.alddeul_babsang.presentation.profile.navigation.ProfileNavigator -import com.hackathon.alddeul_babsang.presentation.report.navigation.ReportNavigator +import com.hackathon.alddeul_babsang.domain.entity.LikesEntity @Composable fun BabsangItem( - navigator: ReportNavigator, - data: BabsangListEntity + onClick: () -> Unit = {}, + data: LikesEntity ) { - var isFavorite by remember { mutableStateOf(data.favorite ?: false) } + var isFavorite by remember { mutableStateOf(data.favorite) } // 클릭할 때마다 favorite 값 토글 val heartIconId = if (isFavorite) { @@ -67,9 +64,7 @@ fun BabsangItem( shape = RoundedCornerShape(14.dp) ) .height(240.dp) - .clickable(onClick = { - navigator.navigateDetail(data.id) - }) + .clickable(onClick = { onClick() }) ) { Box( modifier = Modifier @@ -182,13 +177,9 @@ fun LoadImageWithPlaceholder(codeName: String, imageUrl: String?) { @Preview(showBackground = true) @Composable fun BabsangItemPreview() { - val navController = rememberNavController() - val navigator = ReportNavigator(navController) - AlddeulBabsangTheme { BabsangItem( - navigator = navigator, - data = BabsangListEntity( + data = LikesEntity( id = 1, avatar = null, name = "송이네 밥상", diff --git a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/report/screen/ReportScreen.kt b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/report/screen/ReportScreen.kt index dfd69fe..0b31ba9 100644 --- a/app/src/main/java/com/hackathon/alddeul_babsang/presentation/report/screen/ReportScreen.kt +++ b/app/src/main/java/com/hackathon/alddeul_babsang/presentation/report/screen/ReportScreen.kt @@ -3,15 +3,17 @@ package com.hackathon.alddeul_babsang.presentation.report.screen import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box + import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width -import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.verticalScroll +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.Text @@ -19,20 +21,20 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.SideEffect import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.text.SpanStyle -import androidx.compose.ui.text.buildAnnotatedString -import androidx.compose.ui.text.withStyle +import androidx.compose.ui.res.stringResource 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.* -import com.hackathon.alddeul_babsang.domain.entity.BabsangListEntity -import com.hackathon.alddeul_babsang.presentation.profile.navigation.ProfileNavigator -import com.hackathon.alddeul_babsang.presentation.profile.screen.BabsangListViewModel -import com.hackathon.alddeul_babsang.presentation.profile.screen.LikeItem +import com.hackathon.alddeul_babsang.core_ui.theme.Blue +import com.hackathon.alddeul_babsang.core_ui.theme.Gray900 +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.head6Bold +import com.hackathon.alddeul_babsang.core_ui.theme.head7Bold +import com.hackathon.alddeul_babsang.presentation.profile.screen.LikeViewModel import com.hackathon.alddeul_babsang.presentation.report.navigation.ReportNavigator @Composable @@ -40,7 +42,7 @@ fun ReportRoute( navigator: ReportNavigator ) { - val babsangListViewModel: BabsangListViewModel = hiltViewModel() + val babsangListViewModel: LikeViewModel = hiltViewModel() val systemUiController = rememberSystemUiController() SideEffect { @@ -50,10 +52,11 @@ fun ReportRoute( } ReportScreen( + onItemClick = { id -> navigator.navigateDetail(id) }, onReportWriteClick = { navigator.navigateReportWrite() }, - navigator = navigator, // navController 대신 navigator 전달 + babsangListViewModel = babsangListViewModel ) @@ -61,74 +64,69 @@ fun ReportRoute( @Composable fun ReportScreen( + onItemClick: (Long) -> Unit = {}, onReportWriteClick: () -> Unit = {}, - navigator: ReportNavigator, - babsangListViewModel: BabsangListViewModel + babsangListViewModel: LikeViewModel ) { + Box { - val scrollState = rememberScrollState() + LazyColumn( + verticalArrangement = Arrangement.spacedBy(16.dp), - Box{ - Column( modifier = Modifier .fillMaxSize() .background(color = White) .padding(horizontal = 20.dp, vertical = 25.dp) - .verticalScroll(scrollState), - - ) { - Text("직접 제보받은", style = head7Bold, color = Gray900) - Text("착한 밥상 후보 리스트", style = head6Bold, color = Orange900) - Spacer(modifier = Modifier.height(10.dp)) - Text("제보와 후기로 쌓아 보아요", style = head7Bold, color = Gray900) - - Spacer(modifier = Modifier.height(30.dp)) - - Column( - verticalArrangement = Arrangement.spacedBy(16.dp), - horizontalAlignment = Alignment.CenterHorizontally - ) { - for (item in babsangListViewModel.mockLikeList) { - BabsangItem( - navigator = navigator, - data = item - ) - } + ) { + + item { + Text(stringResource(R.string.tv_report_title1), style = head7Bold, color = Gray900) + Text( + stringResource(R.string.tv_report_title2), + style = head6Bold, + color = Orange900 + ) + Spacer(modifier = Modifier.height(10.dp)) + Text(stringResource(R.string.tv_report_title3), style = head7Bold, color = Gray900) + + Spacer(modifier = Modifier.height(14.dp)) } + items(babsangListViewModel.mockLikes) { item -> + BabsangItem( + onClick = { onItemClick(item.id) }, + data = item + ) + } } + Button( onClick = { onReportWriteClick() }, modifier = Modifier .width(170.dp) .height(70.dp) - .offset(y = -20.dp, x=-10.dp) + .offset(y = -20.dp, x = -10.dp) .align(Alignment.BottomEnd), colors = ButtonDefaults.buttonColors( containerColor = Blue, // 버튼 배경색 contentColor = White // 버튼 텍스트 색상 ) ) { - Text(text = "제보하러 가기", style= head7Bold) // 텍스트 색상은 흰색으로 설정 + Text(text = "제보하러 가기", style = head7Bold) // 텍스트 색상은 흰색으로 설정 } - } - } @Preview @Composable fun ReportScreenPreview() { - val babsangListViewModel: BabsangListViewModel = hiltViewModel() - val navController = rememberNavController() - val navigator = ReportNavigator(navController) + val babsangListViewModel: LikeViewModel = hiltViewModel() AlddeulBabsangTheme { ReportScreen( onReportWriteClick = { }, - navigator = navigator, babsangListViewModel = babsangListViewModel ) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 916920d..b044f51 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -99,4 +99,14 @@ 착한 밥상 + + 직접 제보받은 + 착한 밥상 후보 리스트 + 제보와 후기로 쌓아 보아요 + 알뜰 밥상 + "이 " + 추천 + 하는 밥상 + 착한 밥상 리스트 + \ No newline at end of file