From 0fe93033dd919cbc4834e8e8526dfb32eccd36b5 Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 14:18:41 +0900 Subject: [PATCH 01/13] =?UTF-8?q?feat/#12:=20RoomieKeyword=20=EC=A0=9C?= =?UTF-8?q?=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/RoomieKeyword.kt | 117 ++++++++++++++++++ app/src/main/res/drawable/ic_middle_dot.xml | 9 ++ 2 files changed, 126 insertions(+) create mode 100644 app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt create mode 100644 app/src/main/res/drawable/ic_middle_dot.xml diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt new file mode 100644 index 00000000..15bfb502 --- /dev/null +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt @@ -0,0 +1,117 @@ +package com.wearerommies.roomie.presentation.core.designsystem.component + +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.Row +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +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.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.wearerommies.roomie.R +import com.wearerommies.roomie.ui.theme.RoomieAndroidTheme +import com.wearerommies.roomie.ui.theme.RoomieTheme + +@Composable +fun RoomieTextKeyword( + text: String, + textStyle: TextStyle, + backgroundColor: Color, + modifier: Modifier = Modifier, +) { + Box( + modifier = modifier + .background(color = backgroundColor, shape = RoundedCornerShape(size = 4.dp)) + .padding(horizontal = 8.dp, vertical = 4.dp), + contentAlignment = Alignment.Center + ) { + Text( + text = text, + style = textStyle + ) + } +} + +@Composable +fun RoomieKeyword( + content: @Composable () -> Unit, + backgroundColor: Color, + modifier: Modifier = Modifier, +) { + Box( + modifier = modifier + .background(color = backgroundColor, shape = RoundedCornerShape(size = 4.dp)) + .padding(horizontal = 8.dp, vertical = 4.dp), + contentAlignment = Alignment.Center + ) { + content() + } +} + +@Preview +@Composable +fun RoomieKeywordPreview() { + RoomieAndroidTheme { + Column( + verticalArrangement = Arrangement.spacedBy(space = 4.dp) + ) { + //map keyword + RoomieTextKeyword( + text = "#차분한", + textStyle = RoomieTheme.typography.body4R12.copy( + color = RoomieTheme.colors.grayScale9 + ), + backgroundColor = Color(0xFFF3F1F1) + ) + + //detail keyword + RoomieTextKeyword( + text = "#차분한", + textStyle = RoomieTheme.typography.body3M14.copy( + color = RoomieTheme.colors.primary + ), + backgroundColor = RoomieTheme.colors.primaryLight4 + ) + + //detail keyword + RoomieKeyword( + content = { + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy( + 2.dp, + alignment = Alignment.CenterHorizontally + ) + ) { + Text( + text = "성별", + style = RoomieTheme.typography.body4R12.copy( + color = RoomieTheme.colors.primary + ), + ) + Icon( + painter = painterResource(R.drawable.ic_middle_dot), + contentDescription = "dot" + ) + Text( + text = "n인실", + style = RoomieTheme.typography.body4R12.copy( + color = RoomieTheme.colors.primary + ), + ) + } + }, + backgroundColor = RoomieTheme.colors.primaryLight4 + ) + } + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_middle_dot.xml b/app/src/main/res/drawable/ic_middle_dot.xml new file mode 100644 index 00000000..f003a937 --- /dev/null +++ b/app/src/main/res/drawable/ic_middle_dot.xml @@ -0,0 +1,9 @@ + + + From 78ca95996505b463f4f11495d5550f20fc6db7c8 Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 14:21:52 +0900 Subject: [PATCH 02/13] =?UTF-8?q?feat/#12:=20RoomieKeyword=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/designsystem/component/RoomieKeyword.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt index 15bfb502..3267ddf9 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt @@ -18,6 +18,7 @@ import androidx.compose.ui.text.TextStyle import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.wearerommies.roomie.R +import com.wearerommies.roomie.presentation.core.extension.noRippleClickable import com.wearerommies.roomie.ui.theme.RoomieAndroidTheme import com.wearerommies.roomie.ui.theme.RoomieTheme @@ -27,11 +28,15 @@ fun RoomieTextKeyword( textStyle: TextStyle, backgroundColor: Color, modifier: Modifier = Modifier, + onClick: () -> Unit = {}, ) { Box( modifier = modifier .background(color = backgroundColor, shape = RoundedCornerShape(size = 4.dp)) - .padding(horizontal = 8.dp, vertical = 4.dp), + .padding(horizontal = 8.dp, vertical = 4.dp) + .noRippleClickable { + onClick() + }, contentAlignment = Alignment.Center ) { Text( @@ -46,11 +51,15 @@ fun RoomieKeyword( content: @Composable () -> Unit, backgroundColor: Color, modifier: Modifier = Modifier, + onClick: () -> Unit = {}, ) { Box( modifier = modifier .background(color = backgroundColor, shape = RoundedCornerShape(size = 4.dp)) - .padding(horizontal = 8.dp, vertical = 4.dp), + .padding(horizontal = 8.dp, vertical = 4.dp) + .noRippleClickable { + onClick() + }, contentAlignment = Alignment.Center ) { content() From f9fca0b71b95392ef8fc8995936bebf67cc5c04a Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 14:27:07 +0900 Subject: [PATCH 03/13] =?UTF-8?q?feat/#12:=20RoomieTag=20=EC=A0=9C?= =?UTF-8?q?=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/RoomieKeyword.kt | 2 +- .../core/designsystem/component/RoomieTag.kt | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieTag.kt diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt index 3267ddf9..8422734c 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt @@ -68,7 +68,7 @@ fun RoomieKeyword( @Preview @Composable -fun RoomieKeywordPreview() { +private fun RoomieKeywordPreview() { RoomieAndroidTheme { Column( verticalArrangement = Arrangement.spacedBy(space = 4.dp) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieTag.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieTag.kt new file mode 100644 index 00000000..b56680ca --- /dev/null +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieTag.kt @@ -0,0 +1,55 @@ +package com.wearerommies.roomie.presentation.core.designsystem.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding +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.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.wearerommies.roomie.presentation.core.extension.noRippleClickable +import com.wearerommies.roomie.ui.theme.RoomieAndroidTheme +import com.wearerommies.roomie.ui.theme.RoomieTheme + +@Composable +fun RoomieTag( + text: String, + textStyle: TextStyle, + backgroundColor: Color, + modifier: Modifier = Modifier, + onClick: () -> Unit = {}, +) { + Box( + modifier = modifier + .background(color = backgroundColor, shape = RoundedCornerShape(size = 8.dp)) + .noRippleClickable { + onClick() + } + .padding(horizontal = 8.dp, vertical = 3.dp), + contentAlignment = Alignment.Center + ) { + Text( + text = text, + style = textStyle + ) + } +} + +@Preview +@Composable +private fun RoomieTagPreview() { + RoomieAndroidTheme { + RoomieTag( + text = "입주 완료", + textStyle = RoomieTheme.typography.caption2Sb10.copy( + color = RoomieTheme.colors.primary + ), + backgroundColor = RoomieTheme.colors.primaryLight4 + ) + } +} \ No newline at end of file From 7d31a24b676e796229479c344f60030996eb5387 Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 14:41:40 +0900 Subject: [PATCH 04/13] =?UTF-8?q?feat/#12:=20RoomieRoomAsset=20=EC=A0=9C?= =?UTF-8?q?=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/RoomieRoomAsset.kt | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieRoomAsset.kt diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieRoomAsset.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieRoomAsset.kt new file mode 100644 index 00000000..34b036c0 --- /dev/null +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieRoomAsset.kt @@ -0,0 +1,65 @@ +package com.wearerommies.roomie.presentation.core.designsystem.component + +import androidx.annotation.DrawableRes +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +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.res.painterResource +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.wearerommies.roomie.R +import com.wearerommies.roomie.ui.theme.RoomieAndroidTheme +import com.wearerommies.roomie.ui.theme.RoomieTheme + +@Composable +fun RoomieRoomAsset( + @DrawableRes imageDrawableId: Int, + text: String, + textStyle: TextStyle, + modifier: Modifier = Modifier, +) { + Column( + modifier = modifier + .padding(horizontal = 8.dp), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.spacedBy(2.dp, alignment = Alignment.CenterVertically) + ) { + Image( + painter = painterResource(id = imageDrawableId), + contentDescription = "방 자산", + modifier = Modifier + .size(32.dp) + .clip(CircleShape) + .fillMaxSize() + ) + + Text( + text = text, + style = textStyle + ) + } +} + +@Preview +@Composable +private fun RoomieRoomAssetPreview() { + RoomieAndroidTheme { + RoomieRoomAsset( + imageDrawableId = R.drawable.ic_launcher_background, + text = "책상", + textStyle = RoomieTheme.typography.caption1R10.copy( + color = RoomieTheme.colors.grayScale9 + ) + ) + } +} \ No newline at end of file From 80178c262d4d9a826cb9a9b4294a6f0e9c5ea1d2 Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 14:45:04 +0900 Subject: [PATCH 05/13] =?UTF-8?q?chore/#12:=20RoomieKeyword=20click=20?= =?UTF-8?q?=EC=88=9C=EC=84=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/designsystem/component/RoomieKeyword.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt index 8422734c..5a31c110 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt @@ -33,10 +33,10 @@ fun RoomieTextKeyword( Box( modifier = modifier .background(color = backgroundColor, shape = RoundedCornerShape(size = 4.dp)) - .padding(horizontal = 8.dp, vertical = 4.dp) .noRippleClickable { onClick() - }, + } + .padding(horizontal = 8.dp, vertical = 4.dp), contentAlignment = Alignment.Center ) { Text( @@ -56,10 +56,10 @@ fun RoomieKeyword( Box( modifier = modifier .background(color = backgroundColor, shape = RoundedCornerShape(size = 4.dp)) - .padding(horizontal = 8.dp, vertical = 4.dp) .noRippleClickable { onClick() - }, + } + .padding(horizontal = 8.dp, vertical = 4.dp), contentAlignment = Alignment.Center ) { content() @@ -109,7 +109,8 @@ private fun RoomieKeywordPreview() { ) Icon( painter = painterResource(R.drawable.ic_middle_dot), - contentDescription = "dot" + contentDescription = "dot", + tint = RoomieTheme.colors.primary ) Text( text = "n인실", From bd90638b3506a02b9e88454060a21f40d8396881 Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 14:55:55 +0900 Subject: [PATCH 06/13] =?UTF-8?q?feat/#12:=20RoomieBorderKeyword=20?= =?UTF-8?q?=EC=A0=9C=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/RoomieKeyword.kt | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt index 5a31c110..bc4f087c 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt @@ -1,11 +1,13 @@ package com.wearerommies.roomie.presentation.core.designsystem.component import androidx.compose.foundation.background +import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Icon import androidx.compose.material3.Text @@ -13,6 +15,7 @@ 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.platform.LocalConfiguration import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.tooling.preview.Preview @@ -66,6 +69,33 @@ fun RoomieKeyword( } } +@Composable +fun RoomieBorderKeyword( + text: String, + textStyle: TextStyle, + borderColor: Color, + backgroundColor: Color, + modifier: Modifier = Modifier, + onClick: () -> Unit = {}, +) { + Box( + modifier = modifier + .width((LocalConfiguration.current.screenWidthDp * 0.106).dp) + .border(width = 1.dp, color = borderColor, shape = RoundedCornerShape(size = 4.dp)) + .background(color = backgroundColor, shape = RoundedCornerShape(size = 4.dp)) + .noRippleClickable { + onClick() + } + .padding(horizontal = 6.dp, vertical = 4.dp), + contentAlignment = Alignment.Center + ) { + Text( + text = text, + style = textStyle + ) + } +} + @Preview @Composable private fun RoomieKeywordPreview() { @@ -122,6 +152,25 @@ private fun RoomieKeywordPreview() { }, backgroundColor = RoomieTheme.colors.primaryLight4 ) + + //도로명&지번 키워드 + RoomieBorderKeyword( + text = "도로명", + textStyle = RoomieTheme.typography.caption2Sb10.copy( + color = RoomieTheme.colors.grayScale7 + ), + borderColor = RoomieTheme.colors.grayScale5, + backgroundColor = RoomieTheme.colors.grayScale3, + ) + + RoomieBorderKeyword( + text = "지번", + textStyle = RoomieTheme.typography.caption2Sb10.copy( + color = RoomieTheme.colors.grayScale7 + ), + borderColor = RoomieTheme.colors.grayScale5, + backgroundColor = RoomieTheme.colors.grayScale3, + ) } } } \ No newline at end of file From 1b9b562f3c57ffdc304d5cb05bb4047639fe3222 Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 15:13:09 +0900 Subject: [PATCH 07/13] =?UTF-8?q?move/#12:=20=EA=B3=B5=ED=86=B5=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=ED=8C=A8=ED=82=A4?= =?UTF-8?q?=EC=A7=80=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/{designsystem => }/component/RoomieKeyword.kt | 2 +- .../core/{designsystem => }/component/RoomieRoomAsset.kt | 2 +- .../presentation/core/{designsystem => }/component/RoomieTag.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename app/src/main/java/com/wearerommies/roomie/presentation/core/{designsystem => }/component/RoomieKeyword.kt (98%) rename app/src/main/java/com/wearerommies/roomie/presentation/core/{designsystem => }/component/RoomieRoomAsset.kt (96%) rename app/src/main/java/com/wearerommies/roomie/presentation/core/{designsystem => }/component/RoomieTag.kt (95%) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieKeyword.kt similarity index 98% rename from app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt rename to app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieKeyword.kt index bc4f087c..ab0ee73b 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieKeyword.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieKeyword.kt @@ -1,4 +1,4 @@ -package com.wearerommies.roomie.presentation.core.designsystem.component +package com.wearerommies.roomie.presentation.core.component import androidx.compose.foundation.background import androidx.compose.foundation.border diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieRoomAsset.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt similarity index 96% rename from app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieRoomAsset.kt rename to app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt index 34b036c0..e7ff8fd9 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieRoomAsset.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt @@ -1,4 +1,4 @@ -package com.wearerommies.roomie.presentation.core.designsystem.component +package com.wearerommies.roomie.presentation.core.component import androidx.annotation.DrawableRes import androidx.compose.foundation.Image diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieTag.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt similarity index 95% rename from app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieTag.kt rename to app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt index b56680ca..a21abfd5 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/designsystem/component/RoomieTag.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt @@ -1,4 +1,4 @@ -package com.wearerommies.roomie.presentation.core.designsystem.component +package com.wearerommies.roomie.presentation.core.component import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box From 5c5a7417bc6fa39e283bbbafa29f58b8cc4ad3ce Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 15:37:13 +0900 Subject: [PATCH 08/13] =?UTF-8?q?chore/#12:=20RoomieBorderKeyword=20?= =?UTF-8?q?=EC=9D=BC=EB=B6=80=20=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20?= =?UTF-8?q?=EC=8A=A4=ED=83=80=EC=9D=BC=20=EA=B3=A0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/component/RoomieKeyword.kt | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieKeyword.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieKeyword.kt index ab0ee73b..92cdb07b 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieKeyword.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieKeyword.kt @@ -72,10 +72,12 @@ fun RoomieKeyword( @Composable fun RoomieBorderKeyword( text: String, - textStyle: TextStyle, - borderColor: Color, - backgroundColor: Color, modifier: Modifier = Modifier, + textStyle: TextStyle = RoomieTheme.typography.caption2Sb10.copy( + color = RoomieTheme.colors.grayScale7 + ), + borderColor: Color = RoomieTheme.colors.grayScale5, + backgroundColor: Color = RoomieTheme.colors.grayScale3, onClick: () -> Unit = {}, ) { Box( @@ -156,20 +158,10 @@ private fun RoomieKeywordPreview() { //도로명&지번 키워드 RoomieBorderKeyword( text = "도로명", - textStyle = RoomieTheme.typography.caption2Sb10.copy( - color = RoomieTheme.colors.grayScale7 - ), - borderColor = RoomieTheme.colors.grayScale5, - backgroundColor = RoomieTheme.colors.grayScale3, ) RoomieBorderKeyword( text = "지번", - textStyle = RoomieTheme.typography.caption2Sb10.copy( - color = RoomieTheme.colors.grayScale7 - ), - borderColor = RoomieTheme.colors.grayScale5, - backgroundColor = RoomieTheme.colors.grayScale3, ) } } From 8743a6696ade3601d9b03bf6434043851d7ecb22 Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 23:39:58 +0900 Subject: [PATCH 09/13] =?UTF-8?q?refactor/#12:=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{RoomieKeyword.kt => RoomieChip.kt} | 102 +++++++++--------- .../core/component/RoomieRoomAsset.kt | 12 +-- .../presentation/core/component/RoomieTag.kt | 14 ++- 3 files changed, 61 insertions(+), 67 deletions(-) rename app/src/main/java/com/wearerommies/roomie/presentation/core/component/{RoomieKeyword.kt => RoomieChip.kt} (61%) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieKeyword.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt similarity index 61% rename from app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieKeyword.kt rename to app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt index 92cdb07b..0afeafdc 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieKeyword.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt @@ -26,11 +26,12 @@ import com.wearerommies.roomie.ui.theme.RoomieAndroidTheme import com.wearerommies.roomie.ui.theme.RoomieTheme @Composable -fun RoomieTextKeyword( +fun RoomieTextChip( text: String, - textStyle: TextStyle, - backgroundColor: Color, modifier: Modifier = Modifier, + textStyle: TextStyle = RoomieTheme.typography.body3M14, + textColor: Color = RoomieTheme.colors.primary, + backgroundColor: Color = RoomieTheme.colors.primaryLight4, onClick: () -> Unit = {}, ) { Box( @@ -44,16 +45,20 @@ fun RoomieTextKeyword( ) { Text( text = text, - style = textStyle + style = textStyle, + color = textColor ) } } @Composable -fun RoomieKeyword( - content: @Composable () -> Unit, - backgroundColor: Color, +fun RoomieTextWithDotChip( + firstText: String, + secondText: String, modifier: Modifier = Modifier, + textStyle: TextStyle = RoomieTheme.typography.body4R12, + contentColor: Color = RoomieTheme.colors.primary, + backgroundColor: Color = RoomieTheme.colors.primaryLight4, onClick: () -> Unit = {}, ) { Box( @@ -65,17 +70,38 @@ fun RoomieKeyword( .padding(horizontal = 8.dp, vertical = 4.dp), contentAlignment = Alignment.Center ) { - content() + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy( + 2.dp, + alignment = Alignment.CenterHorizontally + ) + ) { + Text( + text = firstText, + style = textStyle, + color = contentColor + ) + Icon( + painter = painterResource(R.drawable.ic_middle_dot), + contentDescription = "dot", + tint = contentColor + ) + Text( + text = secondText, + style = textStyle, + color = contentColor + ) + } } } @Composable -fun RoomieBorderKeyword( +fun RoomieOutlinedChip( text: String, modifier: Modifier = Modifier, - textStyle: TextStyle = RoomieTheme.typography.caption2Sb10.copy( - color = RoomieTheme.colors.grayScale7 - ), + textStyle: TextStyle = RoomieTheme.typography.caption2Sb10, + textColor: Color = RoomieTheme.colors.grayScale7, borderColor: Color = RoomieTheme.colors.grayScale5, backgroundColor: Color = RoomieTheme.colors.grayScale3, onClick: () -> Unit = {}, @@ -93,7 +119,8 @@ fun RoomieBorderKeyword( ) { Text( text = text, - style = textStyle + style = textStyle, + color = textColor ) } } @@ -106,61 +133,30 @@ private fun RoomieKeywordPreview() { verticalArrangement = Arrangement.spacedBy(space = 4.dp) ) { //map keyword - RoomieTextKeyword( + RoomieTextChip( text = "#차분한", - textStyle = RoomieTheme.typography.body4R12.copy( - color = RoomieTheme.colors.grayScale9 - ), + textStyle = RoomieTheme.typography.body4R12, + textColor = RoomieTheme.colors.grayScale9, backgroundColor = Color(0xFFF3F1F1) ) //detail keyword - RoomieTextKeyword( + RoomieTextChip( text = "#차분한", - textStyle = RoomieTheme.typography.body3M14.copy( - color = RoomieTheme.colors.primary - ), - backgroundColor = RoomieTheme.colors.primaryLight4 ) //detail keyword - RoomieKeyword( - content = { - Row( - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.spacedBy( - 2.dp, - alignment = Alignment.CenterHorizontally - ) - ) { - Text( - text = "성별", - style = RoomieTheme.typography.body4R12.copy( - color = RoomieTheme.colors.primary - ), - ) - Icon( - painter = painterResource(R.drawable.ic_middle_dot), - contentDescription = "dot", - tint = RoomieTheme.colors.primary - ) - Text( - text = "n인실", - style = RoomieTheme.typography.body4R12.copy( - color = RoomieTheme.colors.primary - ), - ) - } - }, - backgroundColor = RoomieTheme.colors.primaryLight4 + RoomieTextWithDotChip( + firstText = "성별", + secondText = "n인실", ) //도로명&지번 키워드 - RoomieBorderKeyword( + RoomieOutlinedChip( text = "도로명", ) - RoomieBorderKeyword( + RoomieOutlinedChip( text = "지번", ) } diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt index e7ff8fd9..2f108295 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt @@ -13,6 +13,7 @@ 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.res.painterResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.tooling.preview.Preview @@ -25,8 +26,9 @@ import com.wearerommies.roomie.ui.theme.RoomieTheme fun RoomieRoomAsset( @DrawableRes imageDrawableId: Int, text: String, - textStyle: TextStyle, modifier: Modifier = Modifier, + textStyle: TextStyle = RoomieTheme.typography.caption1R10, + textColor: Color = RoomieTheme.colors.grayScale9, ) { Column( modifier = modifier @@ -36,7 +38,7 @@ fun RoomieRoomAsset( ) { Image( painter = painterResource(id = imageDrawableId), - contentDescription = "방 자산", + contentDescription = null, modifier = Modifier .size(32.dp) .clip(CircleShape) @@ -45,7 +47,8 @@ fun RoomieRoomAsset( Text( text = text, - style = textStyle + style = textStyle, + color = textColor ) } } @@ -57,9 +60,6 @@ private fun RoomieRoomAssetPreview() { RoomieRoomAsset( imageDrawableId = R.drawable.ic_launcher_background, text = "책상", - textStyle = RoomieTheme.typography.caption1R10.copy( - color = RoomieTheme.colors.grayScale9 - ) ) } } \ No newline at end of file diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt index a21abfd5..2fc6d2be 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt @@ -19,9 +19,10 @@ import com.wearerommies.roomie.ui.theme.RoomieTheme @Composable fun RoomieTag( text: String, - textStyle: TextStyle, - backgroundColor: Color, modifier: Modifier = Modifier, + textStyle: TextStyle = RoomieTheme.typography.caption2Sb10, + textColor: Color = RoomieTheme.colors.primary, + backgroundColor: Color = RoomieTheme.colors.primaryLight4, onClick: () -> Unit = {}, ) { Box( @@ -35,7 +36,8 @@ fun RoomieTag( ) { Text( text = text, - style = textStyle + style = textStyle, + color = textColor ) } } @@ -45,11 +47,7 @@ fun RoomieTag( private fun RoomieTagPreview() { RoomieAndroidTheme { RoomieTag( - text = "입주 완료", - textStyle = RoomieTheme.typography.caption2Sb10.copy( - color = RoomieTheme.colors.primary - ), - backgroundColor = RoomieTheme.colors.primaryLight4 + text = "입주 완료" ) } } \ No newline at end of file From abaef5cbf697d9082e89ade0909e304d8fd31149 Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 23:48:44 +0900 Subject: [PATCH 10/13] =?UTF-8?q?del/#12:=20=EC=9D=BC=EB=B6=80=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20Box=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/core/component/RoomieChip.kt | 41 ++++++++----------- .../presentation/core/component/RoomieTag.kt | 18 ++++---- 2 files changed, 25 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt index 0afeafdc..e7f55ac6 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt @@ -18,6 +18,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.wearerommies.roomie.R @@ -34,21 +35,18 @@ fun RoomieTextChip( backgroundColor: Color = RoomieTheme.colors.primaryLight4, onClick: () -> Unit = {}, ) { - Box( + Text( modifier = modifier .background(color = backgroundColor, shape = RoundedCornerShape(size = 4.dp)) .noRippleClickable { onClick() } .padding(horizontal = 8.dp, vertical = 4.dp), - contentAlignment = Alignment.Center - ) { - Text( - text = text, - style = textStyle, - color = textColor - ) - } + text = text, + style = textStyle, + color = textColor, + textAlign = TextAlign.Center + ) } @Composable @@ -106,7 +104,7 @@ fun RoomieOutlinedChip( backgroundColor: Color = RoomieTheme.colors.grayScale3, onClick: () -> Unit = {}, ) { - Box( + Text( modifier = modifier .width((LocalConfiguration.current.screenWidthDp * 0.106).dp) .border(width = 1.dp, color = borderColor, shape = RoundedCornerShape(size = 4.dp)) @@ -115,24 +113,21 @@ fun RoomieOutlinedChip( onClick() } .padding(horizontal = 6.dp, vertical = 4.dp), - contentAlignment = Alignment.Center - ) { - Text( - text = text, - style = textStyle, - color = textColor - ) - } + text = text, + style = textStyle, + color = textColor, + textAlign = TextAlign.Center + ) } @Preview @Composable -private fun RoomieKeywordPreview() { +private fun RoomieChipPreview() { RoomieAndroidTheme { Column( verticalArrangement = Arrangement.spacedBy(space = 4.dp) ) { - //map keyword + //map 칩 RoomieTextChip( text = "#차분한", textStyle = RoomieTheme.typography.body4R12, @@ -140,18 +135,18 @@ private fun RoomieKeywordPreview() { backgroundColor = Color(0xFFF3F1F1) ) - //detail keyword + //detail 칩 RoomieTextChip( text = "#차분한", ) - //detail keyword + //detail 칩 RoomieTextWithDotChip( firstText = "성별", secondText = "n인실", ) - //도로명&지번 키워드 + //도로명&지번 칩 RoomieOutlinedChip( text = "도로명", ) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt index 2fc6d2be..8acd9e96 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieTag.kt @@ -1,15 +1,14 @@ package com.wearerommies.roomie.presentation.core.component import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding 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.graphics.Color import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.wearerommies.roomie.presentation.core.extension.noRippleClickable @@ -25,21 +24,18 @@ fun RoomieTag( backgroundColor: Color = RoomieTheme.colors.primaryLight4, onClick: () -> Unit = {}, ) { - Box( + Text( modifier = modifier .background(color = backgroundColor, shape = RoundedCornerShape(size = 8.dp)) .noRippleClickable { onClick() } .padding(horizontal = 8.dp, vertical = 3.dp), - contentAlignment = Alignment.Center - ) { - Text( - text = text, - style = textStyle, - color = textColor - ) - } + text = text, + style = textStyle, + color = textColor, + textAlign = TextAlign.Center + ) } @Preview From 56f0a0d75b0a15a45a728280331b0e8884f86cd6 Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Fri, 10 Jan 2025 23:55:10 +0900 Subject: [PATCH 11/13] =?UTF-8?q?del/#12:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roomie/presentation/core/component/RoomieRoomAsset.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt index 2f108295..791e92e1 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieRoomAsset.kt @@ -4,7 +4,6 @@ import androidx.annotation.DrawableRes import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape @@ -42,7 +41,6 @@ fun RoomieRoomAsset( modifier = Modifier .size(32.dp) .clip(CircleShape) - .fillMaxSize() ) Text( From 646ddd78b6dfee5ae254b5a55c7a6406738a90fd Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Sat, 11 Jan 2025 00:05:48 +0900 Subject: [PATCH 12/13] =?UTF-8?q?del/#12:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/core/component/RoomieChip.kt | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt index e7f55ac6..731c2ad3 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt @@ -3,7 +3,6 @@ package com.wearerommies.roomie.presentation.core.component import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.padding @@ -59,38 +58,31 @@ fun RoomieTextWithDotChip( backgroundColor: Color = RoomieTheme.colors.primaryLight4, onClick: () -> Unit = {}, ) { - Box( + Row( modifier = modifier .background(color = backgroundColor, shape = RoundedCornerShape(size = 4.dp)) .noRippleClickable { onClick() } .padding(horizontal = 8.dp, vertical = 4.dp), - contentAlignment = Alignment.Center + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(2.dp, alignment = Alignment.CenterHorizontally), ) { - Row( - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.spacedBy( - 2.dp, - alignment = Alignment.CenterHorizontally - ) - ) { - Text( - text = firstText, - style = textStyle, - color = contentColor - ) - Icon( - painter = painterResource(R.drawable.ic_middle_dot), - contentDescription = "dot", - tint = contentColor - ) - Text( - text = secondText, - style = textStyle, - color = contentColor - ) - } + Text( + text = firstText, + style = textStyle, + color = contentColor + ) + Icon( + painter = painterResource(R.drawable.ic_middle_dot), + contentDescription = "dot", + tint = contentColor + ) + Text( + text = secondText, + style = textStyle, + color = contentColor + ) } } From 5431d03611e95abfa0d78b0c230fc03f880ce482 Mon Sep 17 00:00:00 2001 From: kimsuhyeon Date: Sat, 11 Jan 2025 00:25:36 +0900 Subject: [PATCH 13/13] =?UTF-8?q?feat/#12:=20RoomieHouseNameChip=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/core/component/RoomieChip.kt | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt index 731c2ad3..539b1d99 100644 --- a/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt +++ b/app/src/main/java/com/wearerommies/roomie/presentation/core/component/RoomieChip.kt @@ -112,6 +112,32 @@ fun RoomieOutlinedChip( ) } +@Composable +fun RoomieHouseNameChip( + text: String, + modifier: Modifier = Modifier, + textStyle: TextStyle = RoomieTheme.typography.body6M12, + textColor: Color = RoomieTheme.colors.primary, + borderColor: Color = RoomieTheme.colors.primaryLight2, + backgroundColor: Color = RoomieTheme.colors.primaryLight5, + onClick: () -> Unit = {}, +) { + Text( + modifier = modifier + .width((LocalConfiguration.current.screenWidthDp * 0.275).dp) + .border(width = 1.dp, color = borderColor, shape = RoundedCornerShape(size = 4.dp)) + .background(color = backgroundColor, shape = RoundedCornerShape(size = 4.dp)) + .noRippleClickable { + onClick() + } + .padding(horizontal = 12.dp, vertical = 4.dp), + text = text, + style = textStyle, + color = textColor, + textAlign = TextAlign.Center + ) +} + @Preview @Composable private fun RoomieChipPreview() { @@ -146,6 +172,11 @@ private fun RoomieChipPreview() { RoomieOutlinedChip( text = "지번", ) + + //쉐어하우스 이름 칩 + RoomieHouseNameChip( + text = "쉐어하우스 이름" + ) } } } \ No newline at end of file