From 42fcf012f2b5f8e67af2760cef52e63037880cd1 Mon Sep 17 00:00:00 2001 From: roel Date: Wed, 15 Jan 2025 05:20:58 +0900 Subject: [PATCH 1/8] =?UTF-8?q?[FEAT/#29]=20ic=5Fmenu=5F24=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=EC=BD=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/drawable/ic_menu_24.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/src/main/res/drawable/ic_menu_24.xml diff --git a/app/src/main/res/drawable/ic_menu_24.xml b/app/src/main/res/drawable/ic_menu_24.xml new file mode 100644 index 0000000..7efbe08 --- /dev/null +++ b/app/src/main/res/drawable/ic_menu_24.xml @@ -0,0 +1,15 @@ + + + + + From fe4907563061c9f527b36af46b2ee8e011a18f9f Mon Sep 17 00:00:00 2001 From: roel Date: Wed, 15 Jan 2025 05:22:50 +0900 Subject: [PATCH 2/8] =?UTF-8?q?[FEAT/#29]=20=EC=9E=A5=EC=86=8C=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20Profile=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../placeDetail/component/Profile.kt | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/Profile.kt diff --git a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/Profile.kt b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/Profile.kt new file mode 100644 index 0000000..ec8e6fb --- /dev/null +++ b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/Profile.kt @@ -0,0 +1,98 @@ +package com.spoony.spoony.presentation.placeDetail.component + +import androidx.compose.foundation.background +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.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import coil.compose.AsyncImage +import coil.request.ImageRequest +import com.spoony.spoony.R +import com.spoony.spoony.core.designsystem.theme.SpoonyAndroidTheme +import com.spoony.spoony.core.util.extension.noRippleClickable + +@Composable +fun Profile( + imageUrl: String, + name: String, + location: String, + onClick: () -> Unit, + modifier: Modifier = Modifier +) { + val context = LocalContext.current + + Row( + modifier = modifier + .fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(14.dp) + ) { + AsyncImage( + model = ImageRequest.Builder(context) + .data(imageUrl) + .crossfade(true) + .build(), + modifier = Modifier + .size(48.dp) + .clip(CircleShape) + .background( + color = SpoonyAndroidTheme.colors.gray500, + shape = CircleShape + ), + contentScale = ContentScale.Crop, + contentDescription = null + ) + Column( + modifier = Modifier.weight(1f) + ) { + Text( + text = name, + style = SpoonyAndroidTheme.typography.body2b, + color = SpoonyAndroidTheme.colors.black + ) + Spacer(modifier = Modifier.height(4.dp)) + Text( + text = location, + style = SpoonyAndroidTheme.typography.caption1m, + color = SpoonyAndroidTheme.colors.gray400 + ) + } + Icon( + imageVector = ImageVector.vectorResource(id = R.drawable.ic_menu_24), + contentDescription = null, + tint = Color.Unspecified, + modifier = Modifier + .noRippleClickable(onClick) + ) + } +} + +@Preview +@Composable +private fun ProfilePreview() { + SpoonyAndroidTheme { + Profile( + imageUrl = "https://gratisography.com/wp-content/uploads/2024/10/gratisography-cool-cat-800x525.jpg", + name = "클레오가트라", + location = "마포구 수저", + onClick = {} + ) + } +} From b96c63ae42b8cc0500b8f4803c8d97136ec9bff3 Mon Sep 17 00:00:00 2001 From: roel Date: Wed, 15 Jan 2025 13:39:35 +0900 Subject: [PATCH 3/8] =?UTF-8?q?[FEAT/#29]=20Profile=20=3D>=20UserProfileIn?= =?UTF-8?q?fo=20=EB=A1=9C=20=EB=84=A4=EC=9D=B4=EB=B0=8D=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 --- .../component/{Profile.kt => UserProfileInfo.kt} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/{Profile.kt => UserProfileInfo.kt} (97%) diff --git a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/Profile.kt b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt similarity index 97% rename from app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/Profile.kt rename to app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt index ec8e6fb..746a658 100644 --- a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/Profile.kt +++ b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt @@ -29,7 +29,7 @@ import com.spoony.spoony.core.designsystem.theme.SpoonyAndroidTheme import com.spoony.spoony.core.util.extension.noRippleClickable @Composable -fun Profile( +fun UserProfileInfo( imageUrl: String, name: String, location: String, @@ -86,9 +86,9 @@ fun Profile( @Preview @Composable -private fun ProfilePreview() { +private fun UserProfileInfoPreview() { SpoonyAndroidTheme { - Profile( + UserProfileInfo( imageUrl = "https://gratisography.com/wp-content/uploads/2024/10/gratisography-cool-cat-800x525.jpg", name = "클레오가트라", location = "마포구 수저", From 632ba511bf830463fc1e5b2618ebb6be89fd5faa Mon Sep 17 00:00:00 2001 From: roel Date: Wed, 15 Jan 2025 13:42:06 +0900 Subject: [PATCH 4/8] =?UTF-8?q?[FEAT/#29]=20UserProfileInfo=20=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=93=9C=EB=A1=AD=EB=8B=A4=EC=9A=B4=20=EB=A9=94?= =?UTF-8?q?=EB=89=B4=20=EC=95=84=EC=9D=B4=EC=BD=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../placeDetail/component/UserProfileInfo.kt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt index 746a658..f3eb71b 100644 --- a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt +++ b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt @@ -33,7 +33,6 @@ fun UserProfileInfo( imageUrl: String, name: String, location: String, - onClick: () -> Unit, modifier: Modifier = Modifier ) { val context = LocalContext.current @@ -74,13 +73,6 @@ fun UserProfileInfo( color = SpoonyAndroidTheme.colors.gray400 ) } - Icon( - imageVector = ImageVector.vectorResource(id = R.drawable.ic_menu_24), - contentDescription = null, - tint = Color.Unspecified, - modifier = Modifier - .noRippleClickable(onClick) - ) } } @@ -92,7 +84,6 @@ private fun UserProfileInfoPreview() { imageUrl = "https://gratisography.com/wp-content/uploads/2024/10/gratisography-cool-cat-800x525.jpg", name = "클레오가트라", location = "마포구 수저", - onClick = {} ) } } From c4cf4c966c81b0f34d54957a5a82d40471e50834 Mon Sep 17 00:00:00 2001 From: roel Date: Wed, 15 Jan 2025 13:43:35 +0900 Subject: [PATCH 5/8] =?UTF-8?q?[FEAT/#29]=20UserProfileInfo=20=EC=98=81?= =?UTF-8?q?=EC=97=AD=20=EB=B2=94=EC=9C=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/placeDetail/component/UserProfileInfo.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt index f3eb71b..2655ded 100644 --- a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt +++ b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt @@ -38,8 +38,7 @@ fun UserProfileInfo( val context = LocalContext.current Row( - modifier = modifier - .fillMaxWidth(), + modifier = modifier, verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(14.dp) ) { @@ -58,9 +57,7 @@ fun UserProfileInfo( contentScale = ContentScale.Crop, contentDescription = null ) - Column( - modifier = Modifier.weight(1f) - ) { + Column { Text( text = name, style = SpoonyAndroidTheme.typography.body2b, From 293057cf741a583c35fb0f788f267cea326ab065 Mon Sep 17 00:00:00 2001 From: roel Date: Wed, 15 Jan 2025 13:44:18 +0900 Subject: [PATCH 6/8] =?UTF-8?q?[FEAT/#29]=20ktLintFormat=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../placeDetail/component/UserProfileInfo.kt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt index 2655ded..7f5db2b 100644 --- a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt +++ b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt @@ -5,28 +5,21 @@ 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.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape -import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.res.vectorResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import coil.compose.AsyncImage import coil.request.ImageRequest -import com.spoony.spoony.R import com.spoony.spoony.core.designsystem.theme.SpoonyAndroidTheme -import com.spoony.spoony.core.util.extension.noRippleClickable @Composable fun UserProfileInfo( @@ -80,7 +73,7 @@ private fun UserProfileInfoPreview() { UserProfileInfo( imageUrl = "https://gratisography.com/wp-content/uploads/2024/10/gratisography-cool-cat-800x525.jpg", name = "클레오가트라", - location = "마포구 수저", + location = "마포구 수저" ) } } From 71d0ca33bb1b55366d4eeb559c410f844857f957 Mon Sep 17 00:00:00 2001 From: roel Date: Wed, 15 Jan 2025 14:47:12 +0900 Subject: [PATCH 7/8] =?UTF-8?q?[FEAT/#29]=20UserProfileInfo=20maxLines=20?= =?UTF-8?q?=EB=B0=8F=20overflow=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../placeDetail/component/UserProfileInfo.kt | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt index 7f5db2b..136cfc7 100644 --- a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt +++ b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt @@ -5,20 +5,27 @@ 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.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import coil.compose.AsyncImage import coil.request.ImageRequest +import com.spoony.spoony.R import com.spoony.spoony.core.designsystem.theme.SpoonyAndroidTheme @Composable @@ -54,13 +61,17 @@ fun UserProfileInfo( Text( text = name, style = SpoonyAndroidTheme.typography.body2b, - color = SpoonyAndroidTheme.colors.black + color = SpoonyAndroidTheme.colors.black, + maxLines = 1, + overflow = TextOverflow.Ellipsis ) Spacer(modifier = Modifier.height(4.dp)) Text( text = location, style = SpoonyAndroidTheme.typography.caption1m, - color = SpoonyAndroidTheme.colors.gray400 + color = SpoonyAndroidTheme.colors.gray400, + maxLines = 1, + overflow = TextOverflow.Ellipsis ) } } @@ -77,3 +88,27 @@ private fun UserProfileInfoPreview() { ) } } + +@Preview(showBackground = true) +@Composable +private fun UserProfileInfoMenuPreview() { + SpoonyAndroidTheme { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.spacedBy(14.dp), + verticalAlignment = Alignment.CenterVertically + ) { + UserProfileInfo( + imageUrl = "https://gratisography.com/wp-content/uploads/2024/10/gratisography-cool-cat-800x525.jpg", + name = "클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라", + location = "마포구 수저마포구 수저마포구 수저마포구 수저마포구 수저마포구 수저마포구 수저마포구 수저마포구 수저", + modifier = Modifier.weight(1f) + ) + Icon( + imageVector = ImageVector.vectorResource(id = R.drawable.ic_menu_24), + contentDescription = null, + tint = Color.Unspecified + ) + } + } +} From e930c5428e6417e3bbc2810a34d61774a307d3a3 Mon Sep 17 00:00:00 2001 From: roel Date: Wed, 15 Jan 2025 14:56:24 +0900 Subject: [PATCH 8/8] =?UTF-8?q?[FEAT/#29]=20ic=5Fmenu=5F24=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EB=B0=8F=20UserProfileInfoMenuPreview=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../placeDetail/component/UserProfileInfo.kt | 30 ------------------- app/src/main/res/drawable/ic_menu_24.xml | 15 ---------- 2 files changed, 45 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_menu_24.xml diff --git a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt index 136cfc7..bf2f6be 100644 --- a/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt +++ b/app/src/main/java/com/spoony/spoony/presentation/placeDetail/component/UserProfileInfo.kt @@ -5,27 +5,21 @@ 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.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape -import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.res.vectorResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import coil.compose.AsyncImage import coil.request.ImageRequest -import com.spoony.spoony.R import com.spoony.spoony.core.designsystem.theme.SpoonyAndroidTheme @Composable @@ -88,27 +82,3 @@ private fun UserProfileInfoPreview() { ) } } - -@Preview(showBackground = true) -@Composable -private fun UserProfileInfoMenuPreview() { - SpoonyAndroidTheme { - Row( - modifier = Modifier.fillMaxWidth(), - horizontalArrangement = Arrangement.spacedBy(14.dp), - verticalAlignment = Alignment.CenterVertically - ) { - UserProfileInfo( - imageUrl = "https://gratisography.com/wp-content/uploads/2024/10/gratisography-cool-cat-800x525.jpg", - name = "클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라클레오가트라", - location = "마포구 수저마포구 수저마포구 수저마포구 수저마포구 수저마포구 수저마포구 수저마포구 수저마포구 수저", - modifier = Modifier.weight(1f) - ) - Icon( - imageVector = ImageVector.vectorResource(id = R.drawable.ic_menu_24), - contentDescription = null, - tint = Color.Unspecified - ) - } - } -} diff --git a/app/src/main/res/drawable/ic_menu_24.xml b/app/src/main/res/drawable/ic_menu_24.xml deleted file mode 100644 index 7efbe08..0000000 --- a/app/src/main/res/drawable/ic_menu_24.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - -