From 8ff1f556720377ab5654288018f9bfab7e59bdb8 Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Tue, 31 Dec 2024 02:17:12 +0900 Subject: [PATCH 1/9] =?UTF-8?q?[PC-217]=20value=20pick=20card=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=20=EA=B3=A8=EA=B2=A9=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../matching/detail/MatchingDetailRoute.kt | 120 +++++++++++++++++- 1 file changed, 118 insertions(+), 2 deletions(-) diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt index 3d1af978..f48e7087 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt @@ -704,13 +704,100 @@ private fun ProfileValuePickBody( } when (tabIndex.intValue) { - 0 -> TabContent("전체 탭의 내용 예시...") + 0 -> { + LazyColumn( + modifier = Modifier + .fillMaxSize() + .background(PieceTheme.colors.light3) + .padding(horizontal = 20.dp), + ) { + itemsIndexed(pickCards) { idx, item -> + Spacer(Modifier.height(20.dp)) + + ValuePickCard( + valuePick = item, + ) + } + + item { + Spacer(Modifier.height(60.dp)) + } + } + } + 1 -> TabContent("나만 탭의 내용 예시...") 2 -> TabContent("너만 탭의 내용 예시...") } } } +@Composable +private fun ValuePickCard( + valuePick: ValuePick, + modifier: Modifier = Modifier, +) { + Column( + modifier = modifier + .clip(RoundedCornerShape(12.dp)) + .background(PieceTheme.colors.white) + .padding( + horizontal = 20.dp, + vertical = 24.dp, + ) + ) { + Row(modifier = Modifier.fillMaxWidth()) { + Image( + painter = painterResource(id = R.drawable.ic_puzzle1), + contentDescription = "basic info 배경화면", + modifier = Modifier + .size(20.dp), + ) + + Spacer(modifier = modifier.width(6.dp)) + + Text( + text = valuePick.category, + style = PieceTheme.typography.bodyMM, + color = PieceTheme.colors.primaryDefault, + ) + + Spacer(modifier = modifier.weight(1f)) + + if (valuePick.isSimilarToMe) { + Text( + text = "나와 같은", + style = PieceTheme.typography.bodyMM, + color = PieceTheme.colors.primaryDefault, + ) + } + } + + Spacer(modifier = Modifier.height(12.dp)) + + Text( + text = valuePick.question, + style = PieceTheme.typography.headingMSB, + color = PieceTheme.colors.black, + ) + + Spacer(modifier = Modifier.height(24.dp)) + + Text( + text = valuePick.option1, + style = PieceTheme.typography.headingMSB, + color = PieceTheme.colors.black, + ) + + Spacer(modifier = Modifier.height(8.dp)) + + Text( + text = valuePick.option2, + style = PieceTheme.typography.bodySM, + color = PieceTheme.colors.dark2, + ) + } +} + @Composable private fun TabContent(contentText: String) { LazyColumn( @@ -794,7 +881,36 @@ private fun ProfileValueTalkBodyPreview() { private fun ProfileValuePickBodyPreview() { PieceTheme { ProfileValuePickBody( - pickCards = emptyList() + pickCards = listOf( + ValuePick( + category = "음주", + question = "사귀는 사람과 함께 술을 마시는 것을 좋아하나요?", + option1 = "함께 술을 즐기고 싶어요", + option2 = "같이 술을 즐길 수 없어도 괜찮아요", + isSimilarToMe = true, + ), + ValuePick( + category = "만남 빈도", + question = "주말에 얼마나 자주 데이트를 하고싶나요?", + option1 = "주말에는 최대한 같이 있고 싶어요", + option2 = "하루 정도는 각자 보내고 싶어요", + isSimilarToMe = true, + ), + ValuePick( + category = "연락 빈도", + question = "연인 사이에 얼마나 자주 연락하는게 좋은가요?", + option1 = "바빠도 최대한 자주 연락하고 싶어요", + option2 = "연락은 생각날 때만 종종 해도 괜찮아요", + isSimilarToMe = true, + ), + ValuePick( + category = "연락 방식", + question = "연락할 때 어떤 방법을 더 좋아하나요?", + option1 = "전화보다는 문자나 카톡이 좋아요", + option2 = "문자나 카톡보다는 전화가 좋아요", + isSimilarToMe = true, + ) + ) ) } } From 9dbbd198c77dfce2482ff4e9fa0bb360986fac2f Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Wed, 1 Jan 2025 01:55:15 +0900 Subject: [PATCH 2/9] =?UTF-8?q?[PC-217]=20=EB=A7=A4=EC=B9=AD=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20value=20pick=20ui=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../puzzle/designsystem/component/Button.kt | 18 +- .../main/res/drawable/ic_profile_image.xml | 35 ++ .../src/main/res/drawable/ic_question.xml | 14 + .../src/main/res/values/strings.xml | 4 + .../matching/detail/MatchingDetailRoute.kt | 379 +++++++++++++----- 5 files changed, 352 insertions(+), 98 deletions(-) create mode 100644 core/designsystem/src/main/res/drawable/ic_profile_image.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_question.xml diff --git a/core/designsystem/src/main/java/com/puzzle/designsystem/component/Button.kt b/core/designsystem/src/main/java/com/puzzle/designsystem/component/Button.kt index 88af11e3..1d71fae4 100644 --- a/core/designsystem/src/main/java/com/puzzle/designsystem/component/Button.kt +++ b/core/designsystem/src/main/java/com/puzzle/designsystem/component/Button.kt @@ -90,8 +90,8 @@ fun PieceSubButton( colors = ButtonDefaults.buttonColors( containerColor = PieceTheme.colors.primaryLight, contentColor = PieceTheme.colors.primaryDefault, - disabledContainerColor = PieceTheme.colors.light1, - disabledContentColor = PieceTheme.colors.white, + disabledContainerColor = PieceTheme.colors.light3, + disabledContentColor = PieceTheme.colors.dark2, ), modifier = modifier.height(52.dp), ) { @@ -241,3 +241,17 @@ fun PreviewPieceIconButton() { ) } } + +@Preview +@Composable +fun PreviewPieceRoundingButton() { + PieceTheme { + PieceRoundingButton( + label = "Label", + onClick = {}, + modifier = Modifier + .fillMaxWidth() + .padding(16.dp), + ) + } +} \ No newline at end of file diff --git a/core/designsystem/src/main/res/drawable/ic_profile_image.xml b/core/designsystem/src/main/res/drawable/ic_profile_image.xml new file mode 100644 index 00000000..edf42ce9 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_profile_image.xml @@ -0,0 +1,35 @@ + + + + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_question.xml b/core/designsystem/src/main/res/drawable/ic_question.xml new file mode 100644 index 00000000..31ec4b74 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_question.xml @@ -0,0 +1,14 @@ + + + + diff --git a/core/designsystem/src/main/res/values/strings.xml b/core/designsystem/src/main/res/values/strings.xml index 965545d9..a76c523a 100644 --- a/core/designsystem/src/main/res/values/strings.xml +++ b/core/designsystem/src/main/res/values/strings.xml @@ -11,4 +11,8 @@ 활동 지역 직업 흡연 + 전체 + 나와 같은 + 나와 다른 + 매칭 거절하기 \ No newline at end of file diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt index f48e7087..bd9f46c7 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt @@ -20,12 +20,15 @@ import androidx.compose.foundation.lazy.itemsIndexed import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Tab import androidx.compose.material3.TabRow +import androidx.compose.material3.TabRowDefaults +import androidx.compose.material3.TabRowDefaults.tabIndicatorOffset import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -38,6 +41,8 @@ import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.style.TextDecoration import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp @@ -45,6 +50,7 @@ import com.airbnb.mvrx.compose.collectAsState import com.airbnb.mvrx.compose.mavericksViewModel import com.puzzle.designsystem.R import com.puzzle.designsystem.component.PieceRoundingButton +import com.puzzle.designsystem.component.PieceSubButton import com.puzzle.designsystem.component.PieceSubCloseTopBar import com.puzzle.designsystem.foundation.PieceTheme import com.puzzle.domain.model.pick.ValuePick @@ -65,6 +71,9 @@ internal fun MatchingDetailRoute( onPreviousPageClick = { viewModel.onIntent(MatchingDetailIntent.OnPreviousPageClick) }, onNextPageClick = { viewModel.onIntent(MatchingDetailIntent.OnNextPageClick) }, onMoreClick = { viewModel.onIntent(MatchingDetailIntent.OnMoreClick) }, + onRefuseClick = { }, + onAcceptClick = { }, + onShowPicturesClick = { }, ) } @@ -75,6 +84,9 @@ private fun MatchingDetailScreen( onPreviousPageClick: () -> Unit, onNextPageClick: () -> Unit, onMoreClick: () -> Unit, + onRefuseClick: () -> Unit, + onShowPicturesClick: () -> Unit, + onAcceptClick: () -> Unit, modifier: Modifier = Modifier, ) { BackgroundImage(modifier) @@ -96,6 +108,7 @@ private fun MatchingDetailScreen( MatchingDetailContent( state = state, onMoreClick = onMoreClick, + onRefuseClick = onRefuseClick, modifier = Modifier .fillMaxSize() .padding(top = topBarHeight, bottom = bottomBarHeight), @@ -122,8 +135,8 @@ private fun MatchingDetailScreen( currentPage = state.currentPage, onNextPageClick = onNextPageClick, onPreviousPageClick = onPreviousPageClick, - onShowPicturesClick = {}, - onAcceptClick = {}, + onShowPicturesClick = onShowPicturesClick, + onAcceptClick = onAcceptClick, modifier = Modifier .fillMaxWidth() .height(bottomBarHeight) @@ -155,6 +168,7 @@ private fun BackgroundImage( private fun MatchingDetailContent( state: MatchingDetailState, onMoreClick: () -> Unit, + onRefuseClick: () -> Unit, modifier: Modifier = Modifier, ) { Box(modifier = modifier.fillMaxSize()) { @@ -186,7 +200,37 @@ private fun MatchingDetailContent( MatchingDetailState.MatchingDetailPage.ValuePickState -> { ProfileValuePickBody( - pickCards = state.pickCards + pickCards = listOf( + ValuePick( + category = "음주", + question = "사귀는 사람과 함께 술을 마시는 것을 좋아하나요?", + option1 = "함께 술을 즐기고 싶어요", + option2 = "같이 술을 즐길 수 없어도 괜찮아요", + isSimilarToMe = true, + ), + ValuePick( + category = "만남 빈도", + question = "주말에 얼마나 자주 데이트를 하고싶나요?", + option1 = "주말에는 최대한 같이 있고 싶어요", + option2 = "하루 정도는 각자 보내고 싶어요", + isSimilarToMe = false, + ), + ValuePick( + category = "연락 빈도", + question = "연인 사이에 얼마나 자주 연락하는게 좋은가요?", + option1 = "바빠도 최대한 자주 연락하고 싶어요", + option2 = "연락은 생각날 때만 종종 해도 괜찮아요", + isSimilarToMe = true, + ), + ValuePick( + category = "연락 방식", + question = "연락할 때 어떤 방법을 더 좋아하나요?", + option1 = "전화보다는 문자나 카톡이 좋아요", + option2 = "문자나 카톡보다는 전화가 좋아요", + isSimilarToMe = false, + ) + ), + onRefuseClick = onRefuseClick ) } } @@ -208,7 +252,7 @@ private fun MatchingDetailBottomBar( ) { if (currentPage == MatchingDetailPage.ValuePickState) { Image( - painter = painterResource(id = R.drawable.ic_profile_image_temp), + painter = painterResource(id = R.drawable.ic_profile_image), contentDescription = "이전 페이지 버튼", modifier = Modifier .size(52.dp) @@ -312,7 +356,7 @@ private fun BasicInfoName( Spacer(modifier = Modifier.weight(1f)) - ValueTalkHeader( + BasicInfoHeader( nickName = nickName, selfDescription = selfDescription, onMoreClick = onMoreClick, @@ -467,7 +511,7 @@ private fun ProfileValueTalkBody( ) { val density = LocalDensity.current // 1) 고정 헤더 높이(105.dp) - val valueTalkHeaderHeight = 105.dp + val valueTalkHeaderHeight = 104.dp val valueTalkHeaderHeightPx = with(density) { valueTalkHeaderHeight.roundToPx() } // 2) 헤더가 얼마나 접혔는지(offset)를 관리해주는 NestedScrollConnection @@ -503,36 +547,19 @@ private fun ProfileValueTalkBody( Modifier.height(spaceHeight) ) - LazyColumn( - modifier = Modifier - .fillMaxSize() - .background(PieceTheme.colors.light3) - .padding(horizontal = 20.dp), - ) { - itemsIndexed(talkCards) { idx, item -> - Spacer(Modifier.height(20.dp)) - - ValueTalkCard( - item = item, - idx = idx, - ) - } - - item { - Spacer(Modifier.height(60.dp)) - } - } + ValueTalkCards(talkCards) } // 6) 실제 헤더 뷰 // offset을 통해 y축 이동 (headerOffset이 음수면 위로 올라가며 사라짐) - ValueTalkHeader( + BasicInfoHeader( nickName = nickName, selfDescription = selfDescription, onMoreClick = onMoreClick, modifier = Modifier .offset { IntOffset(0, connection.headerOffset) } .background(PieceTheme.colors.white) + .height(valueTalkHeaderHeight) .padding( vertical = 20.dp, horizontal = 20.dp @@ -549,6 +576,29 @@ private fun ProfileValueTalkBody( } } +@Composable +private fun ValueTalkCards(talkCards: List) { + LazyColumn( + modifier = Modifier + .fillMaxSize() + .background(PieceTheme.colors.light3) + .padding(horizontal = 20.dp), + ) { + itemsIndexed(talkCards) { idx, item -> + Spacer(Modifier.height(20.dp)) + + ValueTalkCard( + item = item, + idx = idx, + ) + } + + item { + Spacer(Modifier.height(60.dp)) + } + } +} + private class CollapsingHeaderNestedScrollConnection( val headerHeight: Int ) : NestedScrollConnection { @@ -579,15 +629,13 @@ private class CollapsingHeaderNestedScrollConnection( } @Composable -private fun ValueTalkHeader( +private fun BasicInfoHeader( nickName: String, selfDescription: String, onMoreClick: () -> Unit, modifier: Modifier = Modifier ) { - Column( - modifier = modifier, - ) { + Column(modifier = modifier) { Text( text = selfDescription, style = PieceTheme.typography.bodyMR, @@ -681,52 +729,193 @@ private fun ValueTalkCard( @Composable private fun ProfileValuePickBody( pickCards: List, + onRefuseClick: () -> Unit, modifier: Modifier = Modifier, ) { - val tabIndex = remember { mutableIntStateOf(0) } + val density = LocalDensity.current - val tabTitles = listOf("전체", "나와 같은", "나와 다른") + val valuePickHeaderHeight = 104.dp - Column( - modifier = modifier.fillMaxSize(), + val valuePickHeaderHeightPx = with(density) { valuePickHeaderHeight.roundToPx() } + + val connection = remember(valuePickHeaderHeightPx) { + CollapsingHeaderNestedScrollConnection(valuePickHeaderHeightPx) + } + + val spaceHeight by remember(density) { + derivedStateOf { + with(density) { + (valuePickHeaderHeightPx + connection.headerOffset).toDp() + } + } + } + + val tabIndex = rememberSaveable { mutableIntStateOf(0) } + + val tabTitles = listOf( + stringResource(R.string.feature_matching_detail_valuepick_all), + stringResource(R.string.feature_matching_detail_valuepick_same), + stringResource(R.string.feature_matching_detail_valuepick_different), + ) + + Box( + modifier = modifier + .nestedScroll(connection) ) { - TabRow( - selectedTabIndex = tabIndex.intValue, - modifier = Modifier.fillMaxWidth(), - ) { - tabTitles.forEachIndexed { index, title -> - Tab( - selected = (tabIndex.intValue == index), - onClick = { tabIndex.intValue = index }, - text = { Text(text = title) }, + Column { + Spacer(Modifier.height(spaceHeight)) + + Column( + modifier = modifier.fillMaxSize(), + ) { + ValuePickTabRow( + tabIndex = tabIndex.intValue, + tabTitles = tabTitles, + onTabClick = { tabIndex.intValue = it }, + ) + + ValuePickTabContent( + tabIndex = tabIndex.intValue, + pickCards = pickCards, + onRefuseClick = onRefuseClick, ) } } - when (tabIndex.intValue) { - 0 -> { - LazyColumn( - modifier = Modifier - .fillMaxSize() - .background(PieceTheme.colors.light3) - .padding(horizontal = 20.dp), - ) { - itemsIndexed(pickCards) { idx, item -> - Spacer(Modifier.height(20.dp)) - - ValuePickCard( - valuePick = item, - ) - } + BasicInfoHeader( + nickName = "nickName", + selfDescription = "selfDescription", + onMoreClick = { }, + modifier = Modifier + .offset { IntOffset(0, connection.headerOffset) } + .background(PieceTheme.colors.white) + .height(valuePickHeaderHeight) + .padding( + vertical = 20.dp, + horizontal = 20.dp + ), + ) - item { - Spacer(Modifier.height(60.dp)) - } - } - } + Spacer( + modifier = Modifier + .height(1.dp) + .fillMaxWidth() + .background(PieceTheme.colors.light2) + .align(Alignment.TopCenter), + ) + } +} - 1 -> TabContent("나만 탭의 내용 예시...") - 2 -> TabContent("너만 탭의 내용 예시...") +@Composable +private fun ValuePickTabContent( + tabIndex: Int, + pickCards: List, + onRefuseClick: () -> Unit, +) { + when (tabIndex) { + ALL -> { + ValuePickCards( + pickCards = pickCards, + onRefuseClick = onRefuseClick, + ) + } + + SAME -> { + ValuePickCards( + pickCards = pickCards.filter { it.isSimilarToMe }, + onRefuseClick = onRefuseClick, + ) + } + + DIFFERENT -> { + ValuePickCards( + pickCards = pickCards.filterNot { it.isSimilarToMe }, + onRefuseClick = onRefuseClick, + ) + } + } +} + +const val ALL = 0 +const val SAME = 1 +const val DIFFERENT = 2 + +@Composable +private fun ValuePickCards( + pickCards: List, + onRefuseClick: () -> Unit, +) { + LazyColumn( + modifier = Modifier + .fillMaxSize() + .background(PieceTheme.colors.light3) + .padding(horizontal = 20.dp), + ) { + itemsIndexed(pickCards) { idx, item -> + Spacer(Modifier.height(20.dp)) + + ValuePickCard( + valuePick = item, + ) + } + + item { + Spacer(Modifier.height(60.dp)) + + Text( + text = stringResource(R.string.feature_matching_detail_valuepick_refuse), + style = PieceTheme.typography.bodyMM.copy( + textDecoration = TextDecoration.Underline + ), + color = PieceTheme.colors.dark3, + textAlign = TextAlign.Center, + modifier = Modifier + .fillMaxWidth() + .clickable { + onRefuseClick() + }, + ) + + Spacer(Modifier.height(60.dp)) + } + } +} + +@Composable +private fun ValuePickTabRow( + tabIndex: Int, + onTabClick: (Int) -> Unit, + tabTitles: List +) { + TabRow( + containerColor = PieceTheme.colors.white, + selectedTabIndex = tabIndex, + modifier = Modifier + .fillMaxWidth() + .height(48.dp), + indicator = { tabPositions -> + if (tabIndex < tabPositions.size) { + TabRowDefaults.SecondaryIndicator( + color = PieceTheme.colors.black, + modifier = Modifier.tabIndicatorOffset(tabPositions[tabIndex]), + ) + } + }, + divider = {}, + ) { + tabTitles.forEachIndexed { index, title -> + Tab( + selected = (tabIndex == index), + onClick = { onTabClick(tabIndex) }, + text = { + Text( + text = title, + style = PieceTheme.typography.bodyMM, + ) + }, + selectedContentColor = PieceTheme.colors.black, + unselectedContentColor = PieceTheme.colors.dark3, + ) } } } @@ -745,9 +934,12 @@ private fun ValuePickCard( vertical = 24.dp, ) ) { - Row(modifier = Modifier.fillMaxWidth()) { + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + ) { Image( - painter = painterResource(id = R.drawable.ic_puzzle1), + painter = painterResource(id = R.drawable.ic_question), contentDescription = "basic info 배경화면", modifier = Modifier .size(20.dp), @@ -757,7 +949,7 @@ private fun ValuePickCard( Text( text = valuePick.category, - style = PieceTheme.typography.bodyMM, + style = PieceTheme.typography.bodySSB, color = PieceTheme.colors.primaryDefault, ) @@ -766,8 +958,13 @@ private fun ValuePickCard( if (valuePick.isSimilarToMe) { Text( text = "나와 같은", - style = PieceTheme.typography.bodyMM, - color = PieceTheme.colors.primaryDefault, + style = PieceTheme.typography.captionM, + color = PieceTheme.colors.subDefault, + modifier = Modifier + .clip(RoundedCornerShape(23.dp)) + .background(PieceTheme.colors.subLight) + .padding(vertical = 6.dp, horizontal = 12.dp), + textAlign = TextAlign.Center, ) } } @@ -777,43 +974,29 @@ private fun ValuePickCard( Text( text = valuePick.question, style = PieceTheme.typography.headingMSB, - color = PieceTheme.colors.black, + color = PieceTheme.colors.dark1, ) Spacer(modifier = Modifier.height(24.dp)) - Text( - text = valuePick.option1, - style = PieceTheme.typography.headingMSB, - color = PieceTheme.colors.black, + PieceSubButton( + label = valuePick.option1, + onClick = {}, + modifier = Modifier.fillMaxWidth(), + enabled = true, ) Spacer(modifier = Modifier.height(8.dp)) - Text( - text = valuePick.option2, - style = PieceTheme.typography.bodySM, - color = PieceTheme.colors.dark2, + PieceSubButton( + label = valuePick.option2, + onClick = {}, + modifier = Modifier.fillMaxWidth(), + enabled = false, ) } } -@Composable -private fun TabContent(contentText: String) { - LazyColumn( - modifier = Modifier - .fillMaxSize() - .padding(16.dp), - ) { - items(15) { index -> - Text( - text = "$contentText 아이템 $index", - modifier = Modifier.padding(vertical = 8.dp), - ) - } - } -} - @Preview @Composable private fun MatchingDetailScreenPreview() { @@ -824,6 +1007,9 @@ private fun MatchingDetailScreenPreview() { {}, {}, {}, + {}, + {}, + {}, ) } } @@ -910,7 +1096,8 @@ private fun ProfileValuePickBodyPreview() { option2 = "문자나 카톡보다는 전화가 좋아요", isSimilarToMe = true, ) - ) + ), + {}, ) } } From 94df6005fbc2ef13452b844ebd238fd1a7af05f2 Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Wed, 1 Jan 2025 01:58:08 +0900 Subject: [PATCH 3/9] =?UTF-8?q?[PC-217]=20=EB=8D=94=EB=AF=B8=20=EA=B0=92?= =?UTF-8?q?=20=EC=A7=80=EC=9A=B0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../matching/detail/MatchingDetailRoute.kt | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt index bd9f46c7..a8f3287c 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt @@ -200,36 +200,7 @@ private fun MatchingDetailContent( MatchingDetailState.MatchingDetailPage.ValuePickState -> { ProfileValuePickBody( - pickCards = listOf( - ValuePick( - category = "음주", - question = "사귀는 사람과 함께 술을 마시는 것을 좋아하나요?", - option1 = "함께 술을 즐기고 싶어요", - option2 = "같이 술을 즐길 수 없어도 괜찮아요", - isSimilarToMe = true, - ), - ValuePick( - category = "만남 빈도", - question = "주말에 얼마나 자주 데이트를 하고싶나요?", - option1 = "주말에는 최대한 같이 있고 싶어요", - option2 = "하루 정도는 각자 보내고 싶어요", - isSimilarToMe = false, - ), - ValuePick( - category = "연락 빈도", - question = "연인 사이에 얼마나 자주 연락하는게 좋은가요?", - option1 = "바빠도 최대한 자주 연락하고 싶어요", - option2 = "연락은 생각날 때만 종종 해도 괜찮아요", - isSimilarToMe = true, - ), - ValuePick( - category = "연락 방식", - question = "연락할 때 어떤 방법을 더 좋아하나요?", - option1 = "전화보다는 문자나 카톡이 좋아요", - option2 = "문자나 카톡보다는 전화가 좋아요", - isSimilarToMe = false, - ) - ), + pickCards = state.pickCards, onRefuseClick = onRefuseClick ) } From c76cfba41446116adcd958dc724e8efea60c55a6 Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Wed, 1 Jan 2025 02:12:05 +0900 Subject: [PATCH 4/9] =?UTF-8?q?[PC-217]=20=ED=8C=8C=EB=9D=BC=EB=AF=B8?= =?UTF-8?q?=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../matching/detail/MatchingDetailRoute.kt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt index a8f3287c..56ff4483 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt @@ -200,6 +200,8 @@ private fun MatchingDetailContent( MatchingDetailState.MatchingDetailPage.ValuePickState -> { ProfileValuePickBody( + nickName = state.nickName, + selfDescription = state.selfDescription, pickCards = state.pickCards, onRefuseClick = onRefuseClick ) @@ -699,6 +701,8 @@ private fun ValueTalkCard( @Composable private fun ProfileValuePickBody( + nickName: String, + selfDescription: String, pickCards: List, onRefuseClick: () -> Unit, modifier: Modifier = Modifier, @@ -742,7 +746,7 @@ private fun ProfileValuePickBody( ValuePickTabRow( tabIndex = tabIndex.intValue, tabTitles = tabTitles, - onTabClick = { tabIndex.intValue = it }, + onTabClick = { tabIndex.intValue = it.toInt() }, ) ValuePickTabContent( @@ -754,8 +758,8 @@ private fun ProfileValuePickBody( } BasicInfoHeader( - nickName = "nickName", - selfDescription = "selfDescription", + nickName = nickName, + selfDescription = selfDescription, onMoreClick = { }, modifier = Modifier .offset { IntOffset(0, connection.headerOffset) } @@ -877,7 +881,7 @@ private fun ValuePickTabRow( tabTitles.forEachIndexed { index, title -> Tab( selected = (tabIndex == index), - onClick = { onTabClick(tabIndex) }, + onClick = { onTabClick(index) }, text = { Text( text = title, @@ -1038,6 +1042,8 @@ private fun ProfileValueTalkBodyPreview() { private fun ProfileValuePickBodyPreview() { PieceTheme { ProfileValuePickBody( + nickName = "nickName", + selfDescription = "selfDescription", pickCards = listOf( ValuePick( category = "음주", @@ -1068,7 +1074,7 @@ private fun ProfileValuePickBodyPreview() { isSimilarToMe = true, ) ), - {}, + onRefuseClick = {}, ) } } From 441d23b26c9fc8840e331daa705e6a066ada68ad Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Wed, 1 Jan 2025 21:49:14 +0900 Subject: [PATCH 5/9] =?UTF-8?q?[PC-217]=20refuse=20->=20decline=20?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../matching/detail/MatchingDetailRoute.kt | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt index 56ff4483..571f5220 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt @@ -71,7 +71,7 @@ internal fun MatchingDetailRoute( onPreviousPageClick = { viewModel.onIntent(MatchingDetailIntent.OnPreviousPageClick) }, onNextPageClick = { viewModel.onIntent(MatchingDetailIntent.OnNextPageClick) }, onMoreClick = { viewModel.onIntent(MatchingDetailIntent.OnMoreClick) }, - onRefuseClick = { }, + onDeclineClick = { }, onAcceptClick = { }, onShowPicturesClick = { }, ) @@ -84,7 +84,7 @@ private fun MatchingDetailScreen( onPreviousPageClick: () -> Unit, onNextPageClick: () -> Unit, onMoreClick: () -> Unit, - onRefuseClick: () -> Unit, + onDeclineClick: () -> Unit, onShowPicturesClick: () -> Unit, onAcceptClick: () -> Unit, modifier: Modifier = Modifier, @@ -108,7 +108,7 @@ private fun MatchingDetailScreen( MatchingDetailContent( state = state, onMoreClick = onMoreClick, - onRefuseClick = onRefuseClick, + onDeclineClick = onDeclineClick, modifier = Modifier .fillMaxSize() .padding(top = topBarHeight, bottom = bottomBarHeight), @@ -168,7 +168,7 @@ private fun BackgroundImage( private fun MatchingDetailContent( state: MatchingDetailState, onMoreClick: () -> Unit, - onRefuseClick: () -> Unit, + onDeclineClick: () -> Unit, modifier: Modifier = Modifier, ) { Box(modifier = modifier.fillMaxSize()) { @@ -203,7 +203,7 @@ private fun MatchingDetailContent( nickName = state.nickName, selfDescription = state.selfDescription, pickCards = state.pickCards, - onRefuseClick = onRefuseClick + onDeclineClick = onDeclineClick ) } } @@ -704,7 +704,7 @@ private fun ProfileValuePickBody( nickName: String, selfDescription: String, pickCards: List, - onRefuseClick: () -> Unit, + onDeclineClick: () -> Unit, modifier: Modifier = Modifier, ) { val density = LocalDensity.current @@ -752,7 +752,7 @@ private fun ProfileValuePickBody( ValuePickTabContent( tabIndex = tabIndex.intValue, pickCards = pickCards, - onRefuseClick = onRefuseClick, + onDeclineClick = onDeclineClick, ) } } @@ -785,27 +785,27 @@ private fun ProfileValuePickBody( private fun ValuePickTabContent( tabIndex: Int, pickCards: List, - onRefuseClick: () -> Unit, + onDeclineClick: () -> Unit, ) { when (tabIndex) { ALL -> { ValuePickCards( pickCards = pickCards, - onRefuseClick = onRefuseClick, + onDeclineClick = onDeclineClick, ) } SAME -> { ValuePickCards( pickCards = pickCards.filter { it.isSimilarToMe }, - onRefuseClick = onRefuseClick, + onDeclineClick = onDeclineClick, ) } DIFFERENT -> { ValuePickCards( pickCards = pickCards.filterNot { it.isSimilarToMe }, - onRefuseClick = onRefuseClick, + onDeclineClick = onDeclineClick, ) } } @@ -818,7 +818,7 @@ const val DIFFERENT = 2 @Composable private fun ValuePickCards( pickCards: List, - onRefuseClick: () -> Unit, + onDeclineClick: () -> Unit, ) { LazyColumn( modifier = Modifier @@ -847,7 +847,7 @@ private fun ValuePickCards( modifier = Modifier .fillMaxWidth() .clickable { - onRefuseClick() + onDeclineClick() }, ) @@ -1074,7 +1074,7 @@ private fun ProfileValuePickBodyPreview() { isSimilarToMe = true, ) ), - onRefuseClick = {}, + onDeclineClick = {}, ) } } From 90aaaf4994c9de4243defcd1dd488e5beff5fccc Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Wed, 1 Jan 2025 22:04:00 +0900 Subject: [PATCH 6/9] =?UTF-8?q?[PC-217]=20=EC=BD=94=ED=8B=80=EB=A6=B0=20?= =?UTF-8?q?=EC=A4=91=EA=B4=84=ED=98=B8=20=EC=BB=A8=EB=B2=A4=EC=85=98=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../matching/detail/MatchingDetailRoute.kt | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt index 571f5220..b3d4666f 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt @@ -173,7 +173,7 @@ private fun MatchingDetailContent( ) { Box(modifier = modifier.fillMaxSize()) { when (state.currentPage) { - MatchingDetailState.MatchingDetailPage.BasicInfoState -> { + MatchingDetailState.MatchingDetailPage.BasicInfoState -> ProfileBasicInfoBody( nickName = state.nickName, selfDescription = state.selfDescription, @@ -187,25 +187,22 @@ private fun MatchingDetailContent( onMoreClick = onMoreClick, modifier = Modifier.padding(horizontal = 20.dp) ) - } - MatchingDetailState.MatchingDetailPage.ValueTalkState -> { + MatchingDetailState.MatchingDetailPage.ValueTalkState -> ProfileValueTalkBody( nickName = state.nickName, selfDescription = state.selfDescription, talkCards = state.talkCards, onMoreClick = onMoreClick ) - } - MatchingDetailState.MatchingDetailPage.ValuePickState -> { + MatchingDetailState.MatchingDetailPage.ValuePickState -> ProfileValuePickBody( nickName = state.nickName, selfDescription = state.selfDescription, pickCards = state.pickCards, onDeclineClick = onDeclineClick ) - } } } } @@ -788,26 +785,23 @@ private fun ValuePickTabContent( onDeclineClick: () -> Unit, ) { when (tabIndex) { - ALL -> { + ALL -> ValuePickCards( pickCards = pickCards, onDeclineClick = onDeclineClick, ) - } - SAME -> { + SAME -> ValuePickCards( pickCards = pickCards.filter { it.isSimilarToMe }, onDeclineClick = onDeclineClick, ) - } - DIFFERENT -> { + DIFFERENT -> ValuePickCards( pickCards = pickCards.filterNot { it.isSimilarToMe }, onDeclineClick = onDeclineClick, ) - } } } From 2ca0adda6ac1af8f20d30957e08eaaa978920cd3 Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Wed, 1 Jan 2025 22:07:15 +0900 Subject: [PATCH 7/9] =?UTF-8?q?[PC-217]=20modifier=20=EC=84=A0=EC=96=B8=20?= =?UTF-8?q?=EC=88=9C=EC=84=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../matching/detail/MatchingDetailRoute.kt | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt index b3d4666f..39c00054 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt @@ -158,8 +158,8 @@ private fun BackgroundImage( Image( painter = painterResource(id = R.drawable.matchingdetail_bg), contentDescription = "basic info 배경화면", - modifier = Modifier.matchParentSize(), contentScale = ContentScale.Crop, + modifier = Modifier.matchParentSize(), ) } } @@ -445,11 +445,11 @@ private fun InfoItem( text: @Composable () -> Unit? = {}, ) { Column( + horizontalAlignment = Alignment.CenterHorizontally, modifier = modifier .clip(RoundedCornerShape(8.dp)) .background(PieceTheme.colors.white) .padding(vertical = 16.dp, horizontal = 12.dp), - horizontalAlignment = Alignment.CenterHorizontally, ) { Text( text = title, @@ -505,8 +505,7 @@ private fun ProfileValueTalkBody( // 4) Box에 nestedScroll(connection)을 달아, 스크롤 이벤트가 // CollapsingHeaderNestedScrollConnection으로 전달되도록 함 Box( - modifier = modifier - .nestedScroll(connection) + modifier = modifier.nestedScroll(connection) ) { // 5) Column: Spacer + LazyColumn을 세로로 배치 // 헤더가 접힐수록 Spacer의 높이가 줄어들고, 그만큼 리스트가 위로 올라옴 @@ -731,8 +730,7 @@ private fun ProfileValuePickBody( ) Box( - modifier = modifier - .nestedScroll(connection) + modifier = modifier.nestedScroll(connection) ) { Column { Spacer(Modifier.height(spaceHeight)) @@ -859,9 +857,6 @@ private fun ValuePickTabRow( TabRow( containerColor = PieceTheme.colors.white, selectedTabIndex = tabIndex, - modifier = Modifier - .fillMaxWidth() - .height(48.dp), indicator = { tabPositions -> if (tabIndex < tabPositions.size) { TabRowDefaults.SecondaryIndicator( @@ -871,6 +866,9 @@ private fun ValuePickTabRow( } }, divider = {}, + modifier = Modifier + .fillMaxWidth() + .height(48.dp), ) { tabTitles.forEachIndexed { index, title -> Tab( @@ -904,8 +902,8 @@ private fun ValuePickCard( ) ) { Row( - modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.fillMaxWidth(), ) { Image( painter = painterResource(id = R.drawable.ic_question), @@ -929,11 +927,11 @@ private fun ValuePickCard( text = "나와 같은", style = PieceTheme.typography.captionM, color = PieceTheme.colors.subDefault, + textAlign = TextAlign.Center, modifier = Modifier .clip(RoundedCornerShape(23.dp)) .background(PieceTheme.colors.subLight) .padding(vertical = 6.dp, horizontal = 12.dp), - textAlign = TextAlign.Center, ) } } @@ -951,8 +949,8 @@ private fun ValuePickCard( PieceSubButton( label = valuePick.option1, onClick = {}, - modifier = Modifier.fillMaxWidth(), enabled = true, + modifier = Modifier.fillMaxWidth(), ) Spacer(modifier = Modifier.height(8.dp)) @@ -960,8 +958,8 @@ private fun ValuePickCard( PieceSubButton( label = valuePick.option2, onClick = {}, - modifier = Modifier.fillMaxWidth(), enabled = false, + modifier = Modifier.fillMaxWidth(), ) } } From bd4797796f5d21d73fed5cedad646fdd7d7b0b51 Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Wed, 1 Jan 2025 22:10:38 +0900 Subject: [PATCH 8/9] =?UTF-8?q?[PC-217]=20eol=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/puzzle/designsystem/component/TopBar.kt | 2 +- .../main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/core/designsystem/src/main/java/com/puzzle/designsystem/component/TopBar.kt b/core/designsystem/src/main/java/com/puzzle/designsystem/component/TopBar.kt index 9c57215b..9d2a064d 100644 --- a/core/designsystem/src/main/java/com/puzzle/designsystem/component/TopBar.kt +++ b/core/designsystem/src/main/java/com/puzzle/designsystem/component/TopBar.kt @@ -204,4 +204,4 @@ fun PreviewPieceSubCloseTopBar() { .padding(vertical = 20.dp), ) } -} \ No newline at end of file +} diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt index 39c00054..e76d4c96 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt @@ -1112,5 +1112,3 @@ private fun BottomNavigationOnValuePickStatePreview() { ) } } - - From 7ab9374dad320754c7282306c7bc99f3da9ab525 Mon Sep 17 00:00:00 2001 From: sksowk156 Date: Thu, 2 Jan 2025 13:06:33 +0900 Subject: [PATCH 9/9] =?UTF-8?q?[PC-217]=20=EC=A4=84=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/drawable/ic_image_default.xml | 50 ++++++++++--------- .../matching/detail/MatchingDetailRoute.kt | 4 +- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/core/designsystem/src/main/res/drawable/ic_image_default.xml b/core/designsystem/src/main/res/drawable/ic_image_default.xml index 50fc3426..cb580b72 100644 --- a/core/designsystem/src/main/res/drawable/ic_image_default.xml +++ b/core/designsystem/src/main/res/drawable/ic_image_default.xml @@ -4,27 +4,31 @@ android:height="120dp" android:viewportWidth="120" android:viewportHeight="120"> - - - - - - - - - - + + + + + + + + + + diff --git a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt index 93e7915f..e618f25c 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/detail/MatchingDetailRoute.kt @@ -178,9 +178,7 @@ private fun MatchingDetailScreen( PieceSubCloseTopBar( title = state.currentPage.title, onCloseClick = onCloseClick, - showCloseButton = if (showDialog && dialogType == DialogType.PROFILE_IMAGE_DETAIL) { - false - } else true, + showCloseButton = !(showDialog && dialogType == DialogType.PROFILE_IMAGE_DETAIL), modifier = Modifier .fillMaxWidth() .height(topBarHeight)