From a38df65fd6284d22143ca7c3cadf2dd5a5d66364 Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 13:17:16 +0900 Subject: [PATCH 01/38] =?UTF-8?q?[UI]=20#10=20text=20=EA=B0=84=EA=B2=A9=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokitmons/pokit/core/ui/theme/Type.kt | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/Type.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/Type.kt index 309355bf..a93079ee 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/Type.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/Type.kt @@ -13,126 +13,125 @@ data class PokitTypography( fontSize = 24.sp, fontWeight = FontWeight.Bold, lineHeight = 32.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.26).sp ), val title2: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 20.sp, fontWeight = FontWeight.Bold, lineHeight = 28.sp, - letterSpacing = (-3).sp + letterSpacing = (-0.6).sp ), val title3: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 18.sp, fontWeight = FontWeight.Medium, - lineHeight = 24.sp, - letterSpacing = (-1.1).sp + lineHeight = 24.sp ), val body1Bold: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 18.sp, fontWeight = FontWeight.Bold, lineHeight = 24.sp, - letterSpacing = (-3).sp + letterSpacing = (-0.54).sp ), val body1Medium: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 18.sp, fontWeight = FontWeight.Medium, lineHeight = 24.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.54).sp ), val body2Bold: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 16.sp, fontWeight = FontWeight.Bold, lineHeight = 20.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.176).sp ), val body2Medium: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 16.sp, fontWeight = FontWeight.Medium, lineHeight = 20.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.176).sp ), val body3Medium: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 14.sp, fontWeight = FontWeight.Medium, lineHeight = 18.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.154).sp ), val body3Regular: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 14.sp, fontWeight = FontWeight.W400, lineHeight = 24.sp, - letterSpacing = (-3).sp + letterSpacing = (-0.42).sp ), val detail1: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 14.sp, fontWeight = FontWeight.Medium, lineHeight = 20.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.154).sp ), val detail2: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 12.sp, fontWeight = FontWeight.W400, lineHeight = 16.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.132).sp ), val label1SemiBold: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 18.sp, fontWeight = FontWeight.SemiBold, lineHeight = 24.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.2).sp ), val label1Regular: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 18.sp, fontWeight = FontWeight.W400, lineHeight = 24.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.2).sp ), val label2SemiBold: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 16.sp, fontWeight = FontWeight.SemiBold, lineHeight = 20.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.18).sp ), val label2Regular: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 16.sp, fontWeight = FontWeight.W400, lineHeight = 20.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.18).sp ), val label3SemiBold: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, lineHeight = 16.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.154).sp ), val label3Regular: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 14.sp, fontWeight = FontWeight.W400, lineHeight = 16.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.154).sp ), val label4: TextStyle = TextStyle( fontFamily = pretendard, fontSize = 10.sp, fontWeight = FontWeight.W400, lineHeight = 12.sp, - letterSpacing = (-1.1).sp + letterSpacing = (-0.11).sp ), ) From edb20f04e46fa0622fea37951d986e8af31b9778 Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 13:53:25 +0900 Subject: [PATCH 02/38] =?UTF-8?q?[UI]=20#10=20icon=EB=A7=8C=20=EC=A1=B4?= =?UTF-8?q?=EC=9E=AC=ED=95=98=EB=8A=94=20PokitButton=EC=9D=98=20=EC=A2=8C?= =?UTF-8?q?=EC=9A=B0=20=ED=8C=A8=EB=94=A9=EA=B0=92=EC=9D=B4=20=EC=83=81?= =?UTF-8?q?=ED=95=98=20=ED=8C=A8=EB=94=A9=EA=B0=92=EA=B3=BC=20=EB=8F=99?= =?UTF-8?q?=EC=9D=BC=ED=95=B4=EC=A7=80=EB=8F=84=EB=A1=9D=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 --- .../pokit/core/ui/components/atom/button/Preview.kt | 11 +++++++++++ .../container/PokitButtonContainerModifier.kt | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/Preview.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/Preview.kt index d45fda02..78a814b3 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/Preview.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/Preview.kt @@ -63,6 +63,17 @@ fun PokitButtonPreview() { style = style, type = type ) + + PokitButton( + text = null, + icon = PokitButtonIcon(resourceId = R.drawable.icon_24_search, position = PokitButtonIconPosition.LEFT), + onClick = {}, + enable = enable, + size = size, + shape = shape, + style = style, + type = type + ) } } } diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/subcomponents/container/PokitButtonContainerModifier.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/subcomponents/container/PokitButtonContainerModifier.kt index 0417d0f5..958e999b 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/subcomponents/container/PokitButtonContainerModifier.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/subcomponents/container/PokitButtonContainerModifier.kt @@ -142,7 +142,7 @@ private fun getPaddingBySize( textOnlyPadding: Dp, ): PaddingValues { return if (!hasText) { // icon only - PaddingValues(horizontal = iconSidePaddingSize, vertical = verticalPaddingSize) + PaddingValues(all = verticalPaddingSize) } else if (iconPosition == PokitButtonIconPosition.LEFT) { PaddingValues(start = iconSidePaddingSize, top = verticalPaddingSize, bottom = verticalPaddingSize, end = textSidePaddingSize) } else if (iconPosition == PokitButtonIconPosition.RIGHT) { From 1ca33c919ae3507a68a9d6773802999651b5e60e Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 15:02:46 +0900 Subject: [PATCH 03/38] =?UTF-8?q?[UI]=20#10=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD=20CategoryC?= =?UTF-8?q?ard=20->=20PokitList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attributes/CategoryCardState.kt | 5 --- .../PokitList.kt} | 41 +++++++------------ .../{categorycard => pokitlist}/Preview.kt | 23 ++++------- .../pokitlist/attributes/PokitListState.kt | 5 +++ 4 files changed, 29 insertions(+), 45 deletions(-) delete mode 100644 core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/categorycard/attributes/CategoryCardState.kt rename core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/{categorycard/CategoryCard.kt => pokitlist/PokitList.kt} (66%) rename core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/{categorycard => pokitlist}/Preview.kt (62%) create mode 100644 core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/attributes/PokitListState.kt diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/categorycard/attributes/CategoryCardState.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/categorycard/attributes/CategoryCardState.kt deleted file mode 100644 index 67b2fe0c..00000000 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/categorycard/attributes/CategoryCardState.kt +++ /dev/null @@ -1,5 +0,0 @@ -package pokitmons.pokit.core.ui.components.block.categorycard.attributes - -enum class CategoryCardState { - DEFAULT, ACTIVE, DISABLE -} diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/categorycard/CategoryCard.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/PokitList.kt similarity index 66% rename from core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/categorycard/CategoryCard.kt rename to core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/PokitList.kt index 0427ebe3..023ef41d 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/categorycard/CategoryCard.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/PokitList.kt @@ -1,6 +1,5 @@ -package pokitmons.pokit.core.ui.components.block.categorycard +package pokitmons.pokit.core.ui.components.block.pokitlist -import androidx.compose.foundation.Image import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -16,25 +15,22 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.painter.Painter -import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import pokitmons.pokit.core.ui.R -import pokitmons.pokit.core.ui.components.block.categorycard.attributes.CategoryCardState +import pokitmons.pokit.core.ui.components.block.pokitlist.attributes.PokitListState import pokitmons.pokit.core.ui.theme.PokitTheme @Composable -fun CategoryCard( +fun PokitList( item: T, - painter: Painter, title: String, sub: String, onClickKebab: (T) -> Unit, onClickItem: (T) -> Unit, modifier: Modifier = Modifier, - state: CategoryCardState = CategoryCardState.DISABLE, + state: PokitListState = PokitListState.DISABLE, ) { val titleTextColor = getTitleTextColor(state = state) val subTextColor = getSubTextColor(state = state) @@ -42,20 +38,13 @@ fun CategoryCard( Row( modifier = modifier .clickable( - enabled = state != CategoryCardState.DISABLE, + enabled = state != PokitListState.DISABLE, onClick = { onClickItem(item) } ) .padding(horizontal = 20.dp, vertical = 12.dp), verticalAlignment = Alignment.CenterVertically ) { - Image( - painter = painter, - contentDescription = null, - modifier = Modifier.size(60.dp), - contentScale = ContentScale.Crop - ) - - Spacer(modifier = Modifier.width(12.dp)) + Spacer(modifier = Modifier.width(8.dp)) Column( modifier = Modifier.weight(1f) @@ -79,7 +68,7 @@ fun CategoryCard( modifier = Modifier .padding(0.dp) .align(Alignment.Top), - enabled = state != CategoryCardState.DISABLE + enabled = state != PokitListState.DISABLE ) { Icon( painter = painterResource(id = R.drawable.icon_24_kebab), @@ -92,22 +81,22 @@ fun CategoryCard( @Composable private fun getTitleTextColor( - state: CategoryCardState, + state: PokitListState, ): Color { return when (state) { - CategoryCardState.DEFAULT -> PokitTheme.colors.textPrimary - CategoryCardState.ACTIVE -> PokitTheme.colors.textPrimary - CategoryCardState.DISABLE -> PokitTheme.colors.textDisable + PokitListState.DEFAULT -> PokitTheme.colors.textPrimary + PokitListState.ACTIVE -> PokitTheme.colors.textPrimary + PokitListState.DISABLE -> PokitTheme.colors.textDisable } } @Composable private fun getSubTextColor( - state: CategoryCardState, + state: PokitListState, ): Color { return when (state) { - CategoryCardState.DEFAULT -> PokitTheme.colors.textTertiary - CategoryCardState.ACTIVE -> PokitTheme.colors.textTertiary - CategoryCardState.DISABLE -> PokitTheme.colors.textDisable + PokitListState.DEFAULT -> PokitTheme.colors.textTertiary + PokitListState.ACTIVE -> PokitTheme.colors.textTertiary + PokitListState.DISABLE -> PokitTheme.colors.textDisable } } diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/categorycard/Preview.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/Preview.kt similarity index 62% rename from core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/categorycard/Preview.kt rename to core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/Preview.kt index dc92f7e6..74807d79 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/categorycard/Preview.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/Preview.kt @@ -1,49 +1,44 @@ -package pokitmons.pokit.core.ui.components.block.categorycard +package pokitmons.pokit.core.ui.components.block.pokitlist import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import pokitmons.pokit.core.ui.R -import pokitmons.pokit.core.ui.components.block.categorycard.attributes.CategoryCardState +import pokitmons.pokit.core.ui.components.block.pokitlist.attributes.PokitListState import pokitmons.pokit.core.ui.theme.PokitTheme @Preview(showBackground = true) @Composable -fun CategoryCardPreview() { +fun PokitListPreview() { PokitTheme { Column( modifier = Modifier.fillMaxSize(), verticalArrangement = Arrangement.spacedBy(8.dp) ) { - CategoryCard( - state = CategoryCardState.DISABLE, + PokitList( + state = PokitListState.DISABLE, item = "STRING", - painter = painterResource(id = R.drawable.icon_24_star), title = "카테고리입니당", sub = "15개 항목", onClickKebab = {}, onClickItem = {} ) - CategoryCard( - state = CategoryCardState.DEFAULT, + PokitList( + state = PokitListState.DEFAULT, item = "STRING", - painter = painterResource(id = R.drawable.icon_24_star), title = "카테고리입니당", sub = "15개 항목", onClickKebab = {}, onClickItem = {} ) - CategoryCard( - state = CategoryCardState.ACTIVE, + PokitList( + state = PokitListState.ACTIVE, item = "STRING", - painter = painterResource(id = R.drawable.icon_24_star), title = "카테고리입니당", sub = "15개 항목", onClickKebab = {}, diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/attributes/PokitListState.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/attributes/PokitListState.kt new file mode 100644 index 00000000..aab7815d --- /dev/null +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/attributes/PokitListState.kt @@ -0,0 +1,5 @@ +package pokitmons.pokit.core.ui.components.block.pokitlist.attributes + +enum class PokitListState { + DEFAULT, ACTIVE, DISABLE +} From 2d8c3f831ba852b9e7887ec90f46c2baa2dd77b0 Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 15:46:47 +0900 Subject: [PATCH 04/38] =?UTF-8?q?[FEATURE]=20#10=20PokitCard=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/block/pokitcard/PokitCard.kt | 100 ++++++++++++++++++ .../ui/components/block/pokitcard/Preview.kt | 48 +++++++++ core/ui/src/main/res/values/string.xml | 4 + 3 files changed, 152 insertions(+) create mode 100644 core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/PokitCard.kt create mode 100644 core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/Preview.kt create mode 100644 core/ui/src/main/res/values/string.xml diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/PokitCard.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/PokitCard.kt new file mode 100644 index 00000000..925f8f9b --- /dev/null +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/PokitCard.kt @@ -0,0 +1,100 @@ +package pokitmons.pokit.core.ui.components.block.pokitcard + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.painter.Painter +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import pokitmons.pokit.core.ui.R +import pokitmons.pokit.core.ui.theme.PokitTheme + +@Composable +fun PokitCard( + text: String, + linkCount: Int, + painter: Painter?, + onClick: () -> Unit, + onClickKebab: () -> Unit, + modifier: Modifier = Modifier, +) { + Column( + modifier = modifier + .clip( + shape = RoundedCornerShape(8.dp) + ) + .background( + color = PokitTheme.colors.backgroundBase, + shape = RoundedCornerShape(8.dp) + ) + .clickable(onClick = onClick) + .padding(all = 12.dp) + ) { + Row( + modifier = Modifier.fillMaxWidth(), + ) { + Text( + modifier = Modifier.weight(1f), + text = text, + style = PokitTheme.typography.body1Bold.copy(color = PokitTheme.colors.textPrimary), + maxLines = 2 + ) + + IconButton( + onClick = onClickKebab, + modifier = Modifier + .size(24.dp) + .align(Alignment.Top) + ) { + Icon( + painter = painterResource(id = R.drawable.icon_24_kebab), + contentDescription = null, + modifier = Modifier.size(24.dp) + ) + } + } + + Spacer(modifier = Modifier.height(4.dp)) + + Text( + text = stringResource(id = R.string.pokit_count_format, linkCount), + style = PokitTheme.typography.detail2.copy(color = PokitTheme.colors.textTertiary) + ) + + Spacer(modifier = Modifier.height(18.dp)) + + Row( + modifier = Modifier + .height(68.dp) + .fillMaxWidth(1f), + horizontalArrangement = Arrangement.End, + ) { + if (painter != null) { + Image( + modifier = Modifier.size(68.dp), + contentScale = ContentScale.Crop, + painter = painter, + contentDescription = null + ) + } + } + } +} diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/Preview.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/Preview.kt new file mode 100644 index 00000000..81cf5c36 --- /dev/null +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/Preview.kt @@ -0,0 +1,48 @@ +package pokitmons.pokit.core.ui.components.block.pokitcard + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import pokitmons.pokit.core.ui.R +import pokitmons.pokit.core.ui.theme.PokitTheme + +@Preview(showBackground = true) +@Composable +fun PokitardPreview() { + PokitTheme { + Column( + modifier = Modifier.fillMaxSize(), + verticalArrangement = Arrangement.spacedBy(8.dp) + ) { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.spacedBy(8.dp) + ) { + PokitCard( + modifier = Modifier.weight(1f), + text = "요리/레시피", + linkCount = 10, + painter = null, + onClick = { }, + onClickKebab = { } + ) + + PokitCard( + modifier = Modifier.weight(1f), + text = "요리/레시피", + linkCount = 5, + painter = painterResource(id = R.drawable.icon_24_google), + onClick = { }, + onClickKebab = { } + ) + } + } + } +} diff --git a/core/ui/src/main/res/values/string.xml b/core/ui/src/main/res/values/string.xml new file mode 100644 index 00000000..729e26c0 --- /dev/null +++ b/core/ui/src/main/res/values/string.xml @@ -0,0 +1,4 @@ + + + 링크 %d개 + \ No newline at end of file From 6a8c13924957067a880ac55fa11db2bbba75675b Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 15:51:41 +0900 Subject: [PATCH 05/38] =?UTF-8?q?[UI]=20#10=20LinkCard=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=A6=90?= =?UTF-8?q?=EA=B2=A8=EC=B0=BE=EA=B8=B0=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20?= =?UTF-8?q?=EC=95=88=EC=9D=BD=EC=9D=8C=20=ED=91=9C=EC=8B=9C=20UI=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/components/block/linkcard/LinkCard.kt | 88 +++++++------------ .../ui/components/block/linkcard/Preview.kt | 3 +- core/ui/src/main/res/values/string.xml | 1 + 3 files changed, 36 insertions(+), 56 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/linkcard/LinkCard.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/linkcard/LinkCard.kt index ca3ec0fa..b564f307 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/linkcard/LinkCard.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/linkcard/LinkCard.kt @@ -13,26 +13,22 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.heightIn -import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import androidx.compose.ui.zIndex import pokitmons.pokit.core.ui.R import pokitmons.pokit.core.ui.theme.PokitTheme @@ -42,32 +38,13 @@ fun LinkCard( title: String, sub: String, painter: Painter, - indicatorVisible: Boolean, - bookmarked: Boolean, + notRead: Boolean, badgeText: String, onClickKebab: (T) -> Unit, onClickItem: (T) -> Unit, modifier: Modifier = Modifier, ) { Box(modifier = modifier) { - if (indicatorVisible) { - Box( - modifier = Modifier - .size(16.dp) - .offset((-6).dp, (-6).dp) - .background( - color = PokitTheme.colors.brand, - shape = CircleShape - ) - .border( - color = PokitTheme.colors.inverseWh, - width = 2.dp, - shape = CircleShape - ) - .zIndex(1f) - ) - } - Row( modifier = Modifier .clip(RoundedCornerShape(8.dp)) @@ -87,26 +64,6 @@ fun LinkCard( .background(Color.Gray), contentScale = ContentScale.Crop ) - - if (bookmarked) { - Box( - modifier = Modifier - .size(24.dp) - .align(Alignment.BottomEnd) - .offset(x = (-8).dp, y = (-8).dp) - .background( - color = PokitTheme.colors.backgroundBaseIcon, - shape = CircleShape - ), - contentAlignment = Alignment.Center - ) { - Image( - painter = painterResource(id = R.drawable.icon_24_star), - contentDescription = null, - colorFilter = ColorFilter.tint(PokitTheme.colors.brand) - ) - } - } } Spacer(modifier = Modifier.width(12.dp)) @@ -153,16 +110,39 @@ fun LinkCard( Spacer(modifier = Modifier.height(4.dp)) - Text( - text = badgeText, - modifier = Modifier - .background( - color = PokitTheme.colors.backgroundPrimary, - shape = RoundedCornerShape(4.dp) + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.spacedBy(6.dp) + ) { + Text( + text = badgeText, + modifier = Modifier + .background( + color = PokitTheme.colors.backgroundPrimary, + shape = RoundedCornerShape(4.dp) + ) + .padding(horizontal = 8.dp, vertical = 4.dp), + style = PokitTheme.typography.label4.copy(color = PokitTheme.colors.textTertiary) + ) + + if (notRead) { + Text( + text = stringResource(id = R.string.not_read), + modifier = Modifier + .border( + width = 1.dp, + color = PokitTheme.colors.borderTertiary, + shape = RoundedCornerShape(4.dp) + ) + .background( + color = PokitTheme.colors.backgroundBase, + shape = RoundedCornerShape(4.dp) + ) + .padding(horizontal = 8.dp, vertical = 4.dp), + style = PokitTheme.typography.label4.copy(color = PokitTheme.colors.textTertiary) ) - .padding(horizontal = 8.dp, vertical = 4.dp), - style = PokitTheme.typography.label4.copy(color = PokitTheme.colors.textTertiary) - ) + } + } } } } diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/linkcard/Preview.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/linkcard/Preview.kt index f3b91893..030a2395 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/linkcard/Preview.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/linkcard/Preview.kt @@ -28,8 +28,7 @@ fun LinkCardPreview() { sub = "2024.06.25. youtube.com", badgeText = "텍스트", painter = painterResource(id = R.drawable.icon_24_link), - indicatorVisible = true, - bookmarked = true, + notRead = true, item = 3, onClickKebab = { value: Int -> }, onClickItem = { value: Int -> } diff --git a/core/ui/src/main/res/values/string.xml b/core/ui/src/main/res/values/string.xml index 729e26c0..3e0864d8 100644 --- a/core/ui/src/main/res/values/string.xml +++ b/core/ui/src/main/res/values/string.xml @@ -1,4 +1,5 @@ + 안읽음 링크 %d개 \ No newline at end of file From e16bb54699131a18caa6f9634014d75d732f1e56 Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 15:57:39 +0900 Subject: [PATCH 06/38] =?UTF-8?q?[UI]=20#10=20LabeledInput=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EA=B8=80=EC=9E=90=EC=88=98=20=ED=91=9C=EC=8B=9C=20?= =?UTF-8?q?=EB=B6=80=EB=B6=84=EC=9D=84=20=EC=84=A0=ED=83=9D=20=EA=B0=80?= =?UTF-8?q?=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/block/labeledinput/LabeledInput.kt | 14 ++++++++------ .../ui/components/block/labeledinput/Preview.kt | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/labeledinput/LabeledInput.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/labeledinput/LabeledInput.kt index a7c41d1f..76934443 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/labeledinput/LabeledInput.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/labeledinput/LabeledInput.kt @@ -28,12 +28,12 @@ import pokitmons.pokit.core.ui.theme.PokitTheme @Composable fun LabeledInput( label: String, - sub: String, - maxLength: Int, inputText: String, hintText: String, onChangeText: (String) -> Unit, modifier: Modifier = Modifier, + sub: String = "", + maxLength: Int? = null, readOnly: Boolean = false, enable: Boolean = true, isError: Boolean = false, @@ -97,10 +97,12 @@ fun LabeledInput( Spacer(modifier = Modifier.weight(1f)) - Text( - text = "${inputText.length}/$maxLength", - style = PokitTheme.typography.detail1.copy(color = subTextColor) - ) + if (maxLength != null) { + Text( + text = "${inputText.length}/$maxLength", + style = PokitTheme.typography.detail1.copy(color = subTextColor) + ) + } } } } diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/labeledinput/Preview.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/labeledinput/Preview.kt index 514045c6..ee2620dc 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/labeledinput/Preview.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/labeledinput/Preview.kt @@ -27,6 +27,7 @@ fun PokitInputPreview() { ) { enumValues().forEach { state -> LabeledInput(label = "Label", sub = "내용을 입력해주세요", maxLength = 10, inputText = "으앙", hintText = "내용을 입력해주세요", onChangeText = {}) + LabeledInput(label = "Label", sub = "", maxLength = null, inputText = "으앙", hintText = "내용을 입력해주세요", onChangeText = {}) } } } From 7adf5ccbf59758a27c2018b775a1134541426091 Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 17:15:21 +0900 Subject: [PATCH 07/38] =?UTF-8?q?[UI]=20#10=20PokitButton=20Large=20?= =?UTF-8?q?=EC=82=AC=EC=9D=B4=EC=A6=88=EC=9D=98=20=EB=86=92=EC=9D=B4=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../subcomponents/container/PokitButtonContainerModifier.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/subcomponents/container/PokitButtonContainerModifier.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/subcomponents/container/PokitButtonContainerModifier.kt index 958e999b..320ad4fe 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/subcomponents/container/PokitButtonContainerModifier.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/subcomponents/container/PokitButtonContainerModifier.kt @@ -124,7 +124,7 @@ private fun getPadding( getPaddingBySize( hasText = hasText, iconPosition = iconPosition, - verticalPaddingSize = 12.dp, + verticalPaddingSize = 13.dp, textSidePaddingSize = 24.dp, iconSidePaddingSize = 20.dp, textOnlyPadding = 20.dp From 6af1a87d6e5e5a418d6c6138ef6764e189516d75 Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 17:51:40 +0900 Subject: [PATCH 08/38] =?UTF-8?q?[UI]=20#10=20typography=EC=9D=98=20?= =?UTF-8?q?=EA=B8=80=EC=9E=90=20=ED=81=AC=EA=B8=B0=EB=A5=BC=20sp=EC=97=90?= =?UTF-8?q?=EC=84=9C=20dp=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokitmons/pokit/core/ui/theme/Type.kt | 168 ++++++++++-------- .../core/ui/theme/typography/PokitTypo.kt | 55 ++++++ 2 files changed, 149 insertions(+), 74 deletions(-) create mode 100644 core/ui/src/main/java/pokitmons/pokit/core/ui/theme/typography/PokitTypo.kt diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/Type.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/Type.kt index a93079ee..6a178ce2 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/Type.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/Type.kt @@ -1,138 +1,158 @@ package pokitmons.pokit.core.ui.theme +import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.unit.sp +import pokitmons.pokit.core.ui.theme.typography.PokitTypo @Immutable data class PokitTypography( - val title1: TextStyle = TextStyle( + private val _title1: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 24.sp, + fontSize = 24, fontWeight = FontWeight.Bold, - lineHeight = 32.sp, - letterSpacing = (-0.26).sp + lineHeight = 32, + letterSpacing = (-0.26f) ), - val title2: TextStyle = TextStyle( + private val _title2: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 20.sp, + fontSize = 20, fontWeight = FontWeight.Bold, - lineHeight = 28.sp, - letterSpacing = (-0.6).sp + lineHeight = 28, + letterSpacing = (-0.6f) ), - val title3: TextStyle = TextStyle( + private val _title3: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 18.sp, + fontSize = 18, fontWeight = FontWeight.Medium, - lineHeight = 24.sp + lineHeight = 24 ), - val body1Bold: TextStyle = TextStyle( + private val _body1Bold: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 18.sp, + fontSize = 18, fontWeight = FontWeight.Bold, - lineHeight = 24.sp, - letterSpacing = (-0.54).sp + lineHeight = 24, + letterSpacing = (-0.54f) ), - val body1Medium: TextStyle = TextStyle( + private val _body1Medium: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 18.sp, + fontSize = 18, fontWeight = FontWeight.Medium, - lineHeight = 24.sp, - letterSpacing = (-0.54).sp + lineHeight = 24, + letterSpacing = (-0.54f) ), - val body2Bold: TextStyle = TextStyle( + private val _body2Bold: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 16.sp, + fontSize = 16, fontWeight = FontWeight.Bold, - lineHeight = 20.sp, - letterSpacing = (-0.176).sp + lineHeight = 20, + letterSpacing = (-0.176f) ), - val body2Medium: TextStyle = TextStyle( + private val _body2Medium: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 16.sp, + fontSize = 16, fontWeight = FontWeight.Medium, - lineHeight = 20.sp, - letterSpacing = (-0.176).sp + lineHeight = 20, + letterSpacing = (-0.176f) ), - val body3Medium: TextStyle = TextStyle( + private val _body3Medium: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 14.sp, + fontSize = 14, fontWeight = FontWeight.Medium, - lineHeight = 18.sp, - letterSpacing = (-0.154).sp + lineHeight = 18, + letterSpacing = (-0.154f) ), - val body3Regular: TextStyle = TextStyle( + private val _body3Regular: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 14.sp, + fontSize = 14, fontWeight = FontWeight.W400, - lineHeight = 24.sp, - letterSpacing = (-0.42).sp + lineHeight = 24, + letterSpacing = (-0.42f) ), - val detail1: TextStyle = TextStyle( + private val _detail1: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 14.sp, + fontSize = 14, fontWeight = FontWeight.Medium, - lineHeight = 20.sp, - letterSpacing = (-0.154).sp + lineHeight = 20, + letterSpacing = (-0.154f) ), - val detail2: TextStyle = TextStyle( + private val _detail2: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 12.sp, + fontSize = 12, fontWeight = FontWeight.W400, - lineHeight = 16.sp, - letterSpacing = (-0.132).sp + lineHeight = 16, + letterSpacing = (-0.132f) ), - val label1SemiBold: TextStyle = TextStyle( + private val _label1SemiBold: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 18.sp, + fontSize = 18, fontWeight = FontWeight.SemiBold, - lineHeight = 24.sp, - letterSpacing = (-0.2).sp + lineHeight = 24, + letterSpacing = (-0.2f) ), - val label1Regular: TextStyle = TextStyle( + private val _label1Regular: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 18.sp, + fontSize = 18, fontWeight = FontWeight.W400, - lineHeight = 24.sp, - letterSpacing = (-0.2).sp + lineHeight = 24, + letterSpacing = (-0.2f) ), - val label2SemiBold: TextStyle = TextStyle( + private val _label2SemiBold: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 16.sp, + fontSize = 16, fontWeight = FontWeight.SemiBold, - lineHeight = 20.sp, - letterSpacing = (-0.18).sp + lineHeight = 20, + letterSpacing = (-0.18f) ), - val label2Regular: TextStyle = TextStyle( + private val _label2Regular: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 16.sp, + fontSize = 16, fontWeight = FontWeight.W400, - lineHeight = 20.sp, - letterSpacing = (-0.18).sp + lineHeight = 20, + letterSpacing = (-0.18f) ), - val label3SemiBold: TextStyle = TextStyle( + private val _label3SemiBold: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 14.sp, + fontSize = 14, fontWeight = FontWeight.SemiBold, - lineHeight = 16.sp, - letterSpacing = (-0.154).sp + lineHeight = 16, + letterSpacing = (-0.154f) ), - val label3Regular: TextStyle = TextStyle( + private val _label3Regular: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 14.sp, + fontSize = 14, fontWeight = FontWeight.W400, - lineHeight = 16.sp, - letterSpacing = (-0.154).sp + lineHeight = 16, + letterSpacing = (-0.154f) ), - val label4: TextStyle = TextStyle( + private val _label4: PokitTypo = PokitTypo( fontFamily = pretendard, - fontSize = 10.sp, + fontSize = 10, fontWeight = FontWeight.W400, - lineHeight = 12.sp, - letterSpacing = (-0.11).sp - ), -) + lineHeight = 12, + letterSpacing = (-0.11f) + ), +) { + val title1: TextStyle @Composable get() = _title1.toDpTextStyle + val title2: TextStyle @Composable get() = _title2.toDpTextStyle + val title3: TextStyle @Composable get() = _title3.toDpTextStyle + val body1Bold: TextStyle @Composable get() = _body1Bold.toDpTextStyle + val body1Medium: TextStyle @Composable get() = _body1Medium.toDpTextStyle + val body2Bold: TextStyle @Composable get() = _body2Bold.toDpTextStyle + val body2Medium: TextStyle @Composable get() = _body2Medium.toDpTextStyle + val body3Medium: TextStyle @Composable get() = _body3Medium.toDpTextStyle + val body3Regular: TextStyle @Composable get() = _body3Regular.toDpTextStyle + val detail1: TextStyle @Composable get() = _detail1.toDpTextStyle + val detail2: TextStyle @Composable get() = _detail2.toDpTextStyle + val label1SemiBold: TextStyle @Composable get() = _label1SemiBold.toDpTextStyle + val label1Regular: TextStyle @Composable get() = _label1Regular.toDpTextStyle + val label2SemiBold: TextStyle @Composable get() = _label2SemiBold.toDpTextStyle + val label2Regular: TextStyle @Composable get() = _label2Regular.toDpTextStyle + val label3SemiBold: TextStyle @Composable get() = _label3SemiBold.toDpTextStyle + val label3Regular: TextStyle @Composable get() = _label3Regular.toDpTextStyle + val label4: TextStyle @Composable get() = _label4.toDpTextStyle +} internal val LocalPokitTypography = staticCompositionLocalOf { PokitTypography() } diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/typography/PokitTypo.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/typography/PokitTypo.kt new file mode 100644 index 00000000..bdca7aba --- /dev/null +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/theme/typography/PokitTypo.kt @@ -0,0 +1,55 @@ +package pokitmons.pokit.core.ui.theme.typography + +import androidx.compose.runtime.Composable +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.Density +import androidx.compose.ui.unit.TextUnit +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp + +data class PokitTypo( + val fontWeight: FontWeight, + val fontFamily: FontFamily, + val fontSize: Int, + val lineHeight: Int, + val letterSpacing: Float = 0f, +) { + val toDpTextStyle: TextStyle + @Composable get() = + TextStyle( + fontWeight = fontWeight, + fontFamily = fontFamily, + fontSize = fontSize.textDp, + letterSpacing = letterSpacing.textDp, + lineHeight = lineHeight.textDp + ) + + val toSpTextStyle: TextStyle + @Composable get() = + TextStyle( + fontWeight = fontWeight, + fontFamily = fontFamily, + fontSize = fontSize.sp, + letterSpacing = letterSpacing.sp, + lineHeight = lineHeight.sp + ) +} + +private fun Int.textDp(density: Density): TextUnit = + with(density) { + this@textDp.dp.toSp() + } + +private val Int.textDp: TextUnit + @Composable get() = this.textDp(density = LocalDensity.current) + +private fun Float.textDp(density: Density): TextUnit = + with(density) { + this@textDp.dp.toSp() + } + +private val Float.textDp: TextUnit + @Composable get() = this.textDp(density = LocalDensity.current) From 5fa267b4e2363242935a86fb324e7a8943093a22 Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 21:12:52 +0900 Subject: [PATCH 09/38] =?UTF-8?q?[UI]=20#10=20PokitBottomSheet=EA=B0=80=20?= =?UTF-8?q?=EC=8B=9C=EC=8A=A4=ED=85=9C=20navigation=20bar=EC=98=81?= =?UTF-8?q?=EC=97=AD=EC=97=90=20=EA=B2=B9=EC=B3=90=EB=B3=B4=EC=9D=B4?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/bottomsheet/PokitBottomSheet.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/template/bottomsheet/PokitBottomSheet.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/template/bottomsheet/PokitBottomSheet.kt index 3781095a..1a2ce82b 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/template/bottomsheet/PokitBottomSheet.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/template/bottomsheet/PokitBottomSheet.kt @@ -4,9 +4,13 @@ import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ColumnScope +import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.navigationBarsIgnoringVisibility import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.windowInsetsBottomHeight import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ModalBottomSheet @@ -18,7 +22,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import pokitmons.pokit.core.ui.theme.PokitTheme -@OptIn(ExperimentalMaterial3Api::class) +@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class) @Composable fun PokitBottomSheet( onHideBottomSheet: () -> Unit, @@ -49,5 +53,11 @@ fun PokitBottomSheet( } ) { content() + + Spacer( + Modifier.windowInsetsBottomHeight( + WindowInsets.navigationBarsIgnoringVisibility + ) + ) } } From d71a7a9003a74986526c941f7fae70d402b83b92 Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 21:13:49 +0900 Subject: [PATCH 10/38] =?UTF-8?q?[UI]=20#10=20ktlintFormat=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokit/core/ui/components/block/pokitcard/PokitCard.kt | 4 ++-- .../pokit/core/ui/components/block/pokitcard/Preview.kt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/PokitCard.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/PokitCard.kt index 925f8f9b..8129a062 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/PokitCard.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/PokitCard.kt @@ -49,7 +49,7 @@ fun PokitCard( .padding(all = 12.dp) ) { Row( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier.fillMaxWidth() ) { Text( modifier = Modifier.weight(1f), @@ -85,7 +85,7 @@ fun PokitCard( modifier = Modifier .height(68.dp) .fillMaxWidth(1f), - horizontalArrangement = Arrangement.End, + horizontalArrangement = Arrangement.End ) { if (painter != null) { Image( diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/Preview.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/Preview.kt index 81cf5c36..0720267d 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/Preview.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitcard/Preview.kt @@ -30,8 +30,8 @@ fun PokitardPreview() { text = "요리/레시피", linkCount = 10, painter = null, - onClick = { }, - onClickKebab = { } + onClick = { }, + onClickKebab = { } ) PokitCard( @@ -39,8 +39,8 @@ fun PokitardPreview() { text = "요리/레시피", linkCount = 5, painter = painterResource(id = R.drawable.icon_24_google), - onClick = { }, - onClickKebab = { } + onClick = { }, + onClickKebab = { } ) } } From ed571d7f35c020b5cb07ec922d6cbd002dd7f573 Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 21:27:57 +0900 Subject: [PATCH 11/38] =?UTF-8?q?[UI]=20#10=20PokitInput=20Default,=20Inpu?= =?UTF-8?q?t=20=EC=83=81=ED=83=9C=EC=9D=BC=20=EC=8B=9C=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20Round=20S?= =?UTF-8?q?hape=EC=9D=BC=20=EB=95=8C=20=EB=86=92=EC=9D=B4=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 --- .../core/ui/components/atom/input/Preview.kt | 6 ++-- .../container/PokitInputContainerModifier.kt | 32 ++++++++++++++----- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/input/Preview.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/input/Preview.kt index 6e6ee806..aa576dba 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/input/Preview.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/input/Preview.kt @@ -35,7 +35,7 @@ fun PokitInputPreview() { enumValues().forEach { iconPosition -> PokitInput( text = "", - hintText = "내용을 입력해주세요.", + hintText = "error:$isError, enabled:$enabled, readOnly:$readOnly", onChangeText = {}, shape = shape, enable = enabled, @@ -45,8 +45,8 @@ fun PokitInputPreview() { ) } PokitInput( - text = "", - hintText = "내용을 입력해주세요.", + text = "val", + hintText = "error:$isError, enabled:$enabled, readOnly:$readOnly", onChangeText = {}, shape = shape, enable = enabled, diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/input/subcomponents/container/PokitInputContainerModifier.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/input/subcomponents/container/PokitInputContainerModifier.kt index ad53e8b8..45987e4b 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/input/subcomponents/container/PokitInputContainerModifier.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/input/subcomponents/container/PokitInputContainerModifier.kt @@ -10,6 +10,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Shape +import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import pokitmons.pokit.core.ui.components.atom.input.attributes.PokitInputIconPosition import pokitmons.pokit.core.ui.components.atom.input.attributes.PokitInputShape @@ -58,21 +59,36 @@ private fun getPadding( shape: PokitInputShape, iconPosition: PokitInputIconPosition?, ): PaddingValues { + val verticalPadding = getVerticalPadding(shape = shape) + return when { shape == PokitInputShape.RECTANGLE -> { - PaddingValues(horizontal = 12.dp, vertical = 12.dp) + PaddingValues(horizontal = 12.dp, vertical = verticalPadding) } shape == PokitInputShape.ROUND && iconPosition == null -> { - PaddingValues(horizontal = 20.dp, vertical = 12.dp) + PaddingValues(horizontal = 20.dp, vertical = verticalPadding) } shape == PokitInputShape.ROUND && iconPosition == PokitInputIconPosition.LEFT -> { - PaddingValues(horizontal = 16.dp, vertical = 12.dp) + PaddingValues(horizontal = 16.dp, vertical = verticalPadding) } else -> { - PaddingValues(start = 20.dp, end = 16.dp, top = 12.dp, bottom = 12.dp) + PaddingValues(start = 20.dp, end = 16.dp, top = verticalPadding, bottom = verticalPadding) + } + } +} + +private fun getVerticalPadding( + shape: PokitInputShape, +): Dp { + return when (shape) { + PokitInputShape.ROUND -> { + 8.dp + } + PokitInputShape.RECTANGLE -> { + 13.dp } } } @@ -82,9 +98,9 @@ private fun getBackgroundColor( state: PokitInputState, ): Color { return when (state) { - PokitInputState.DEFAULT -> PokitTheme.colors.backgroundBase + PokitInputState.DEFAULT -> PokitTheme.colors.backgroundPrimary - PokitInputState.INPUT -> PokitTheme.colors.backgroundBase + PokitInputState.INPUT -> PokitTheme.colors.backgroundPrimary PokitInputState.ACTIVE -> PokitTheme.colors.backgroundBase @@ -101,9 +117,9 @@ private fun getStrokeColor( state: PokitInputState, ): Color { return when (state) { - PokitInputState.DEFAULT -> PokitTheme.colors.borderSecondary + PokitInputState.DEFAULT -> Color.Unspecified - PokitInputState.INPUT -> PokitTheme.colors.borderSecondary + PokitInputState.INPUT -> Color.Unspecified PokitInputState.ACTIVE -> PokitTheme.colors.brand From a263df1dc7ba147011885598e6732a871471871d Mon Sep 17 00:00:00 2001 From: yunsehwan Date: Sun, 7 Jul 2024 21:46:10 +0900 Subject: [PATCH 12/38] =?UTF-8?q?[UI]=20#10=20PushCard=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/components/block/pushcard/Preview.kt | 58 ++++++++++++ .../ui/components/block/pushcard/PushCard.kt | 94 +++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pushcard/Preview.kt create mode 100644 core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pushcard/PushCard.kt diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pushcard/Preview.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pushcard/Preview.kt new file mode 100644 index 00000000..77effd63 --- /dev/null +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pushcard/Preview.kt @@ -0,0 +1,58 @@ +package pokitmons.pokit.core.ui.components.block.pushcard + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import pokitmons.pokit.core.ui.R +import pokitmons.pokit.core.ui.theme.PokitTheme + +@Preview(showBackground = true) +@Composable +fun PushCardPreview() { + PokitTheme { + Column( + modifier = Modifier.fillMaxSize(), + verticalArrangement = Arrangement.spacedBy(8.dp) + ) { + PushCard( + title = "일단 글 링크의 타이틀은 조금 길수도 있으니까 아무렇게나 길게 적어봅니다", + sub = "내일 알림이 예정되어 있어요!\n잊지 말고 링크를 확인하세요!", + timeString = "1시간 전", + painter = null, + onClick = {}, + read = false + ) + + PushCard( + title = "일단 글 링크의 타이틀은 조금 길수도 있으니까 아무렇게나 길게 적어봅니다", + sub = "내일 알림이 예정되어 있어요!\n잊지 말고 링크를 확인하세요!", + timeString = "1시간 전", + painter = null, + onClick = {}, + read = true + ) + + PushCard( + title = "일단 글 링크의 타이틀은 조금 길수도 있으니까 아무렇게나 길게 적어봅니다", + sub = "내일 알림이 예정되어 있어요!\n잊지 말고 링크를 확인하세요!", + timeString = "1시간 전", + painter = painterResource(id = R.drawable.icon_24_google), + onClick = {}, + read = false + ) + PushCard( + title = "일단 글 링크의 타이틀은 조금 길수도 있으니까 아무렇게나 길게 적어봅니다", + sub = "내일 알림이 예정되어 있어요!\n잊지 말고 링크를 확인하세요!", + timeString = "1시간 전", + painter = painterResource(id = R.drawable.icon_24_google), + onClick = {}, + read = true + ) + } + } +} diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pushcard/PushCard.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pushcard/PushCard.kt new file mode 100644 index 00000000..bca982e5 --- /dev/null +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pushcard/PushCard.kt @@ -0,0 +1,94 @@ +package pokitmons.pokit.core.ui.components.block.pushcard + +import androidx.compose.foundation.Image +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.painter.Painter +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import pokitmons.pokit.core.ui.theme.PokitTheme + +@Composable +fun PushCard( + title: String, + sub: String, + timeString: String, + painter: Painter?, + read: Boolean, + onClick: () -> Unit, + modifier: Modifier = Modifier, +) { + val titleTextColor = getTitleTextColor(read = read) + + Row( + modifier = modifier + .clickable(onClick = onClick) + .padding(all = 20.dp), + horizontalArrangement = Arrangement.spacedBy(16.dp), + verticalAlignment = Alignment.CenterVertically + ) { + if (painter != null) { + Image( + modifier = Modifier + .width(94.dp) + .height(70.dp) + .clip(shape = RoundedCornerShape(2.dp)), + painter = painter, + contentDescription = null, + contentScale = ContentScale.Crop + ) + } + + Column( + modifier = Modifier.weight(1f) + ) { + Text( + text = title, + style = PokitTheme.typography.body2Bold.copy(color = titleTextColor), + maxLines = 1, + overflow = TextOverflow.Ellipsis + ) + + Spacer(modifier = Modifier.height(4.dp)) + + Text( + text = sub, + style = PokitTheme.typography.detail2.copy(color = PokitTheme.colors.textSecondary), + minLines = 2, + maxLines = 2 + ) + + Spacer(modifier = Modifier.height(8.dp)) + + Text( + text = timeString, + style = PokitTheme.typography.detail2.copy(color = PokitTheme.colors.textTertiary) + ) + } + } +} + +@Composable +private fun getTitleTextColor( + read: Boolean, +): Color { + return if (read) { + PokitTheme.colors.textPrimary + } else { + PokitTheme.colors.textDisable + } +} From 5e0f3ab8a09351e8a9e8046c5f669dde10628c8e Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 8 Jul 2024 16:09:43 +0900 Subject: [PATCH 13/38] =?UTF-8?q?[chore]=20core:ui=20=EB=AA=A8=EB=93=88=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 --- feature/login/build.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/feature/login/build.gradle.kts b/feature/login/build.gradle.kts index f3ffc1a0..c7f44ef4 100644 --- a/feature/login/build.gradle.kts +++ b/feature/login/build.gradle.kts @@ -81,4 +81,6 @@ dependencies { implementation(libs.androidx.credentials) implementation(libs.androidx.credentials.play.services.auth) implementation(libs.googleid) + + implementation(project(":core:ui")) } From 6dc0cdcbcb8050fe549e0a62b5b554f800a5e2cb Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 8 Jul 2024 16:12:20 +0900 Subject: [PATCH 14/38] =?UTF-8?q?[ui]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atom/button/PokitLoginButton.kt | 91 +++++++++++++++++++ .../button/attributes/ButtonAttributes.kt | 15 +++ .../java/pokitmons/pokit/login/LoginScreen.kt | 44 ++++++++- 3 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt new file mode 100644 index 00000000..a34a16c3 --- /dev/null +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt @@ -0,0 +1,91 @@ +package pokitmons.pokit.core.ui.components.atom.button + +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Icon +import androidx.compose.material3.Surface +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.unit.dp +import pokitmons.pokit.core.ui.R +import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitLoginButtonType +import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitLoginResource +import pokitmons.pokit.core.ui.theme.PokitTheme +import pokitmons.pokit.core.ui.theme.color.Gray200 +import pokitmons.pokit.core.ui.theme.color.Gray700 +import pokitmons.pokit.core.ui.theme.color.Gray900 + +@Composable +fun PokitLoginButton( + modifier: Modifier = Modifier, + onClick: () -> Unit, + loginType: PokitLoginButtonType, +) { + + val loginResource: PokitLoginResource = getLoginResource(loginType) + + Surface( + modifier = Modifier + .height(50.dp) + .border( + shape = RoundedCornerShape(8.dp), + width = 1.dp, + color = loginResource.borderColor + ), + shape = RoundedCornerShape(8.dp), + color = loginResource.backgroundColor, + onClick = onClick + ) { + Row( + modifier = modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Center + ) { + Icon( + modifier = Modifier + .size(24.dp), + painter = painterResource(id = loginResource.iconResourceId), + tint = loginResource.iconTintColor, + contentDescription = null, + ) + Text( + modifier = Modifier + .padding(start = 12.dp), + text = loginResource.text, + color = loginResource.textColor, + style = PokitTheme.typography.label3Regular, + ) + } + } +} + +private fun getLoginResource(loginType: PokitLoginButtonType): PokitLoginResource { + return when (loginType) { + PokitLoginButtonType.APPLE -> PokitLoginResource( + iconResourceId = R.drawable.icon_24_apple, + iconTintColor = Color.White, + textColor = Color.White, + backgroundColor = Gray700, + borderColor = Gray700, + text = "Apple로 시작하기" + ) + + PokitLoginButtonType.GOOGLE -> PokitLoginResource( + iconResourceId = R.drawable.icon_24_google, + textColor = Gray900, + backgroundColor = Color.White, + borderColor = Gray200, + text = "Google로 시작하기" + ) + } +} diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt index b08bfa1d..1df9f23d 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt @@ -1,5 +1,7 @@ package pokitmons.pokit.core.ui.components.atom.button.attributes +import androidx.compose.ui.graphics.Color + enum class PokitButtonShape { ROUND, RECTANGLE, } @@ -28,3 +30,16 @@ data class PokitButtonIcon( enum class PokitButtonIconPosition { RIGHT, LEFT, } + +enum class PokitLoginButtonType { + GOOGLE, APPLE +} + +data class PokitLoginResource( + val iconResourceId: Int, + val iconTintColor: Color = Color.Unspecified, + val textColor: Color, + val backgroundColor: Color, + val borderColor: Color, + val text: String +) diff --git a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt index 6473035b..73281832 100644 --- a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt @@ -2,22 +2,60 @@ package pokitmons.pokit.login import android.annotation.SuppressLint import android.util.Log -import androidx.compose.material3.Text +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.ui.Alignment import androidx.compose.ui.platform.LocalContext import androidx.credentials.CredentialManager import androidx.credentials.GetCredentialRequest import com.google.android.libraries.identity.googleid.GetGoogleIdOption import com.google.android.libraries.identity.googleid.GoogleIdTokenCredential import kotlinx.coroutines.launch +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import pokitmons.pokit.core.ui.components.atom.button.PokitLoginButton +import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitLoginButtonType -@SuppressLint("CoroutineCreationDuringComposition") @Composable fun LoginScreen() { // TODO 서버 api 개발완료 후 viewmodel 연동 및 아키텍처 구축 + Box( + modifier = Modifier + .fillMaxSize(), + ) + { + Column( + modifier = Modifier + .align(Alignment.BottomCenter) + .padding( + start = 20.dp, + end = 20.dp, + bottom = 32.dp + ), + ) { + PokitLoginButton( + loginType = PokitLoginButtonType.APPLE, + onClick = { } + ) + + Spacer(modifier = Modifier.padding(top = 4.dp, bottom = 4.dp),) + + PokitLoginButton( + loginType = PokitLoginButtonType.GOOGLE, + onClick = { } + ) + } + } +} - Text(text = "로그인 테스트 화면") +@SuppressLint("CoroutineCreationDuringComposition") +@Composable +private fun googleLogin() { val coroutineScope = rememberCoroutineScope() val context = LocalContext.current From 81691b5d57a8e78377c16b1de3b488a13c233f75 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 8 Jul 2024 16:15:01 +0900 Subject: [PATCH 15/38] =?UTF-8?q?[chore]=20ci=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=BB=A8=EB=B2=A4=EC=85=98=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/components/atom/button/PokitLoginButton.kt | 5 ++--- .../atom/button/attributes/ButtonAttributes.kt | 2 +- .../main/java/pokitmons/pokit/login/LoginScreen.kt | 13 ++++++------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt index a34a16c3..232e3c01 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt @@ -31,7 +31,6 @@ fun PokitLoginButton( onClick: () -> Unit, loginType: PokitLoginButtonType, ) { - val loginResource: PokitLoginResource = getLoginResource(loginType) Surface( @@ -56,14 +55,14 @@ fun PokitLoginButton( .size(24.dp), painter = painterResource(id = loginResource.iconResourceId), tint = loginResource.iconTintColor, - contentDescription = null, + contentDescription = null ) Text( modifier = Modifier .padding(start = 12.dp), text = loginResource.text, color = loginResource.textColor, - style = PokitTheme.typography.label3Regular, + style = PokitTheme.typography.label3Regular ) } } diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt index 1df9f23d..321e2609 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt @@ -41,5 +41,5 @@ data class PokitLoginResource( val textColor: Color, val backgroundColor: Color, val borderColor: Color, - val text: String + val text: String, ) diff --git a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt index 73281832..11cdb7c4 100644 --- a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt @@ -10,14 +10,14 @@ import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.unit.dp import androidx.credentials.CredentialManager import androidx.credentials.GetCredentialRequest import com.google.android.libraries.identity.googleid.GetGoogleIdOption import com.google.android.libraries.identity.googleid.GoogleIdTokenCredential import kotlinx.coroutines.launch -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp import pokitmons.pokit.core.ui.components.atom.button.PokitLoginButton import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitLoginButtonType @@ -26,9 +26,8 @@ fun LoginScreen() { // TODO 서버 api 개발완료 후 viewmodel 연동 및 아키텍처 구축 Box( modifier = Modifier - .fillMaxSize(), - ) - { + .fillMaxSize() + ) { Column( modifier = Modifier .align(Alignment.BottomCenter) @@ -36,14 +35,14 @@ fun LoginScreen() { start = 20.dp, end = 20.dp, bottom = 32.dp - ), + ) ) { PokitLoginButton( loginType = PokitLoginButtonType.APPLE, onClick = { } ) - Spacer(modifier = Modifier.padding(top = 4.dp, bottom = 4.dp),) + Spacer(modifier = Modifier.padding(top = 4.dp, bottom = 4.dp)) PokitLoginButton( loginType = PokitLoginButtonType.GOOGLE, From 9302a440516776c100ccd79679287fe40266fed1 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Sat, 13 Jul 2024 14:16:33 +0900 Subject: [PATCH 16/38] =?UTF-8?q?[chore]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=EC=84=B8=EC=8A=A4=20string=20resouce=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 --- feature/login/src/main/res/values/strings.xml | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/feature/login/src/main/res/values/strings.xml b/feature/login/src/main/res/values/strings.xml index 20aee43a..6e324eb7 100644 --- a/feature/login/src/main/res/values/strings.xml +++ b/feature/login/src/main/res/values/strings.xml @@ -1,3 +1,30 @@ - login + Google로 시작하기 + Apple로 시작하기 + 서비스 이용을 위해\n이용약 동의가 필요합니다 + 약관 전체동의 + (필수)개인정보 수집 및 이용 동의 + 서비스 이용약관 + 마케팅 정보 수신 + Pokit에 사용할 닉네임을\n입력해주세요 + 내용을 입력해주세요. + 한글, 영어, 숫자로만 입력이 가능합니다. + 어떤 분야에 관심이 있으세요? + 최대 3개를 골라주시면,\n관련 콘텐츠를 추천해드릴게요! + 스포츠/레저 + 문구/오피스 + 패션 + 여행 + 경제/시사 + 영화/드라마 + 맛집 + 인테리어 + IT + 디자인 + 자기계발 + 유머 + 음악 + 취업정보 + 회원가입이 완료되었습니다! + POKIT을 통해 많은 링크를\n간편하게 관리하세요 \ No newline at end of file From 282e2a4163d58ec5616d3d346b7d396ee91e103b Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Sat, 13 Jul 2024 14:42:44 +0900 Subject: [PATCH 17/38] =?UTF-8?q?[ui]=20=EB=94=94=EC=9E=90=EC=9D=B8=20?= =?UTF-8?q?=EC=8B=9C=EC=8A=A4=ED=85=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - checkbox iconOnly 대응 --- .../pokit/core/ui/components/atom/checkbox/PokitCheckbox.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/checkbox/PokitCheckbox.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/checkbox/PokitCheckbox.kt index ed7772e7..aa84852f 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/checkbox/PokitCheckbox.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/checkbox/PokitCheckbox.kt @@ -109,7 +109,7 @@ private fun getStrokeColor( Color.Unspecified } - !checked -> { + !checked && (style != PokitCheckboxStyle.ICON_ONLY) -> { PokitTheme.colors.borderSecondary } @@ -134,8 +134,8 @@ private fun getBackgroundColor( PokitTheme.colors.backgroundDisable } - !checked -> { - PokitTheme.colors.backgroundBase + !checked && (style != PokitCheckboxStyle.ICON_ONLY) -> { + PokitTheme.colors.borderSecondary } style == PokitCheckboxStyle.FILLED -> { From 5e5ebcd8ef8f4446c75dbf947baceb62e98c3050 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Sat, 13 Jul 2024 15:06:51 +0900 Subject: [PATCH 18/38] =?UTF-8?q?[chore]=20string=20resource=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/login/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/login/src/main/res/values/strings.xml b/feature/login/src/main/res/values/strings.xml index 6e324eb7..e4a7a99b 100644 --- a/feature/login/src/main/res/values/strings.xml +++ b/feature/login/src/main/res/values/strings.xml @@ -27,4 +27,5 @@ 취업정보 회원가입이 완료되었습니다! POKIT을 통해 많은 링크를\n간편하게 관리하세요 + 다음 \ No newline at end of file From 660a2bc50e1dfd538085fa9a6fbecb66af2e542c Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Sat, 13 Jul 2024 15:09:59 +0900 Subject: [PATCH 19/38] =?UTF-8?q?[chore]=20=EB=94=94=EC=9E=90=EC=9D=B8=20?= =?UTF-8?q?=EC=8B=9C=EC=8A=A4=ED=85=9C=20=EB=B0=98=EC=98=81=20=EB=B0=8F=20?= =?UTF-8?q?=EB=A6=AC=EC=86=8C=EC=8A=A4=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokit/core/ui/components/atom/button/PokitLoginButton.kt | 5 ++--- .../ui/components/atom/button/attributes/ButtonAttributes.kt | 1 - .../login/src/main/java/pokitmons/pokit/login/LoginScreen.kt | 3 +++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt index 232e3c01..1960ff22 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt @@ -30,6 +30,7 @@ fun PokitLoginButton( modifier: Modifier = Modifier, onClick: () -> Unit, loginType: PokitLoginButtonType, + text: String ) { val loginResource: PokitLoginResource = getLoginResource(loginType) @@ -60,7 +61,7 @@ fun PokitLoginButton( Text( modifier = Modifier .padding(start = 12.dp), - text = loginResource.text, + text = text, color = loginResource.textColor, style = PokitTheme.typography.label3Regular ) @@ -76,7 +77,6 @@ private fun getLoginResource(loginType: PokitLoginButtonType): PokitLoginResourc textColor = Color.White, backgroundColor = Gray700, borderColor = Gray700, - text = "Apple로 시작하기" ) PokitLoginButtonType.GOOGLE -> PokitLoginResource( @@ -84,7 +84,6 @@ private fun getLoginResource(loginType: PokitLoginButtonType): PokitLoginResourc textColor = Gray900, backgroundColor = Color.White, borderColor = Gray200, - text = "Google로 시작하기" ) } } diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt index 321e2609..6e97beee 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/attributes/ButtonAttributes.kt @@ -41,5 +41,4 @@ data class PokitLoginResource( val textColor: Color, val backgroundColor: Color, val borderColor: Color, - val text: String, ) diff --git a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt index 11cdb7c4..db172c20 100644 --- a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt @@ -12,6 +12,7 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.credentials.CredentialManager import androidx.credentials.GetCredentialRequest @@ -39,6 +40,7 @@ fun LoginScreen() { ) { PokitLoginButton( loginType = PokitLoginButtonType.APPLE, + text = stringResource(id = R.string.apple_login), onClick = { } ) @@ -46,6 +48,7 @@ fun LoginScreen() { PokitLoginButton( loginType = PokitLoginButtonType.GOOGLE, + text = stringResource(id = R.string.google_login), onClick = { } ) } From 747586aa883970419471bf4623ed545b2ebf7c5f Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Sat, 13 Jul 2024 15:10:24 +0900 Subject: [PATCH 20/38] =?UTF-8?q?[ui]=20=EC=95=BD=EA=B4=80=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokit/terms/TermsCheckBoxItem.kt | 45 +++++++++ .../pokit/terms/TermsOfServiceScreen.kt | 92 +++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt create mode 100644 feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt diff --git a/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt b/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt new file mode 100644 index 00000000..ae0ff027 --- /dev/null +++ b/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt @@ -0,0 +1,45 @@ +package pokitmons.pokit.terms + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +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.res.painterResource +import androidx.compose.ui.unit.dp +import pokitmons.pokit.core.ui.components.atom.checkbox.PokitCheckbox +import pokitmons.pokit.core.ui.components.atom.checkbox.attributes.PokitCheckboxStyle +import pokitmons.pokit.core.ui.theme.PokitTheme + +@Composable +fun TermsCheckBoxItem( + text: String +) { + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + + ) { + PokitCheckbox( + checked = false, + style = PokitCheckboxStyle.ICON_ONLY, + onClick = { } + ) + + Text( + modifier = Modifier.padding(start = 4.dp), + text = text, + style = PokitTheme.typography.body2Medium + ) + + Icon( + modifier = Modifier.fillMaxWidth(), + painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_right), + contentDescription = "화살표" + ) + } +} diff --git a/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt b/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt new file mode 100644 index 00000000..dbd5de24 --- /dev/null +++ b/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt @@ -0,0 +1,92 @@ +package pokitmons.pokit.terms + +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +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.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import pokitmons.pokit.core.ui.components.atom.button.PokitButton +import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize +import pokitmons.pokit.core.ui.components.atom.checkbox.PokitCheckbox +import pokitmons.pokit.core.ui.components.atom.checkbox.attributes.PokitCheckboxStyle +import pokitmons.pokit.core.ui.theme.PokitTheme +import pokitmons.pokit.login.R + +@Composable +fun TermsOfServiceScreen() { + Box(modifier = Modifier + .fillMaxSize() + .padding(all = 20.dp) + .padding(bottom = 8.dp) + ) { + Column { + Icon(painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_left), contentDescription = null) + Spacer(modifier = Modifier.padding(top = 16.dp, bottom = 16.dp)) + Text(text = stringResource(id = R.string.service_privacy_title), style = PokitTheme.typography.title1) + Spacer(modifier = Modifier.padding(top = 14.dp, bottom = 14.dp)) + + Row(modifier = Modifier + .fillMaxWidth() + .height(64.dp) + .border( + shape = RoundedCornerShape(8.dp), + width = 1.dp, + color = PokitTheme.colors.brand + ), + verticalAlignment = Alignment.CenterVertically + ) { + Spacer(modifier = Modifier.padding(start = 16.dp)) + PokitCheckbox( + style = PokitCheckboxStyle.FILLED, + checked = true, + onClick = { + + } + ) + Text(modifier = Modifier.padding(start = 16.dp), + text = stringResource(id = R.string.privacy_all_agree), + style = PokitTheme.typography.body1Bold + ) + } + + Spacer(modifier = Modifier.padding(top = 20.dp)) + + Column( + modifier = Modifier + .padding( + start = 20.dp, + end = 20.dp + ) + .fillMaxWidth() + ) { + TermsCheckBoxItem(text = stringResource(id = R.string.personal_data_agree)) + Spacer(modifier = Modifier.padding(top = 16.dp)) + TermsCheckBoxItem(text = stringResource(id = R.string.service_agree)) + Spacer(modifier = Modifier.padding(top = 16.dp)) + TermsCheckBoxItem(text = stringResource(id = R.string.marketing_agree)) + } + } + PokitButton( + modifier = Modifier + .fillMaxWidth() + .align(Alignment.BottomCenter) + , + text = stringResource(id = R.string.next), + icon = null, + size = PokitButtonSize.LARGE, + onClick = { /*TODO*/ }) + } +} From 298aa850c1d8c16e6a8ad42a0da98a44d1ba3ebc Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Sat, 13 Jul 2024 15:30:51 +0900 Subject: [PATCH 21/38] =?UTF-8?q?[chore]=20string=20id=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 --- feature/login/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/login/src/main/res/values/strings.xml b/feature/login/src/main/res/values/strings.xml index e4a7a99b..9d594f31 100644 --- a/feature/login/src/main/res/values/strings.xml +++ b/feature/login/src/main/res/values/strings.xml @@ -7,7 +7,7 @@ 서비스 이용약관 마케팅 정보 수신 Pokit에 사용할 닉네임을\n입력해주세요 - 내용을 입력해주세요. + 내용을 입력해주세요. 한글, 영어, 숫자로만 입력이 가능합니다. 어떤 분야에 관심이 있으세요? 최대 3개를 골라주시면,\n관련 콘텐츠를 추천해드릴게요! From e0812e737ba6a1ba3b7f914669e870eb4c2a366c Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Sun, 14 Jul 2024 16:38:37 +0900 Subject: [PATCH 22/38] =?UTF-8?q?[chore]=20adjustResize=20=EC=86=8D?= =?UTF-8?q?=EC=84=B1=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/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7bc34188..03a2ac03 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,6 +18,7 @@ android:name=".MainActivity" android:exported="true" android:label="@string/app_name" + android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.Pokit"> From 7149c80a5dcddc81bbba52a15b5c9e976774466c Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 15 Jul 2024 15:01:01 +0900 Subject: [PATCH 23/38] =?UTF-8?q?[feature]=20LoginNavHost=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/pokitmons/pokit/MainActivity.kt | 8 ++- feature/login/build.gradle.kts | 1 + .../pokit/navigation/LoginNavHost.kt | 51 +++++++++++++++++++ .../pokitmons/pokit/navigation/LoginRoute.kt | 9 ++++ 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt create mode 100644 feature/login/src/main/java/pokitmons/pokit/navigation/LoginRoute.kt diff --git a/app/src/main/java/pokitmons/pokit/MainActivity.kt b/app/src/main/java/pokitmons/pokit/MainActivity.kt index 1d21a571..1e54da53 100644 --- a/app/src/main/java/pokitmons/pokit/MainActivity.kt +++ b/app/src/main/java/pokitmons/pokit/MainActivity.kt @@ -4,14 +4,18 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import pokitmons.pokit.core.ui.theme.PokitTheme -import pokitmons.pokit.login.LoginScreen +import pokitmons.pokit.keyword.KeywordScreen +import pokitmons.pokit.navigation.LoginNavHost +import pokitmons.pokit.nickname.InputNicknameScreen +import pokitmons.pokit.success.SignUpSuccessScreen +import pokitmons.pokit.terms.TermsOfServiceScreen class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { PokitTheme { - LoginScreen() + LoginNavHost() } } } diff --git a/feature/login/build.gradle.kts b/feature/login/build.gradle.kts index c7f44ef4..4188ee20 100644 --- a/feature/login/build.gradle.kts +++ b/feature/login/build.gradle.kts @@ -70,6 +70,7 @@ dependencies { implementation(libs.androidx.ui.graphics) implementation(libs.androidx.ui.tooling.preview) implementation(libs.androidx.material3) + implementation(libs.androidx.navigation.compose) testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) diff --git a/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt b/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt new file mode 100644 index 00000000..ea5444d5 --- /dev/null +++ b/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt @@ -0,0 +1,51 @@ +package pokitmons.pokit.navigation + +import androidx.compose.runtime.Composable +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.rememberNavController +import pokitmons.pokit.keyword.KeywordScreen +import pokitmons.pokit.login.LoginScreen +import pokitmons.pokit.nickname.InputNicknameScreen +import pokitmons.pokit.success.SignUpSuccessScreen +import pokitmons.pokit.terms.TermsOfServiceScreen + +@Composable +fun LoginNavHost() { + val navController = rememberNavController() + NavHost( + navController = navController, + startDestination = LoginRoute.LoginScreen.name + ) { + composable(route = LoginRoute.LoginScreen.name) { + LoginScreen( + onNavigateToTermsOfServiceScreen = { navController.navigate(route = LoginRoute.TermsOfServiceScreen.name) }, + onNavigateToMainScreen = { }, // TODO 메인 화면 구현후 수정 + ) + } + + composable(route = LoginRoute.TermsOfServiceScreen.name) { + TermsOfServiceScreen( + onNavigateToInputNicknameScreen = { navController.navigate(route = LoginRoute.InputNicknameScreen.name) }, + ) + } + + composable(route = LoginRoute.InputNicknameScreen.name) { + InputNicknameScreen( + onNavigateToKeywordScreen = { navController.navigate(route = LoginRoute.KeywordScreen.name) }, + ) + } + + composable(route = LoginRoute.KeywordScreen.name) { + KeywordScreen( + onNavigateToSignUpScreen = { navController.navigate(route = LoginRoute.SignUpSuccessScreen.name) }, + ) + } + + composable(route = LoginRoute.SignUpSuccessScreen.name) { + SignUpSuccessScreen( + onNavigateToMainScreen = { }, // TODO 메인 화면 구현후 수정 + ) + } + } +} diff --git a/feature/login/src/main/java/pokitmons/pokit/navigation/LoginRoute.kt b/feature/login/src/main/java/pokitmons/pokit/navigation/LoginRoute.kt new file mode 100644 index 00000000..497b8e4e --- /dev/null +++ b/feature/login/src/main/java/pokitmons/pokit/navigation/LoginRoute.kt @@ -0,0 +1,9 @@ +package pokitmons.pokit.navigation + +sealed class LoginRoute(val name: String) { + data object LoginScreen : LoginRoute("LoginScreen") + data object TermsOfServiceScreen : LoginRoute("TermsOfServiceScreen") + data object InputNicknameScreen : LoginRoute("InputNicknameScreen") + data object KeywordScreen : LoginRoute("KeywordScreen") + data object SignUpSuccessScreen : LoginRoute("SignUpSuccessScreen") +} From d04fc79c13445542876fbb09717c447a0b1fab28 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 15 Jul 2024 15:03:16 +0900 Subject: [PATCH 24/38] =?UTF-8?q?[ui]=20LoginScreen=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/pokitmons/pokit/login/LoginScreen.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt index db172c20..06c0305f 100644 --- a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt @@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.rememberCoroutineScope @@ -23,33 +24,32 @@ import pokitmons.pokit.core.ui.components.atom.button.PokitLoginButton import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitLoginButtonType @Composable -fun LoginScreen() { +fun LoginScreen( + onNavigateToTermsOfServiceScreen: () -> Unit, + onNavigateToMainScreen: () -> Unit, +) { // TODO 서버 api 개발완료 후 viewmodel 연동 및 아키텍처 구축 Box( modifier = Modifier - .fillMaxSize() + .fillMaxSize(), ) { Column( modifier = Modifier .align(Alignment.BottomCenter) - .padding( - start = 20.dp, - end = 20.dp, - bottom = 32.dp - ) + .padding(start = 20.dp, end = 20.dp, bottom = 32.dp), ) { PokitLoginButton( loginType = PokitLoginButtonType.APPLE, text = stringResource(id = R.string.apple_login), - onClick = { } + onClick = { onNavigateToMainScreen() }, ) - Spacer(modifier = Modifier.padding(top = 4.dp, bottom = 4.dp)) + Spacer(modifier = Modifier.height(8.dp)) PokitLoginButton( loginType = PokitLoginButtonType.GOOGLE, text = stringResource(id = R.string.google_login), - onClick = { } + onClick = { onNavigateToTermsOfServiceScreen() }, ) } } From 2876a453d04c36e0c293132531082f7245a6492e Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 15 Jul 2024 20:27:03 +0900 Subject: [PATCH 25/38] =?UTF-8?q?[chore]=20string=20resource=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 --- feature/login/src/main/res/values/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/login/src/main/res/values/strings.xml b/feature/login/src/main/res/values/strings.xml index 9d594f31..002ac0ef 100644 --- a/feature/login/src/main/res/values/strings.xml +++ b/feature/login/src/main/res/values/strings.xml @@ -4,8 +4,8 @@ 서비스 이용을 위해\n이용약 동의가 필요합니다 약관 전체동의 (필수)개인정보 수집 및 이용 동의 - 서비스 이용약관 - 마케팅 정보 수신 + (필수)서비스 이용약관 + (선택)마케팅 정보 수신 Pokit에 사용할 닉네임을\n입력해주세요 내용을 입력해주세요. 한글, 영어, 숫자로만 입력이 가능합니다. From 01d627a5e6e43e3e48bb6719f48faf73baa7f0f8 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 15 Jul 2024 20:43:56 +0900 Subject: [PATCH 26/38] =?UTF-8?q?[feature]=20=EC=95=BD=EA=B4=80=EB=8F=99?= =?UTF-8?q?=EC=9D=98=20=ED=99=94=EB=A9=B4=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokit/navigation/LoginNavHost.kt | 3 + .../pokit/terms/TermsCheckBoxItem.kt | 37 ++++--- .../pokit/terms/TermsOfServiceScreen.kt | 100 ++++++++++++------ .../java/pokitmons/pokit/terms/TermsState.kt | 8 ++ .../pokitmons/pokit/terms/TermsViewModel.kt | 42 ++++++++ 5 files changed, 138 insertions(+), 52 deletions(-) create mode 100644 feature/login/src/main/java/pokitmons/pokit/terms/TermsState.kt create mode 100644 feature/login/src/main/java/pokitmons/pokit/terms/TermsViewModel.kt diff --git a/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt b/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt index ea5444d5..c1765930 100644 --- a/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt +++ b/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt @@ -27,18 +27,21 @@ fun LoginNavHost() { composable(route = LoginRoute.TermsOfServiceScreen.name) { TermsOfServiceScreen( onNavigateToInputNicknameScreen = { navController.navigate(route = LoginRoute.InputNicknameScreen.name) }, + popBackStack = { navController.popBackStack() } ) } composable(route = LoginRoute.InputNicknameScreen.name) { InputNicknameScreen( onNavigateToKeywordScreen = { navController.navigate(route = LoginRoute.KeywordScreen.name) }, + popBackStack = { navController.popBackStack() } ) } composable(route = LoginRoute.KeywordScreen.name) { KeywordScreen( onNavigateToSignUpScreen = { navController.navigate(route = LoginRoute.SignUpSuccessScreen.name) }, + popBackStack = { navController.popBackStack() } ) } diff --git a/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt b/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt index ae0ff027..3a15d4d3 100644 --- a/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt +++ b/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt @@ -1,6 +1,6 @@ package pokitmons.pokit.terms -import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding @@ -17,27 +17,26 @@ import pokitmons.pokit.core.ui.theme.PokitTheme @Composable fun TermsCheckBoxItem( - text: String + text: String, + isChecked: Boolean, + click:() -> Unit ) { - Row( - modifier = Modifier.fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically, - - ) { - PokitCheckbox( - checked = false, - style = PokitCheckboxStyle.ICON_ONLY, - onClick = { } - ) - - Text( - modifier = Modifier.padding(start = 4.dp), - text = text, - style = PokitTheme.typography.body2Medium - ) + Box(modifier = Modifier.fillMaxWidth(),) { + Row(verticalAlignment = Alignment.CenterVertically) { + PokitCheckbox( + checked = isChecked, + style = PokitCheckboxStyle.ICON_ONLY, + onClick = { click() } + ) + Text( + modifier = Modifier.padding(start = 4.dp), + text = text, + style = PokitTheme.typography.body2Medium + ) + } Icon( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier.align(Alignment.CenterEnd), painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_right), contentDescription = "화살표" ) diff --git a/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt b/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt index dbd5de24..12822f4f 100644 --- a/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt @@ -1,6 +1,7 @@ package pokitmons.pokit.terms import androidx.compose.foundation.border +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -13,11 +14,14 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import androidx.lifecycle.viewmodel.compose.viewModel import pokitmons.pokit.core.ui.components.atom.button.PokitButton import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize import pokitmons.pokit.core.ui.components.atom.checkbox.PokitCheckbox @@ -26,37 +30,54 @@ import pokitmons.pokit.core.ui.theme.PokitTheme import pokitmons.pokit.login.R @Composable -fun TermsOfServiceScreen() { - Box(modifier = Modifier - .fillMaxSize() - .padding(all = 20.dp) - .padding(bottom = 8.dp) +fun TermsOfServiceScreen( + onNavigateToInputNicknameScreen: () -> Unit, + popBackStack:() -> Unit, +) { + val termsViewModel: TermsViewModel = viewModel() // TODO hiltViewModel 마이그레이션 예정 + val termsState by termsViewModel.termsState.collectAsState() + + Box( + modifier = Modifier + .fillMaxSize() + .padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp), ) { Column { - Icon(painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_left), contentDescription = null) - Spacer(modifier = Modifier.padding(top = 16.dp, bottom = 16.dp)) - Text(text = stringResource(id = R.string.service_privacy_title), style = PokitTheme.typography.title1) - Spacer(modifier = Modifier.padding(top = 14.dp, bottom = 14.dp)) + Icon( + painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_left), + contentDescription = "뒤로가기", + modifier = Modifier.clickable { popBackStack() }, + ) - Row(modifier = Modifier - .fillMaxWidth() - .height(64.dp) - .border( - shape = RoundedCornerShape(8.dp), - width = 1.dp, - color = PokitTheme.colors.brand - ), + Spacer(modifier = Modifier.height(32.dp)) + + Text( + text = stringResource(id = R.string.service_privacy_title), + style = PokitTheme.typography.title1 + ) + + Spacer(modifier = Modifier.height(32.dp)) + + Row( + modifier = Modifier + .fillMaxWidth() + .height(64.dp) + .border( + shape = RoundedCornerShape(8.dp), + width = 1.dp, + color = PokitTheme.colors.brand + ), verticalAlignment = Alignment.CenterVertically ) { Spacer(modifier = Modifier.padding(start = 16.dp)) - PokitCheckbox( - style = PokitCheckboxStyle.FILLED, - checked = true, - onClick = { - } + PokitCheckbox( + style = PokitCheckboxStyle.STROKE, + checked = termsState.isAllChecked, + onClick = { termsViewModel.checkAllTerms() }, ) - Text(modifier = Modifier.padding(start = 16.dp), + Text( + modifier = Modifier.padding(start = 16.dp), text = stringResource(id = R.string.privacy_all_agree), style = PokitTheme.typography.body1Bold ) @@ -66,27 +87,40 @@ fun TermsOfServiceScreen() { Column( modifier = Modifier - .padding( - start = 20.dp, - end = 20.dp - ) + .padding(start = 20.dp, end = 20.dp) .fillMaxWidth() ) { - TermsCheckBoxItem(text = stringResource(id = R.string.personal_data_agree)) + TermsCheckBoxItem( + text = stringResource(id = R.string.personal_data_agree), + isChecked = termsState.isPersonalDataChecked, + click = { termsViewModel.checkPersonalData() } + ) Spacer(modifier = Modifier.padding(top = 16.dp)) - TermsCheckBoxItem(text = stringResource(id = R.string.service_agree)) + + TermsCheckBoxItem( + text = stringResource(id = R.string.service_agree), + isChecked = termsState.isServiceChecked, + click = { termsViewModel.checkServiceTerm() } + ) Spacer(modifier = Modifier.padding(top = 16.dp)) - TermsCheckBoxItem(text = stringResource(id = R.string.marketing_agree)) + + TermsCheckBoxItem( + text = stringResource(id = R.string.marketing_agree), + isChecked = termsState.isMarketingChecked, + click = { termsViewModel.checkMarketing() } + ) } } + PokitButton( modifier = Modifier .fillMaxWidth() - .align(Alignment.BottomCenter) - , + .align(Alignment.BottomCenter), text = stringResource(id = R.string.next), icon = null, size = PokitButtonSize.LARGE, - onClick = { /*TODO*/ }) + enable = termsState.isPersonalDataChecked && termsState.isServiceChecked, + onClick = { onNavigateToInputNicknameScreen() } + ) } } diff --git a/feature/login/src/main/java/pokitmons/pokit/terms/TermsState.kt b/feature/login/src/main/java/pokitmons/pokit/terms/TermsState.kt new file mode 100644 index 00000000..10733c6d --- /dev/null +++ b/feature/login/src/main/java/pokitmons/pokit/terms/TermsState.kt @@ -0,0 +1,8 @@ +package pokitmons.pokit.terms + +data class TermsState( + val isAllChecked: Boolean = false, + val isPersonalDataChecked: Boolean = false, + val isServiceChecked: Boolean = false, + val isMarketingChecked: Boolean = false +) diff --git a/feature/login/src/main/java/pokitmons/pokit/terms/TermsViewModel.kt b/feature/login/src/main/java/pokitmons/pokit/terms/TermsViewModel.kt new file mode 100644 index 00000000..4cae62a1 --- /dev/null +++ b/feature/login/src/main/java/pokitmons/pokit/terms/TermsViewModel.kt @@ -0,0 +1,42 @@ +package pokitmons.pokit.terms + +import androidx.lifecycle.ViewModel +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow + +class TermsViewModel() : ViewModel() { + private val _termsState = MutableStateFlow(TermsState()) + val termsState: StateFlow + get() = _termsState + + fun checkAllTerms() { + when (_termsState.value.isAllChecked) { + true -> _termsState.value = TermsState() + false -> _termsState.value = _termsState.value.copy( + isAllChecked = true, + isPersonalDataChecked = true, + isServiceChecked = true, + isMarketingChecked = true + ) + } + } + + fun checkPersonalData() { + _termsState.value = _termsState.value.copy(isPersonalDataChecked = !_termsState.value.isPersonalDataChecked) + isAllCheck() + } + + fun checkServiceTerm() { + _termsState.value = _termsState.value.copy(isServiceChecked = !_termsState.value.isServiceChecked) + isAllCheck() + } + + fun checkMarketing() { + _termsState.value = _termsState.value.copy(isMarketingChecked = !_termsState.value.isMarketingChecked) + isAllCheck() + } + + private fun isAllCheck() = with(_termsState.value) { + _termsState.value = copy(isAllChecked = isMarketingChecked && isServiceChecked && isPersonalDataChecked) + } +} From 81430ed4ad7ed044790fc33053a5a7548706d294 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 15 Jul 2024 22:39:46 +0900 Subject: [PATCH 27/38] =?UTF-8?q?[ui]=20=EC=B2=B4=ED=81=AC=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20=EB=94=94=EC=9E=90=EC=9D=B8=EC=8B=9C=EC=8A=A4?= =?UTF-8?q?=ED=85=9C=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/atom/checkbox/PokitCheckbox.kt | 2 +- .../pokit/nickname/InputNicknameScreen.kt | 92 +++++++++++++++++++ .../pokit/nickname/InputNicknameViewModel.kt | 15 +++ 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt create mode 100644 feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameViewModel.kt diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/checkbox/PokitCheckbox.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/checkbox/PokitCheckbox.kt index aa84852f..c366b9c8 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/checkbox/PokitCheckbox.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/checkbox/PokitCheckbox.kt @@ -135,7 +135,7 @@ private fun getBackgroundColor( } !checked && (style != PokitCheckboxStyle.ICON_ONLY) -> { - PokitTheme.colors.borderSecondary + PokitTheme.colors.backgroundBase } style == PokitCheckboxStyle.FILLED -> { diff --git a/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt b/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt new file mode 100644 index 00000000..a53f3083 --- /dev/null +++ b/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt @@ -0,0 +1,92 @@ +package pokitmons.pokit.nickname + +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.imePadding +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.lifecycle.viewmodel.compose.viewModel +import pokitmons.pokit.core.ui.R +import pokitmons.pokit.core.ui.components.atom.button.PokitButton +import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize +import pokitmons.pokit.core.ui.components.block.labeledinput.LabeledInput +import pokitmons.pokit.core.ui.theme.PokitTheme + +private const val NICKNAME_MAX_LENGTH = 10 // TODO 매직넘버를 포함하는 모듈화 추가 후 마이그레이션 예정 +private const val NICKNAME_MIN_LENGTH = 1 // TODO 매직넘버를 포함하는 모듈화 추가 후 마이그레이션 예정 + +@Composable +fun InputNicknameScreen( + onNavigateToKeywordScreen: () -> Unit, + popBackStack: () -> Unit +) { + val inputNicknameViewModel: InputNicknameViewModel = viewModel() // TODO hiltViewModel 마이그레이션 예정 + val inputNicknameState by inputNicknameViewModel.inputNicknameState.collectAsState() + + Box(modifier = Modifier + .padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp) + .fillMaxSize() + ) { + Column() { + Icon( + modifier = Modifier.clickable { popBackStack() }, + painter = painterResource(id = R.drawable.icon_24_arrow_left), + contentDescription = "뒤로가기" + ) + + Spacer(modifier = Modifier.padding(top = 32.dp)) + + Text( + style = PokitTheme.typography.title1, + text = stringResource(id = pokitmons.pokit.login.R.string.input_nickname_title) + ) + + Spacer(modifier = Modifier.padding(top = 28.dp)) + + LabeledInput( + modifier = Modifier + .fillMaxWidth() + .imePadding(), + label = "", + inputText = inputNicknameState, + maxLength = NICKNAME_MAX_LENGTH, + sub = if (inputNicknameState.length < NICKNAME_MAX_LENGTH) { + stringResource(id = pokitmons.pokit.login.R.string.input_restriction_message) + } else { + stringResource(id = pokitmons.pokit.login.R.string.input_max_length) + }, + isError = inputNicknameState.length > NICKNAME_MAX_LENGTH, + hintText = stringResource(id = pokitmons.pokit.login.R.string.input_nickname_hint), + onChangeText = { text -> + if (text.length <= NICKNAME_MAX_LENGTH) { + inputNicknameViewModel.inputText(text) + } + }, + ) + } + + PokitButton( + modifier = Modifier + .fillMaxWidth() + .align(Alignment.BottomCenter), + text = stringResource(id = pokitmons.pokit.login.R.string.next), + icon = null, + size = PokitButtonSize.LARGE, + enable = inputNicknameState.length >= NICKNAME_MIN_LENGTH, + onClick = { onNavigateToKeywordScreen() } + ) + } +} diff --git a/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameViewModel.kt b/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameViewModel.kt new file mode 100644 index 00000000..0b7678e8 --- /dev/null +++ b/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameViewModel.kt @@ -0,0 +1,15 @@ +package pokitmons.pokit.nickname + +import androidx.lifecycle.ViewModel +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow + +class InputNicknameViewModel : ViewModel() { + private val _inputNicknameState = MutableStateFlow("") + val inputNicknameState: StateFlow + get() = _inputNicknameState + + fun inputText(text: String) { + _inputNicknameState.value = text + } +} From 07492951ad70653aead0f50e7356cf7a306e6a2c Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 15 Jul 2024 22:39:59 +0900 Subject: [PATCH 28/38] =?UTF-8?q?[chore]=20string=20resource=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/login/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/login/src/main/res/values/strings.xml b/feature/login/src/main/res/values/strings.xml index 002ac0ef..cc30b3cd 100644 --- a/feature/login/src/main/res/values/strings.xml +++ b/feature/login/src/main/res/values/strings.xml @@ -9,6 +9,7 @@ Pokit에 사용할 닉네임을\n입력해주세요 내용을 입력해주세요. 한글, 영어, 숫자로만 입력이 가능합니다. + 최대 20자까지 입력 가능합니다. 어떤 분야에 관심이 있으세요? 최대 3개를 골라주시면,\n관련 콘텐츠를 추천해드릴게요! 스포츠/레저 From 69a57cad88835fa352217630fde277e20e61af89 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 15 Jul 2024 22:40:32 +0900 Subject: [PATCH 29/38] =?UTF-8?q?[ui]=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC,=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=ED=99=94=EB=A9=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokitmons/pokit/keyword/KeywordScreen.kt | 161 ++++++++++++++++++ .../pokit/success/SignUpSuccessScreen.kt | 81 +++++++++ 2 files changed, 242 insertions(+) create mode 100644 feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt create mode 100644 feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt diff --git a/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt b/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt new file mode 100644 index 00000000..3f9c6c4c --- /dev/null +++ b/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt @@ -0,0 +1,161 @@ +package pokitmons.pokit.keyword + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import pokitmons.pokit.core.ui.R as Ui +import pokitmons.pokit.core.ui.components.atom.button.PokitButton +import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize +import pokitmons.pokit.core.ui.components.atom.chip.PokitChip +import pokitmons.pokit.core.ui.components.atom.chip.attributes.PokitChipSize +import pokitmons.pokit.core.ui.theme.PokitTheme +import pokitmons.pokit.login.R as LoginStringResource + +@Composable +fun KeywordScreen( + onNavigateToSignUpScreen:() -> Unit, + popBackStack:() -> Unit +) { + Box( + modifier = Modifier + .fillMaxSize() + .padding(all = 20.dp) + .padding(bottom = 8.dp) + ) { + Column { + Icon(painter = painterResource(id = Ui.drawable.icon_24_arrow_left), contentDescription = null) + Spacer(modifier = Modifier.height(32.dp)) + Text( + text = stringResource(id = LoginStringResource.string.keyword_title), + style = PokitTheme.typography.title1 + ) + Spacer(modifier = Modifier.height(12.dp)) + Text( + text = stringResource(id = LoginStringResource.string.select_keyword), + style = PokitTheme.typography.title3 + ) + Spacer(modifier = Modifier.height(36.dp)) + + // TODO FlowRow도 사용해보기 + Column { + val categories: List> = listOf( + stringResource(id = LoginStringResource.string.sports_and_leisure), + stringResource(id = LoginStringResource.string.phrases_and_office), + stringResource(id = LoginStringResource.string.fashion), + stringResource(id = LoginStringResource.string.travel), + stringResource(id = LoginStringResource.string.economy_and_politics), + stringResource(id = LoginStringResource.string.movies_and_dramas), + stringResource(id = LoginStringResource.string.restaurants), + stringResource(id = LoginStringResource.string.interior), + stringResource(id = LoginStringResource.string.it), + stringResource(id = LoginStringResource.string.design), + stringResource(id = LoginStringResource.string.self_development), + stringResource(id = LoginStringResource.string.humor), + stringResource(id = LoginStringResource.string.music), + stringResource(id = LoginStringResource.string.job_info), + ).chunked(3) + + Row { + categories[0].forEach { category -> + PokitChip( + data = null, + size = PokitChipSize.MEDIUM, + text = category, + removeIconPosition = null, + onClickRemove = { }, + onClickItem = { } + ) + Spacer(modifier = Modifier.padding(start = 12.dp)) + } + } + + Spacer(modifier = Modifier.height(16.dp)) + + Row { + categories[1].forEach { category -> + PokitChip( + data = null, + size = PokitChipSize.MEDIUM, + text = category, + removeIconPosition = null, + onClickRemove = { }, + onClickItem = { } + ) + Spacer(modifier = Modifier.padding(start = 12.dp)) + } + } + + Spacer(modifier = Modifier.height(16.dp)) + + Row { + categories[2].forEach { category -> + PokitChip( + data = null, + size = PokitChipSize.MEDIUM, + text = category, + removeIconPosition = null, + onClickRemove = { }, + onClickItem = { } + ) + Spacer(modifier = Modifier.padding(start = 12.dp)) + } + } + + Spacer(modifier = Modifier.height(16.dp)) + + Row { + categories[3].forEach { category -> + PokitChip( + data = null, + size = PokitChipSize.MEDIUM, + text = category, + removeIconPosition = null, + onClickRemove = { }, + onClickItem = { } + ) + Spacer(modifier = Modifier.padding(start = 12.dp)) + } + } + + Spacer(modifier = Modifier.height(16.dp)) + + Row { + categories[4].forEach { category -> + PokitChip( + data = null, + size = PokitChipSize.MEDIUM, + text = category, + removeIconPosition = null, + onClickRemove = { }, + onClickItem = { } + ) + Spacer(modifier = Modifier.padding(start = 12.dp)) + } + } + } + } + + PokitButton( + modifier = Modifier + .fillMaxWidth() + .align(Alignment.BottomCenter), + text = stringResource(id = pokitmons.pokit.login.R.string.next), + icon = null, + size = PokitButtonSize.LARGE, + onClick = { onNavigateToSignUpScreen() } + ) + } +} diff --git a/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt b/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt new file mode 100644 index 00000000..87611e85 --- /dev/null +++ b/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt @@ -0,0 +1,81 @@ +package pokitmons.pokit.success + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.offset +import androidx.compose.foundation.layout.padding +import androidx.compose.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.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import pokitmons.pokit.core.ui.components.atom.button.PokitButton +import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize +import pokitmons.pokit.core.ui.theme.PokitTheme +import pokitmons.pokit.login.R + +@Composable +fun SignUpSuccessScreen( + onNavigateToMainScreen: () -> Unit +) { + Box( + modifier = Modifier + .padding(all = 20.dp) + .padding(bottom = 8.dp) + ) { + + Icon( + painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_left), + contentDescription = null + ) + + Column( + modifier = Modifier + .fillMaxSize() + .offset(y = (-110).dp), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) + { + Image( + painter = painterResource(id = R.drawable.ic_launcher_foreground), + contentDescription = "회원가입 완료 이미지" + ) + + Spacer(modifier = Modifier.height(28.dp)) + + + Text( + style = PokitTheme.typography.title1, + text = stringResource(id = R.string.sign_up_success) + ) + + Spacer(modifier = Modifier.height(12.dp)) + + Text( + textAlign = TextAlign.Center, + style = PokitTheme.typography.body1Bold, + text = stringResource(id = R.string.manage_links) + ) + } + + PokitButton( + modifier = Modifier + .fillMaxWidth() + .align(Alignment.BottomCenter), + text = stringResource(id = R.string.next), + icon = null, + size = PokitButtonSize.LARGE, + onClick = { onNavigateToMainScreen() }) + } +} From 58e9c056150f4f84192daee678565a91e5f54b1b Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Mon, 15 Jul 2024 22:41:33 +0900 Subject: [PATCH 30/38] =?UTF-8?q?[chore]=20=EC=BD=94=EB=94=A9=20=EC=BB=A8?= =?UTF-8?q?=EB=B2=A4=EC=85=98=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/pokitmons/pokit/MainActivity.kt | 4 ---- .../ui/components/atom/button/PokitLoginButton.kt | 6 +++--- .../java/pokitmons/pokit/keyword/KeywordScreen.kt | 8 ++++---- .../main/java/pokitmons/pokit/login/LoginScreen.kt | 8 ++++---- .../java/pokitmons/pokit/navigation/LoginNavHost.kt | 4 ++-- .../pokitmons/pokit/nickname/InputNicknameScreen.kt | 11 ++++++----- .../pokitmons/pokit/success/SignUpSuccessScreen.kt | 10 ++++------ .../java/pokitmons/pokit/terms/TermsCheckBoxItem.kt | 4 ++-- .../pokitmons/pokit/terms/TermsOfServiceScreen.kt | 8 ++++---- .../src/main/java/pokitmons/pokit/terms/TermsState.kt | 2 +- 10 files changed, 30 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/pokitmons/pokit/MainActivity.kt b/app/src/main/java/pokitmons/pokit/MainActivity.kt index 1e54da53..73948740 100644 --- a/app/src/main/java/pokitmons/pokit/MainActivity.kt +++ b/app/src/main/java/pokitmons/pokit/MainActivity.kt @@ -4,11 +4,7 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import pokitmons.pokit.core.ui.theme.PokitTheme -import pokitmons.pokit.keyword.KeywordScreen import pokitmons.pokit.navigation.LoginNavHost -import pokitmons.pokit.nickname.InputNicknameScreen -import pokitmons.pokit.success.SignUpSuccessScreen -import pokitmons.pokit.terms.TermsOfServiceScreen class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt index 1960ff22..f0a4e0f7 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt @@ -30,7 +30,7 @@ fun PokitLoginButton( modifier: Modifier = Modifier, onClick: () -> Unit, loginType: PokitLoginButtonType, - text: String + text: String, ) { val loginResource: PokitLoginResource = getLoginResource(loginType) @@ -76,14 +76,14 @@ private fun getLoginResource(loginType: PokitLoginButtonType): PokitLoginResourc iconTintColor = Color.White, textColor = Color.White, backgroundColor = Gray700, - borderColor = Gray700, + borderColor = Gray700 ) PokitLoginButtonType.GOOGLE -> PokitLoginResource( iconResourceId = R.drawable.icon_24_google, textColor = Gray900, backgroundColor = Color.White, - borderColor = Gray200, + borderColor = Gray200 ) } } diff --git a/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt b/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt index 3f9c6c4c..e240725f 100644 --- a/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt @@ -16,18 +16,18 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import pokitmons.pokit.core.ui.R as Ui import pokitmons.pokit.core.ui.components.atom.button.PokitButton import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize import pokitmons.pokit.core.ui.components.atom.chip.PokitChip import pokitmons.pokit.core.ui.components.atom.chip.attributes.PokitChipSize import pokitmons.pokit.core.ui.theme.PokitTheme +import pokitmons.pokit.core.ui.R as Ui import pokitmons.pokit.login.R as LoginStringResource @Composable fun KeywordScreen( - onNavigateToSignUpScreen:() -> Unit, - popBackStack:() -> Unit + onNavigateToSignUpScreen: () -> Unit, + popBackStack: () -> Unit, ) { Box( modifier = Modifier @@ -65,7 +65,7 @@ fun KeywordScreen( stringResource(id = LoginStringResource.string.self_development), stringResource(id = LoginStringResource.string.humor), stringResource(id = LoginStringResource.string.music), - stringResource(id = LoginStringResource.string.job_info), + stringResource(id = LoginStringResource.string.job_info) ).chunked(3) Row { diff --git a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt index 06c0305f..2f2a5fa1 100644 --- a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt @@ -31,17 +31,17 @@ fun LoginScreen( // TODO 서버 api 개발완료 후 viewmodel 연동 및 아키텍처 구축 Box( modifier = Modifier - .fillMaxSize(), + .fillMaxSize() ) { Column( modifier = Modifier .align(Alignment.BottomCenter) - .padding(start = 20.dp, end = 20.dp, bottom = 32.dp), + .padding(start = 20.dp, end = 20.dp, bottom = 32.dp) ) { PokitLoginButton( loginType = PokitLoginButtonType.APPLE, text = stringResource(id = R.string.apple_login), - onClick = { onNavigateToMainScreen() }, + onClick = { onNavigateToMainScreen() } ) Spacer(modifier = Modifier.height(8.dp)) @@ -49,7 +49,7 @@ fun LoginScreen( PokitLoginButton( loginType = PokitLoginButtonType.GOOGLE, text = stringResource(id = R.string.google_login), - onClick = { onNavigateToTermsOfServiceScreen() }, + onClick = { onNavigateToTermsOfServiceScreen() } ) } } diff --git a/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt b/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt index c1765930..a6285297 100644 --- a/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt +++ b/feature/login/src/main/java/pokitmons/pokit/navigation/LoginNavHost.kt @@ -20,7 +20,7 @@ fun LoginNavHost() { composable(route = LoginRoute.LoginScreen.name) { LoginScreen( onNavigateToTermsOfServiceScreen = { navController.navigate(route = LoginRoute.TermsOfServiceScreen.name) }, - onNavigateToMainScreen = { }, // TODO 메인 화면 구현후 수정 + onNavigateToMainScreen = { } // TODO 메인 화면 구현후 수정 ) } @@ -47,7 +47,7 @@ fun LoginNavHost() { composable(route = LoginRoute.SignUpSuccessScreen.name) { SignUpSuccessScreen( - onNavigateToMainScreen = { }, // TODO 메인 화면 구현후 수정 + onNavigateToMainScreen = { } // TODO 메인 화면 구현후 수정 ) } } diff --git a/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt b/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt index a53f3083..b79ccb03 100644 --- a/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt @@ -31,14 +31,15 @@ private const val NICKNAME_MIN_LENGTH = 1 // TODO 매직넘버를 포함하는 @Composable fun InputNicknameScreen( onNavigateToKeywordScreen: () -> Unit, - popBackStack: () -> Unit + popBackStack: () -> Unit, ) { val inputNicknameViewModel: InputNicknameViewModel = viewModel() // TODO hiltViewModel 마이그레이션 예정 val inputNicknameState by inputNicknameViewModel.inputNicknameState.collectAsState() - Box(modifier = Modifier - .padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp) - .fillMaxSize() + Box( + modifier = Modifier + .padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp) + .fillMaxSize() ) { Column() { Icon( @@ -74,7 +75,7 @@ fun InputNicknameScreen( if (text.length <= NICKNAME_MAX_LENGTH) { inputNicknameViewModel.inputText(text) } - }, + } ) } diff --git a/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt b/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt index 87611e85..20117922 100644 --- a/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt @@ -26,14 +26,13 @@ import pokitmons.pokit.login.R @Composable fun SignUpSuccessScreen( - onNavigateToMainScreen: () -> Unit + onNavigateToMainScreen: () -> Unit, ) { Box( modifier = Modifier .padding(all = 20.dp) .padding(bottom = 8.dp) ) { - Icon( painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_left), contentDescription = null @@ -45,8 +44,7 @@ fun SignUpSuccessScreen( .offset(y = (-110).dp), verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally - ) - { + ) { Image( painter = painterResource(id = R.drawable.ic_launcher_foreground), contentDescription = "회원가입 완료 이미지" @@ -54,7 +52,6 @@ fun SignUpSuccessScreen( Spacer(modifier = Modifier.height(28.dp)) - Text( style = PokitTheme.typography.title1, text = stringResource(id = R.string.sign_up_success) @@ -76,6 +73,7 @@ fun SignUpSuccessScreen( text = stringResource(id = R.string.next), icon = null, size = PokitButtonSize.LARGE, - onClick = { onNavigateToMainScreen() }) + onClick = { onNavigateToMainScreen() } + ) } } diff --git a/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt b/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt index 3a15d4d3..fdc1b2ec 100644 --- a/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt +++ b/feature/login/src/main/java/pokitmons/pokit/terms/TermsCheckBoxItem.kt @@ -19,9 +19,9 @@ import pokitmons.pokit.core.ui.theme.PokitTheme fun TermsCheckBoxItem( text: String, isChecked: Boolean, - click:() -> Unit + click: () -> Unit, ) { - Box(modifier = Modifier.fillMaxWidth(),) { + Box(modifier = Modifier.fillMaxWidth()) { Row(verticalAlignment = Alignment.CenterVertically) { PokitCheckbox( checked = isChecked, diff --git a/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt b/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt index 12822f4f..c5a26664 100644 --- a/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt @@ -32,7 +32,7 @@ import pokitmons.pokit.login.R @Composable fun TermsOfServiceScreen( onNavigateToInputNicknameScreen: () -> Unit, - popBackStack:() -> Unit, + popBackStack: () -> Unit, ) { val termsViewModel: TermsViewModel = viewModel() // TODO hiltViewModel 마이그레이션 예정 val termsState by termsViewModel.termsState.collectAsState() @@ -40,13 +40,13 @@ fun TermsOfServiceScreen( Box( modifier = Modifier .fillMaxSize() - .padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp), + .padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp) ) { Column { Icon( painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_left), contentDescription = "뒤로가기", - modifier = Modifier.clickable { popBackStack() }, + modifier = Modifier.clickable { popBackStack() } ) Spacer(modifier = Modifier.height(32.dp)) @@ -74,7 +74,7 @@ fun TermsOfServiceScreen( PokitCheckbox( style = PokitCheckboxStyle.STROKE, checked = termsState.isAllChecked, - onClick = { termsViewModel.checkAllTerms() }, + onClick = { termsViewModel.checkAllTerms() } ) Text( modifier = Modifier.padding(start = 16.dp), diff --git a/feature/login/src/main/java/pokitmons/pokit/terms/TermsState.kt b/feature/login/src/main/java/pokitmons/pokit/terms/TermsState.kt index 10733c6d..342655c5 100644 --- a/feature/login/src/main/java/pokitmons/pokit/terms/TermsState.kt +++ b/feature/login/src/main/java/pokitmons/pokit/terms/TermsState.kt @@ -4,5 +4,5 @@ data class TermsState( val isAllChecked: Boolean = false, val isPersonalDataChecked: Boolean = false, val isServiceChecked: Boolean = false, - val isMarketingChecked: Boolean = false + val isMarketingChecked: Boolean = false, ) From a114d27fcab85422c2a321ddb8a88b339080aa32 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Tue, 16 Jul 2024 21:05:24 +0900 Subject: [PATCH 31/38] =?UTF-8?q?[chore]=20loginbutton=20=ED=8C=A8?= =?UTF-8?q?=ED=82=A4=EC=A7=80=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/atom/{button => loginbutton}/PokitLoginButton.kt | 2 +- .../login/src/main/java/pokitmons/pokit/login/LoginScreen.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/{button => loginbutton}/PokitLoginButton.kt (98%) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt similarity index 98% rename from core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt rename to core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt index f0a4e0f7..ef53fcc9 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/button/PokitLoginButton.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt @@ -1,4 +1,4 @@ -package pokitmons.pokit.core.ui.components.atom.button +package pokitmons.pokit.core.ui.components.atom.loginbutton import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement diff --git a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt index 2f2a5fa1..f869ed43 100644 --- a/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/login/LoginScreen.kt @@ -20,8 +20,8 @@ import androidx.credentials.GetCredentialRequest import com.google.android.libraries.identity.googleid.GetGoogleIdOption import com.google.android.libraries.identity.googleid.GoogleIdTokenCredential import kotlinx.coroutines.launch -import pokitmons.pokit.core.ui.components.atom.button.PokitLoginButton import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitLoginButtonType +import pokitmons.pokit.core.ui.components.atom.loginbutton.PokitLoginButton @Composable fun LoginScreen( From 410f2fbb9166961974d765f28b9de5934ed09676 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Tue, 16 Jul 2024 21:24:29 +0900 Subject: [PATCH 32/38] =?UTF-8?q?[chore]=20string=20=EB=B0=8F=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20resource=20casting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokitmons/pokit/keyword/KeywordScreen.kt | 34 +++++++++---------- .../pokit/nickname/InputNicknameScreen.kt | 13 +++---- .../pokit/terms/TermsOfServiceScreen.kt | 17 +++++----- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt b/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt index e240725f..3a8f2731 100644 --- a/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt @@ -22,7 +22,7 @@ import pokitmons.pokit.core.ui.components.atom.chip.PokitChip import pokitmons.pokit.core.ui.components.atom.chip.attributes.PokitChipSize import pokitmons.pokit.core.ui.theme.PokitTheme import pokitmons.pokit.core.ui.R as Ui -import pokitmons.pokit.login.R as LoginStringResource +import pokitmons.pokit.login.R as Login @Composable fun KeywordScreen( @@ -39,12 +39,12 @@ fun KeywordScreen( Icon(painter = painterResource(id = Ui.drawable.icon_24_arrow_left), contentDescription = null) Spacer(modifier = Modifier.height(32.dp)) Text( - text = stringResource(id = LoginStringResource.string.keyword_title), + text = stringResource(id = Login.string.keyword_title), style = PokitTheme.typography.title1 ) Spacer(modifier = Modifier.height(12.dp)) Text( - text = stringResource(id = LoginStringResource.string.select_keyword), + text = stringResource(id = Login.string.select_keyword), style = PokitTheme.typography.title3 ) Spacer(modifier = Modifier.height(36.dp)) @@ -52,20 +52,20 @@ fun KeywordScreen( // TODO FlowRow도 사용해보기 Column { val categories: List> = listOf( - stringResource(id = LoginStringResource.string.sports_and_leisure), - stringResource(id = LoginStringResource.string.phrases_and_office), - stringResource(id = LoginStringResource.string.fashion), - stringResource(id = LoginStringResource.string.travel), - stringResource(id = LoginStringResource.string.economy_and_politics), - stringResource(id = LoginStringResource.string.movies_and_dramas), - stringResource(id = LoginStringResource.string.restaurants), - stringResource(id = LoginStringResource.string.interior), - stringResource(id = LoginStringResource.string.it), - stringResource(id = LoginStringResource.string.design), - stringResource(id = LoginStringResource.string.self_development), - stringResource(id = LoginStringResource.string.humor), - stringResource(id = LoginStringResource.string.music), - stringResource(id = LoginStringResource.string.job_info) + stringResource(id = Login.string.sports_and_leisure), + stringResource(id = Login.string.phrases_and_office), + stringResource(id = Login.string.fashion), + stringResource(id = Login.string.travel), + stringResource(id = Login.string.economy_and_politics), + stringResource(id = Login.string.movies_and_dramas), + stringResource(id = Login.string.restaurants), + stringResource(id = Login.string.interior), + stringResource(id = Login.string.it), + stringResource(id = Login.string.design), + stringResource(id = Login.string.self_development), + stringResource(id = Login.string.humor), + stringResource(id = Login.string.music), + stringResource(id = Login.string.job_info) ).chunked(3) Row { diff --git a/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt b/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt index b79ccb03..511488b0 100644 --- a/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt @@ -19,7 +19,8 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel -import pokitmons.pokit.core.ui.R +import pokitmons.pokit.core.ui.R as UI +import pokitmons.pokit.login.R as Login import pokitmons.pokit.core.ui.components.atom.button.PokitButton import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize import pokitmons.pokit.core.ui.components.block.labeledinput.LabeledInput @@ -44,7 +45,7 @@ fun InputNicknameScreen( Column() { Icon( modifier = Modifier.clickable { popBackStack() }, - painter = painterResource(id = R.drawable.icon_24_arrow_left), + painter = painterResource(id = UI.drawable.icon_24_arrow_left), contentDescription = "뒤로가기" ) @@ -52,7 +53,7 @@ fun InputNicknameScreen( Text( style = PokitTheme.typography.title1, - text = stringResource(id = pokitmons.pokit.login.R.string.input_nickname_title) + text = stringResource(id = Login.string.input_nickname_title) ) Spacer(modifier = Modifier.padding(top = 28.dp)) @@ -65,12 +66,12 @@ fun InputNicknameScreen( inputText = inputNicknameState, maxLength = NICKNAME_MAX_LENGTH, sub = if (inputNicknameState.length < NICKNAME_MAX_LENGTH) { - stringResource(id = pokitmons.pokit.login.R.string.input_restriction_message) + stringResource(id = Login.string.input_restriction_message) } else { - stringResource(id = pokitmons.pokit.login.R.string.input_max_length) + stringResource(id = Login.string.input_max_length) }, isError = inputNicknameState.length > NICKNAME_MAX_LENGTH, - hintText = stringResource(id = pokitmons.pokit.login.R.string.input_nickname_hint), + hintText = stringResource(id = Login.string.input_nickname_hint), onChangeText = { text -> if (text.length <= NICKNAME_MAX_LENGTH) { inputNicknameViewModel.inputText(text) diff --git a/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt b/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt index c5a26664..d950a515 100644 --- a/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/terms/TermsOfServiceScreen.kt @@ -27,7 +27,8 @@ import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize import pokitmons.pokit.core.ui.components.atom.checkbox.PokitCheckbox import pokitmons.pokit.core.ui.components.atom.checkbox.attributes.PokitCheckboxStyle import pokitmons.pokit.core.ui.theme.PokitTheme -import pokitmons.pokit.login.R +import pokitmons.pokit.core.ui.R as UI +import pokitmons.pokit.login.R as Login @Composable fun TermsOfServiceScreen( @@ -44,7 +45,7 @@ fun TermsOfServiceScreen( ) { Column { Icon( - painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_left), + painter = painterResource(id = UI.drawable.icon_24_arrow_left), contentDescription = "뒤로가기", modifier = Modifier.clickable { popBackStack() } ) @@ -52,7 +53,7 @@ fun TermsOfServiceScreen( Spacer(modifier = Modifier.height(32.dp)) Text( - text = stringResource(id = R.string.service_privacy_title), + text = stringResource(id = Login.string.service_privacy_title), style = PokitTheme.typography.title1 ) @@ -78,7 +79,7 @@ fun TermsOfServiceScreen( ) Text( modifier = Modifier.padding(start = 16.dp), - text = stringResource(id = R.string.privacy_all_agree), + text = stringResource(id = Login.string.privacy_all_agree), style = PokitTheme.typography.body1Bold ) } @@ -91,21 +92,21 @@ fun TermsOfServiceScreen( .fillMaxWidth() ) { TermsCheckBoxItem( - text = stringResource(id = R.string.personal_data_agree), + text = stringResource(id = Login.string.personal_data_agree), isChecked = termsState.isPersonalDataChecked, click = { termsViewModel.checkPersonalData() } ) Spacer(modifier = Modifier.padding(top = 16.dp)) TermsCheckBoxItem( - text = stringResource(id = R.string.service_agree), + text = stringResource(id = Login.string.service_agree), isChecked = termsState.isServiceChecked, click = { termsViewModel.checkServiceTerm() } ) Spacer(modifier = Modifier.padding(top = 16.dp)) TermsCheckBoxItem( - text = stringResource(id = R.string.marketing_agree), + text = stringResource(id = Login.string.marketing_agree), isChecked = termsState.isMarketingChecked, click = { termsViewModel.checkMarketing() } ) @@ -116,7 +117,7 @@ fun TermsOfServiceScreen( modifier = Modifier .fillMaxWidth() .align(Alignment.BottomCenter), - text = stringResource(id = R.string.next), + text = stringResource(id = Login.string.next), icon = null, size = PokitButtonSize.LARGE, enable = termsState.isPersonalDataChecked && termsState.isServiceChecked, From fb89a58165cd537a557ab0f8b528c1bfdc5e4bc8 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Tue, 16 Jul 2024 21:35:34 +0900 Subject: [PATCH 33/38] =?UTF-8?q?[chore]=20=EC=BB=A8=EB=B2=A4=EC=85=98=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt b/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt index 511488b0..0ae25982 100644 --- a/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/nickname/InputNicknameScreen.kt @@ -19,12 +19,12 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel -import pokitmons.pokit.core.ui.R as UI -import pokitmons.pokit.login.R as Login import pokitmons.pokit.core.ui.components.atom.button.PokitButton import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize import pokitmons.pokit.core.ui.components.block.labeledinput.LabeledInput import pokitmons.pokit.core.ui.theme.PokitTheme +import pokitmons.pokit.core.ui.R as UI +import pokitmons.pokit.login.R as Login private const val NICKNAME_MAX_LENGTH = 10 // TODO 매직넘버를 포함하는 모듈화 추가 후 마이그레이션 예정 private const val NICKNAME_MIN_LENGTH = 1 // TODO 매직넘버를 포함하는 모듈화 추가 후 마이그레이션 예정 From 4f29c30d8886f6e18508e1fad27b6cf5a0ca20dc Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Tue, 16 Jul 2024 21:43:25 +0900 Subject: [PATCH 34/38] =?UTF-8?q?[chore]=20=EC=BB=A8=EB=B2=A4=EC=85=98=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/block/pokitlist/PokitList.kt | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/PokitList.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/PokitList.kt index c947b952..9d346866 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/PokitList.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/PokitList.kt @@ -6,17 +6,12 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.painterResource -import pokitmons.pokit.core.ui.R import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import pokitmons.pokit.core.ui.components.block.pokitlist.attributes.PokitListState @@ -27,9 +22,6 @@ fun PokitList( item: T, title: String, sub: String, - onClickKebab: (T) -> Unit, - modifier: Modifier = Modifier, - state: PokitListState = PokitListState.DISABLE, onClickItem: (T) -> Unit, modifier: Modifier = Modifier, state: PokitListState = PokitListState.DEFAULT, @@ -64,20 +56,6 @@ fun PokitList( style = PokitTheme.typography.detail1.copy(color = subTextColor) ) } - - IconButton( - onClick = { onClickKebab(item) }, - modifier = Modifier - .padding(0.dp) - .align(Alignment.Top), - enabled = state != PokitListState.DISABLE - ) { - Icon( - painter = painterResource(id = R.drawable.icon_24_kebab), - contentDescription = null, - modifier = Modifier.size(24.dp) - ) - } } } From 5b664345d59b4e4328ce00ce2c1b5e8c80ba99f1 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Tue, 16 Jul 2024 21:49:08 +0900 Subject: [PATCH 35/38] =?UTF-8?q?[chore]=20Preview=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokit/core/ui/components/block/pokitlist/Preview.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/Preview.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/Preview.kt index 74807d79..b245fcba 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/Preview.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/block/pokitlist/Preview.kt @@ -23,7 +23,6 @@ fun PokitListPreview() { item = "STRING", title = "카테고리입니당", sub = "15개 항목", - onClickKebab = {}, onClickItem = {} ) @@ -32,7 +31,6 @@ fun PokitListPreview() { item = "STRING", title = "카테고리입니당", sub = "15개 항목", - onClickKebab = {}, onClickItem = {} ) @@ -41,7 +39,6 @@ fun PokitListPreview() { item = "STRING", title = "카테고리입니당", sub = "15개 항목", - onClickKebab = {}, onClickItem = {} ) } From 44b3f0853712b61f2a2a3b828106051a40538f44 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Wed, 17 Jul 2024 21:14:08 +0900 Subject: [PATCH 36/38] =?UTF-8?q?[chore]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EC=86=8D=EC=84=B1=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atom/loginbutton/PokitLoginButton.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt index ef53fcc9..5ea0fbbb 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt @@ -63,27 +63,28 @@ fun PokitLoginButton( .padding(start = 12.dp), text = text, color = loginResource.textColor, - style = PokitTheme.typography.label3Regular + style = PokitTheme.typography.label1Regular ) } } } +@Composable private fun getLoginResource(loginType: PokitLoginButtonType): PokitLoginResource { return when (loginType) { PokitLoginButtonType.APPLE -> PokitLoginResource( iconResourceId = R.drawable.icon_24_apple, - iconTintColor = Color.White, - textColor = Color.White, - backgroundColor = Gray700, - borderColor = Gray700 + iconTintColor = PokitTheme.colors.inverseWh, + textColor = PokitTheme.colors.inverseWh, + backgroundColor = PokitTheme.colors.backgroundTertiary, + borderColor = PokitTheme.colors.backgroundTertiary ) PokitLoginButtonType.GOOGLE -> PokitLoginResource( iconResourceId = R.drawable.icon_24_google, - textColor = Gray900, - backgroundColor = Color.White, - borderColor = Gray200 + textColor = PokitTheme.colors.textPrimary, + backgroundColor = PokitTheme.colors.backgroundBase, + borderColor = PokitTheme.colors.borderSecondary ) } } From f70c017d66f6d466d54e582ec025107253c11f30 Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Wed, 17 Jul 2024 21:14:26 +0900 Subject: [PATCH 37/38] =?UTF-8?q?[chore]=20=EB=AF=B8=EC=82=AC=EC=9A=A9=20?= =?UTF-8?q?=EB=A6=AC=EC=86=8C=EC=8A=A4=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/ui/components/atom/loginbutton/PokitLoginButton.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt index 5ea0fbbb..a42618f9 100644 --- a/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt +++ b/core/ui/src/main/java/pokitmons/pokit/core/ui/components/atom/loginbutton/PokitLoginButton.kt @@ -14,16 +14,12 @@ 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.unit.dp import pokitmons.pokit.core.ui.R import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitLoginButtonType import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitLoginResource import pokitmons.pokit.core.ui.theme.PokitTheme -import pokitmons.pokit.core.ui.theme.color.Gray200 -import pokitmons.pokit.core.ui.theme.color.Gray700 -import pokitmons.pokit.core.ui.theme.color.Gray900 @Composable fun PokitLoginButton( From bd0474a24b0ee000d5c404916bbe8d437be538da Mon Sep 17 00:00:00 2001 From: jiwon2724 Date: Wed, 17 Jul 2024 21:16:49 +0900 Subject: [PATCH 38/38] =?UTF-8?q?[chore]=20padding=20=EC=86=8D=EC=84=B1=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt b/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt index 20117922..dd195ddc 100644 --- a/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt +++ b/feature/login/src/main/java/pokitmons/pokit/success/SignUpSuccessScreen.kt @@ -30,8 +30,7 @@ fun SignUpSuccessScreen( ) { Box( modifier = Modifier - .padding(all = 20.dp) - .padding(bottom = 8.dp) + .padding(start = 20.dp, end = 20.dp, top = 20.dp, bottom = 28.dp) ) { Icon( painter = painterResource(id = pokitmons.pokit.core.ui.R.drawable.icon_24_arrow_left),