From 21eaac885c7576d81f394ace9633d0baebfcf20c Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 02:53:11 +0900 Subject: [PATCH 01/25] =?UTF-8?q?[refacor]=20:=20=EB=94=94=EC=9E=90?= =?UTF-8?q?=EC=9D=B4=EB=84=88,=20=EA=B0=9C=EB=B0=9C=EC=9E=90=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=EC=BD=98=20svg=20=ED=8C=8C=EC=9D=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/drawable/ic_designer_18.png | Bin 8480 -> 0 bytes .../src/main/res/drawable/ic_designer_18.xml | 55 ++++++++++++++++++ .../src/main/res/drawable/ic_developer_18.png | Bin 6327 -> 0 bytes .../src/main/res/drawable/ic_developer_18.xml | 49 ++++++++++++++++ 4 files changed, 104 insertions(+) delete mode 100644 core/designsystem/src/main/res/drawable/ic_designer_18.png create mode 100644 core/designsystem/src/main/res/drawable/ic_designer_18.xml delete mode 100644 core/designsystem/src/main/res/drawable/ic_developer_18.png create mode 100644 core/designsystem/src/main/res/drawable/ic_developer_18.xml diff --git a/core/designsystem/src/main/res/drawable/ic_designer_18.png b/core/designsystem/src/main/res/drawable/ic_designer_18.png deleted file mode 100644 index e22375c901ccc8891dc5e7a7d2d197db4c6ed698..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8480 zcmV+*A>ZDKP)@~0drDELIAGL9O(c600d`2O+f$vv5yPifV&Yd^!j<8<}mvVY_ zA(xvX+2&NEY}8t&k$@z}WXTTNhN)UIWLc7B%d!<&mTlX#Oh~q_C`wUMTXe1JsZ_$Cx8~u~%M_E-YRa1AXe(k5>WcacF z^Y{P12PaVeAOPKZ>#bU~rq$`i+)|^gFE43t}O2PDAc>jD&~Snjz=z!~&z!!Te=HbRl`OVt&X*RFf$q5kpKUBz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3!bqrAE>}Qxbpo3=ZzaHdLb^^rW0AWo)SMZKlmp`d==1U^<=+99IqK-|zP8H% O0000 + + + + + + + + + + + + + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_developer_18.png b/core/designsystem/src/main/res/drawable/ic_developer_18.png deleted file mode 100644 index 601d36387c821191ebbf473593bde4a3fd01702e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6327 zcmV;o7)a-dP)@~0drDELIAGL9O(c600d`2O+f$vv5yPBqSjrE9p+sOS)fozwY<$Ieuro=XE+sr#s+39K5;j z-FNRj=X~e)`+nc~oznuZm)Fbd<@NH1D*~@^QFkK2^;m=q3{eJ-;S5DSKNjwUZe7w0i<+Y58)cZ^HDUd-Hg`Fi_o;G zh+>yOzLmc=@vemDoO>YUF$$zSs(lKhFQzDO8^G}6JCRl&Be3^l0MCn?3E!(&UUh)9 z#Y|j+b@_bL-zHs`ya!$HPf%LNnv48Zo}wAbUH9k2-amd2=>I7&`1k}WyM75(`wEJ9 zNW2vlyb9%22WaHGxFMHs{O98GJJyN$H#lHsQ!PPCCxD55p!@{T_dpe+`@YXtejeB2 zDIuVgx-${tE{U^HUR8h&+=I^cHayXE&b!y-mwpf^bWW;L;nYn!NgtI4X`IJ#pt27b z_z5ul#12%;pTu!IsNGJfE%eo!q!2=37A3)}P}CDxpnil;5u9&JiPgwyj%h&VGWw7w ze%2k=2i&35)Q5ggQUG!-K;t=3U4I5F{P4LbwEQpHal3j1c?}L8eKg10XJrI=oW;V% zB={NLo%ZAFWX>*vgE2Bgq5Lv(Y8*moBKDx1qR7ejsO+oI{q;c8NErA;!frI54=nz8 zqwM+S7n89bZ8=}1udx|hXaqOUn8?o>Kn9$L@iE!3`U}a@kCa3@3~c)s3=NK=c;tCB zF5JdQe!lILQnrsKVtE2~ps2{IR0NdgYKZ9IJyN^c7*M0Ti4sKT4F%P6@0Zk%$I86$ zpZX>OC1&bsXU~Ej#5+-1{l#SIUpF9WfnbAkE!`L!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k)GgjVMF_GNY*=Y6^Nr#)OnTZkdt-N=c#36ZFS^2B`~OS*K9z1;w-YhNE`X96IJ_1 zBi4$Fd{yHDkt<$_GXV%Pf3;MF1!l!mShv#LQmy79u@p~&`mdO$#LQBYK3B=O;Nj-`TrB)I(V&C zv^1!qNajMVCEd93A|lIZnt&{iR7bMm`ib9ziH5*X?_Men1~G=tbmGN>TCHGy$(cV# z*WRHg2n}yoec7FD(*o$3{XNa(nss(7irobz^`Bpp55{ZxFpqL7B=Rla=!}=@+|Dfv zizv){p#0}>4vDc$#{^Jh7SiK2uTYOtbxo3!+EGo5+4M|nxkP(KL#G;Uz8up5s1dS> z+IX(b)7a=_*0c#yd8Cm#C5ud^0e%FdQS_oLbR-J9G1sJ%rV?ITc`(CuM8CPZ0|&{d z{$O00%h}ny4+y~MnBI~rodES)+wyu#(px8EG38WabQleypmTC**;Jl57a=ga_AW(Z z?f_a#2a~X9>V`gEiO7_1W*`1m5u|lEA$pA~(PTj(%NhumO7Wpy)f2H%=g7E827vAN t + + + + + + + + + + + + + + + + + From 45b49448764e842735b33653149a3e40d3e41e40 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 02:55:13 +0900 Subject: [PATCH 02/25] =?UTF-8?q?[refactor]=20:=20FunchButton=20[Full,=20L?= =?UTF-8?q?arge]=20=ED=83=80=EC=9E=85=20ContentVerticalPadding=20=ED=94=BC?= =?UTF-8?q?=EA=B7=B8=EB=A7=88=EC=97=90=20=EB=A7=9E=EA=B2=8C=EB=81=94=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 --- .../src/main/java/com/moya/funch/component/Button.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/designsystem/src/main/java/com/moya/funch/component/Button.kt b/core/designsystem/src/main/java/com/moya/funch/component/Button.kt index 81683120..3d83ba5f 100644 --- a/core/designsystem/src/main/java/com/moya/funch/component/Button.kt +++ b/core/designsystem/src/main/java/com/moya/funch/component/Button.kt @@ -43,12 +43,13 @@ import com.moya.funch.theme.Gray800 import com.moya.funch.theme.Gray900 import com.moya.funch.theme.Lemon500 import com.moya.funch.theme.Lemon900 +import com.moya.funch.theme.White import com.moya.funch.theme.Yellow500 import com.moya.funch.theme.funchTypography enum class FunchButtonType(val shape: Shape, val contentVerticalPadding: Dp, val textStyle: TextStyle) { - Full(RoundedCornerShape(16.dp), 21.dp, funchTypography.sbt1), - Large(RoundedCornerShape(16.dp), 21.dp, funchTypography.sbt1), + Full(RoundedCornerShape(16.dp), 20.5f.dp, funchTypography.sbt1), + Large(RoundedCornerShape(16.dp), 20.5f.dp, funchTypography.sbt1), Medium(RoundedCornerShape(16.dp), 16.dp, funchTypography.sbt2), Small(RoundedCornerShape(12.dp), 12.dp, funchTypography.b), XSmall(RoundedCornerShape(12.dp), 8.dp, funchTypography.b) @@ -139,7 +140,7 @@ fun FunchSubButton( ) { val color = if (enabled) { - FunchTheme.colors.white + White } else { Gray400 } From 886f298c92a180de2a362e4a1012e6dab7acce8f Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 02:57:40 +0900 Subject: [PATCH 03/25] =?UTF-8?q?[refactor]=20:=20FunchTextField=204?= =?UTF-8?q?=EC=A2=85=20=EC=97=90=EB=9F=AC=EC=83=81=ED=83=9C=EC=9D=BC?= =?UTF-8?q?=EB=95=8C=20border=20=EB=B0=94=EB=80=8C=EA=B2=8C=EB=81=94=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20FunchErrorCaption=20=ED=85=8D?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=ED=95=84=EB=93=9C=EB=82=B4=20=EC=82=BD?= =?UTF-8?q?=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/moya/funch/component/TextField.kt | 224 ++++++++++-------- 1 file changed, 122 insertions(+), 102 deletions(-) diff --git a/core/designsystem/src/main/java/com/moya/funch/component/TextField.kt b/core/designsystem/src/main/java/com/moya/funch/component/TextField.kt index c4aa8e17..33ce67ca 100644 --- a/core/designsystem/src/main/java/com/moya/funch/component/TextField.kt +++ b/core/designsystem/src/main/java/com/moya/funch/component/TextField.kt @@ -86,16 +86,16 @@ fun FunchDefaultTextField( .height(56.dp) .background(Gray800, RoundedCornerShape(16.dp)) .then( - if (isFocus) { + if (isError) { Modifier.border( width = 1.dp, - color = Color.White, + color = Coral500, shape = RoundedCornerShape(16.dp) ) - } else if (isError) { + } else if (isFocus) { Modifier.border( width = 1.dp, - color = Coral500, + color = Color.White, shape = RoundedCornerShape(16.dp) ) } else { @@ -126,6 +126,7 @@ fun FunchMaxLengthTextField( onValueChange: (String) -> Unit, maxLength: Int, hint: String, + errorText: String, isError: Boolean = false, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, isFocus: Boolean = interactionSource.collectIsFocusedAsState().value, @@ -150,60 +151,73 @@ fun FunchMaxLengthTextField( keyboardActions = keyboardActions, interactionSource = interactionSource, decorationBox = { innerTextField -> - Row( - modifier = - Modifier - .fillMaxWidth() - .height(56.dp) - .background(Gray800, RoundedCornerShape(16.dp)) - .then( - if (isFocus) { - Modifier.border( - width = 1.dp, - color = Color.White, - shape = RoundedCornerShape(16.dp) - ) - } else if (isError) { - Modifier.border( - width = 1.dp, - color = Coral500, - shape = RoundedCornerShape(16.dp) + Column(modifier = Modifier.height((56 + 24).dp)) { + Row( + modifier = + Modifier + .fillMaxWidth() + .height(56.dp) + .background(Gray800, RoundedCornerShape(16.dp)) + .then( + if (isError) { + Modifier.border( + width = 1.dp, + color = Coral500, + shape = RoundedCornerShape(16.dp) + ) + } else if (isFocus) { + Modifier.border( + width = 1.dp, + color = Color.White, + shape = RoundedCornerShape(16.dp) + ) + } else { + Modifier + } + ) + .padding(horizontal = 16.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween + ) { + Box { + if (value.isEmpty()) { + Text( + text = hint, + color = Gray400, + fontSize = 14.sp, + style = FunchTheme.typography.b ) - } else { - Modifier } - ) - .padding(horizontal = 16.dp), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.SpaceBetween - ) { - Box { - if (value.isEmpty()) { - Text( - text = hint, - color = Gray400, + innerTextField() + } + + Text( + text = + annotatedStringMaxLengthType( + isError = isError, + value = value, + maxLength = maxLength + ), + style = + TextStyle( fontSize = 14.sp, - style = FunchTheme.typography.b + lineHeight = FunchTheme.typography.b.lineHeight, + fontFamily = FunchTheme.typography.b.fontFamily, + fontWeight = FunchTheme.typography.b.fontWeight ) - } - innerTextField() + ) } - - Text( - text = - annotatedStringMaxLengthType( + if (isError) { + FunchErrorCaption( + modifier = Modifier + .padding( + start = 8.dp, + top = 4.dp + ), isError = isError, - value = value, - maxLength = maxLength - ), - style = - TextStyle( - fontSize = 14.sp, - lineHeight = FunchTheme.typography.b.lineHeight, - fontFamily = FunchTheme.typography.b.fontFamily, - fontWeight = FunchTheme.typography.b.fontWeight + errorText = errorText ) - ) + } } } ) @@ -216,6 +230,7 @@ fun FunchIconTextField( onValueChange: (String) -> Unit, hint: String, iconType: FunchIcon, + errorText: String, isError: Boolean = false, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, isFocus: Boolean = interactionSource.collectIsFocusedAsState().value, @@ -240,48 +255,61 @@ fun FunchIconTextField( keyboardActions = keyboardActions, interactionSource = interactionSource, decorationBox = { innerTextField -> - Row( - modifier = - Modifier - .fillMaxWidth() - .height(56.dp) - .background(Gray800, RoundedCornerShape(16.dp)) - .then( - if (isFocus) { - Modifier.border( - width = 1.dp, - color = Color.White, - shape = RoundedCornerShape(16.dp) - ) - } else if (isError) { - Modifier.border( - width = 1.dp, - color = Coral500, - shape = RoundedCornerShape(16.dp) + Column(modifier = Modifier.height((56 + 24).dp)) { + Row( + modifier = + Modifier + .fillMaxWidth() + .height(56.dp) + .background(Gray800, RoundedCornerShape(16.dp)) + .then( + if (isError) { + Modifier.border( + width = 1.dp, + color = Coral500, + shape = RoundedCornerShape(16.dp) + ) + } else if (isFocus) { + Modifier.border( + width = 1.dp, + color = Color.White, + shape = RoundedCornerShape(16.dp) + ) + } else { + Modifier + } + ) + .padding(horizontal = 16.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painter = painterResource(id = iconType.resId), + contentDescription = iconType.description, + tint = iconType.tint + ) + Spacer(modifier = Modifier.width(8.dp)) + Box { + if (value.isEmpty()) { + Text( + text = hint, + color = Gray400, + fontSize = 14.sp, + style = FunchTheme.typography.b ) - } else { - Modifier } - ) - .padding(horizontal = 16.dp), - verticalAlignment = Alignment.CenterVertically - ) { - Icon( - painter = painterResource(id = iconType.resId), - contentDescription = iconType.description, - tint = iconType.tint - ) - Spacer(modifier = Modifier.width(8.dp)) - Box { - if (value.isEmpty()) { - Text( - text = hint, - color = Gray400, - fontSize = 14.sp, - style = FunchTheme.typography.b - ) + innerTextField() } - innerTextField() + } + if (isError) { + FunchErrorCaption( + modifier = Modifier + .padding( + start = 8.dp, + top = 4.dp + ), + isError = isError, + errorText = errorText + ) } } } @@ -407,8 +435,8 @@ private fun Preview1() { @Preview("MaxLengthType", showBackground = true, backgroundColor = 0xFF2C2C2C) @Composable private fun Preview2() { - var text by remember { mutableStateOf("") } - val isError = remember { mutableStateOf(false) } + var text by remember { mutableStateOf("ghg홓") } + val isError = remember { mutableStateOf(true) } val interactionSource = remember { MutableInteractionSource() } val isFocused by interactionSource.collectIsFocusedAsState() val maxLength = 9 @@ -435,12 +463,8 @@ private fun Preview2() { hint = "최대 ${maxLength}글자", isError = isError.value, interactionSource = interactionSource, - isFocus = isFocused - ) - FunchErrorCaption( - modifier = Modifier.padding(top = 4.dp, start = 4.dp), - isError = isError.value, - errorText = if (isError.value) "최대 ${maxLength}글자까지 입력할 수 있어요" else "" + isFocus = isFocused, + errorText = "최대 ${maxLength}글자를 초과했어요" ) } } @@ -464,10 +488,6 @@ private fun Preview3() { description = "", tint = Gray500 ), - isError = isError.value - ) - FunchErrorCaption( - modifier = Modifier.padding(top = 4.dp, start = 4.dp), isError = isError.value, errorText = "존재하지 않는 지하철역이에요" ) From 067d52a6bd66668bf18364e4c70458d9b78391b4 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 02:59:24 +0900 Subject: [PATCH 04/25] =?UTF-8?q?[refactor]=20:=20FunchFeedbackButton=20Pu?= =?UTF-8?q?blic=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/moya/funch/ui/FunchFeedbackButton.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/designsystem/src/main/java/com/moya/funch/ui/FunchFeedbackButton.kt b/core/designsystem/src/main/java/com/moya/funch/ui/FunchFeedbackButton.kt index 04e6ffb6..837c37e2 100644 --- a/core/designsystem/src/main/java/com/moya/funch/ui/FunchFeedbackButton.kt +++ b/core/designsystem/src/main/java/com/moya/funch/ui/FunchFeedbackButton.kt @@ -18,7 +18,7 @@ import com.moya.funch.theme.FunchTheme import com.moya.funch.theme.Gray900 @Composable -internal fun FunchFeedbackButton(enabled: Boolean = true, onClick: () -> Unit) { +fun FunchFeedbackButton(enabled: Boolean = true, onClick: () -> Unit) { FunchSubButton( modifier = Modifier.wrapContentSize(), enabled = enabled, From c65ca5f39cd6bf706775cb27960e1ce89bee52c0 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 03:01:31 +0900 Subject: [PATCH 05/25] =?UTF-8?q?[feat]=20:=20=EB=8F=84=EB=A9=94=EC=9D=B8?= =?UTF-8?q?=20Entity=20Blood=EC=97=90=20=EC=86=8D=EC=84=B1=EA=B0=92?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20Blood=20=EC=B0=BE=EC=95=84=EC=84=9C=20?= =?UTF-8?q?=EB=B0=98=ED=99=98=ED=95=B4=EC=A3=BC=EB=8A=94=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20formType()=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/domain/src/main/java/com/moya/funch/entity/Blood.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/domain/src/main/java/com/moya/funch/entity/Blood.kt b/core/domain/src/main/java/com/moya/funch/entity/Blood.kt index 6217db2b..69d556d8 100644 --- a/core/domain/src/main/java/com/moya/funch/entity/Blood.kt +++ b/core/domain/src/main/java/com/moya/funch/entity/Blood.kt @@ -6,4 +6,11 @@ enum class Blood(val type: String) { AB("AB형"), O("O형"), IDLE("idle") + ; + + companion object { + fun formType(type: String): Blood { + return entries.find { it.type == type } ?: IDLE + } + } } From 9589a3093df184b20de00e592a46b8c99acd2ffe Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 03:02:13 +0900 Subject: [PATCH 06/25] =?UTF-8?q?[refactor]=20:=20=EB=8F=84=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20Entity=20Profile=EC=9D=98=20subways=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=ED=99=94=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/moya/funch/entity/profile/Profile.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/domain/src/main/java/com/moya/funch/entity/profile/Profile.kt b/core/domain/src/main/java/com/moya/funch/entity/profile/Profile.kt index b6ca83db..10671d64 100644 --- a/core/domain/src/main/java/com/moya/funch/entity/profile/Profile.kt +++ b/core/domain/src/main/java/com/moya/funch/entity/profile/Profile.kt @@ -15,7 +15,7 @@ data class Profile( val clubs: List = emptyList(), val mbti: Mbti = Mbti.IDLE, val blood: Blood = Blood.IDLE, - val subways: List = emptyList(), + val subways: List = listOf(SubwayStation()), val viewCount: Int = 0 ) { init { From 2ee6a25bc67dfd389d634054ecc9a14bff1ebdab Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 03:03:05 +0900 Subject: [PATCH 07/25] =?UTF-8?q?[feat]=20:=20FunchLabel=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=A0=9C=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/moya/funch/component/Label.kt | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 core/designsystem/src/main/java/com/moya/funch/component/Label.kt diff --git a/core/designsystem/src/main/java/com/moya/funch/component/Label.kt b/core/designsystem/src/main/java/com/moya/funch/component/Label.kt new file mode 100644 index 00000000..77e49d48 --- /dev/null +++ b/core/designsystem/src/main/java/com/moya/funch/component/Label.kt @@ -0,0 +1,50 @@ +package com.moya.funch.component + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.moya.funch.theme.FunchTheme +import com.moya.funch.theme.Gray400 + +@Composable +fun FunchSmallLabel( + modifier: Modifier = Modifier, + text: String +) { + Box( + modifier = Modifier + .width(52.dp) + .height(48.dp), + contentAlignment = Alignment.CenterStart + ) { + Text( + text = text, + color = Gray400, + style = FunchTheme.typography.b + ) + } +} + +@Composable +fun FunchLargeLabel( + modifier: Modifier = Modifier, + text: String +) { + Box( + modifier = modifier + .width(52.dp) + .height(56.dp), + contentAlignment = Alignment.CenterStart + ) { + Text( + text = text, + color = Gray400, + style = FunchTheme.typography.b + ) + } +} From ff31e13d82f74c8fdf33bdd1f5dfb1b74e50a449 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 03:11:05 +0900 Subject: [PATCH 08/25] =?UTF-8?q?[feat]=20:=20=EB=94=94=EC=9E=90=EC=9D=B8?= =?UTF-8?q?=20=EC=8B=9C=EC=8A=A4=ED=85=9C=EC=97=90=20=EB=8F=84=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20Entity=20name=20=EB=94=B0=EB=A5=B8=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=EC=BD=98=20=EC=B0=BE=EB=8A=94=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=A0=9C=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/moya/funch/common/SearchPainter.kt | 40 +++++++++++++++++ .../java/com/moya/funch/MyProfileScreen.kt | 45 ++----------------- 2 files changed, 43 insertions(+), 42 deletions(-) create mode 100644 core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt diff --git a/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt b/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt new file mode 100644 index 00000000..81ceb9b8 --- /dev/null +++ b/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt @@ -0,0 +1,40 @@ +package com.moya.funch.common + +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.painter.Painter +import androidx.compose.ui.res.painterResource +import com.moya.funch.icon.FunchIconAsset + +@Composable +fun searchPainter(value: String): Painter = // @Gun Hyung TODO : 신림역부터 도메인 Entity 추가 되는데로 수정 + when (value) { + "개발자" -> painterResource(id = FunchIconAsset.Job.developer_24) + "디자이너" -> painterResource(id = FunchIconAsset.Job.designer_24) + "넥스터즈" -> painterResource(id = FunchIconAsset.Club.nexters_24) + "SOPT" -> painterResource(id = FunchIconAsset.Club.sopt_24) + "Depromeet" -> painterResource(id = FunchIconAsset.Club.depromeet_24) + "ONE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_one) + "TWO" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_two) + "THREE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_three) + "FOUR" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_four) + "FIVE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_five) + "SIX" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_six) + "SEVEN" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_seven) + "EIGHT" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_eight) + "NINE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_nine) + "SINBUNDANG" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_shinbundang) + "SUIN" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_suinbundang) + "AIRPORT" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_airport) + "EVERLINE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_youngin_ever) + "GYEONGCHUN" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_gyeongchun) + "신림" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_sillim) + "경강" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_geonggang) + "서해" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_seohae) + "경의중앙" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_gyeongui_jungang) + "인천1" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_incheon_one) + "의정부" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_uijeongbu) + "우이신설" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_ui_sinseol) + "김포골드라인" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_gimpo_goldline) + "인천2" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_incheon_two) + else -> throw IllegalArgumentException("Unknown Icon: $value") + } diff --git a/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt b/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt index a8248f69..099e5417 100644 --- a/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt @@ -27,6 +27,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.moya.funch.common.searchPainter import com.moya.funch.component.FunchChip import com.moya.funch.entity.profile.Profile import com.moya.funch.icon.FunchIconAsset @@ -129,14 +130,14 @@ private fun UsersDistinct(profile: Profile) { labelValues.forEach { value -> val leadingIcon = when (profileLabel) { ProfileLabel.JOB, ProfileLabel.CLUB -> - profileLeadingIcon(value) + searchPainter(value) else -> null } val trailingIcon = when (profileLabel) { ProfileLabel.SUBWAY -> profile.subways.find { it.name == value }?.lines?.map { - subwayLineIcon(it.name) + searchPainter(it.name) } else -> null @@ -193,46 +194,6 @@ private fun UsersDistinct(profile: Profile) { } } -@Composable -private fun profileLeadingIcon(value: String): Painter = when (value) { - "개발자" -> painterResource(id = FunchIconAsset.Job.developer_24) - "디자인" -> painterResource(id = FunchIconAsset.Job.designer_24) - "디자이너" -> painterResource(id = FunchIconAsset.Club.nexters_24) - "넥스터즈" -> painterResource(id = FunchIconAsset.Club.nexters_24) - "SOPT" -> painterResource(id = FunchIconAsset.Club.sopt_24) - "Depromeet" -> painterResource(id = FunchIconAsset.Club.depromeet_24) - else -> throw IllegalArgumentException("Unknown job: $value") -} - -@Composable -private fun subwayLineIcon(line: String): Painter = // @Gun Hyung TODO : 신림역부터 도메인 Entity 추가 되는데로 수정 - when (line) { - "ONE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_one) - "TWO" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_two) - "THREE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_three) - "FOUR" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_four) - "FIVE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_five) - "SIX" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_six) - "SEVEN" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_seven) - "EIGHT" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_eight) - "NINE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_nine) - "SINBUNDANG" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_shinbundang) - "SUIN" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_suinbundang) - "AIRPORT" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_airport) - "EVERLINE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_youngin_ever) - "GYEONGCHUN" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_gyeongchun) - "신림" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_sillim) - "경강" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_geonggang) - "서해" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_seohae) - "경의중앙" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_gyeongui_jungang) - "인천1" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_incheon_one) - "의정부" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_uijeongbu) - "우이신설" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_ui_sinseol) - "김포골드라인" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_gimpo_goldline) - "인천2" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_incheon_two) - else -> throw IllegalArgumentException("Unknown subway line: $line") - } - @Preview( showBackground = true, widthDp = 360, From 0cc7409d17cc1ae0f63bb8df2dcfc87a804d2bc7 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 03:12:22 +0900 Subject: [PATCH 09/25] =?UTF-8?q?[feat]=20:=20Profile=20=EB=AA=A8=EB=93=88?= =?UTF-8?q?=20MbtiType=20UI=EB=AA=A8=EB=8D=B8=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/moya/funch/uimodel/MbtiType.kt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 feature/profile/src/main/java/com/moya/funch/uimodel/MbtiType.kt diff --git a/feature/profile/src/main/java/com/moya/funch/uimodel/MbtiType.kt b/feature/profile/src/main/java/com/moya/funch/uimodel/MbtiType.kt new file mode 100644 index 00000000..c6e434ef --- /dev/null +++ b/feature/profile/src/main/java/com/moya/funch/uimodel/MbtiType.kt @@ -0,0 +1,8 @@ +package com.moya.funch.uimodel + +enum class MbtiItem { + E, I, + N, S, + T, F, + J, P +} From 186329b2d0072d7aff282e66a8eecf2022205726 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 03:13:19 +0900 Subject: [PATCH 10/25] =?UTF-8?q?[feat]=20:=20app=20=EB=AA=A8=EB=93=88=20?= =?UTF-8?q?=EB=A7=A4=EB=8B=88=ED=8C=A8=EC=8A=A4=ED=8A=B8=20=EC=95=A1?= =?UTF-8?q?=ED=8B=B0=EB=B9=84=ED=8B=B0=20=EB=8B=A8=EB=9D=BD=EC=97=90=20win?= =?UTF-8?q?dowSoftInputMode=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 9ffb357d..4da38283 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -21,6 +21,7 @@ android:name=".MainActivity" android:exported="true" android:label="@string/title_activity_sample" + android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.FunchAOS"> From 4164aa62a929d101e99dc13c2c0dd2b3fc7006ed Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 03:14:40 +0900 Subject: [PATCH 11/25] =?UTF-8?q?[TEMP]=20:=20(=EC=9E=84=EC=8B=9C)=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20=EC=83=9D=EC=84=B1=20UI=20?= =?UTF-8?q?=EC=A0=9C=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/moya/funch/CreatePofileViewModel.kt | 81 +++ .../com/moya/funch/CreateProflieScreen.kt | 490 +++++++++++++++++- .../funch/navigation/MyProfileNavigatoin.kt | 3 +- 3 files changed, 564 insertions(+), 10 deletions(-) create mode 100644 feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt diff --git a/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt b/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt new file mode 100644 index 00000000..1b76183e --- /dev/null +++ b/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt @@ -0,0 +1,81 @@ +package com.moya.funch + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.moya.funch.entity.Blood +import com.moya.funch.entity.Club +import com.moya.funch.entity.Job +import com.moya.funch.entity.SubwayStation +import com.moya.funch.entity.profile.Profile +import com.moya.funch.uimodel.MbtiItem +import com.moya.funch.usecase.CreateUserProfileUseCase +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.launch +import javax.inject.Inject + +@HiltViewModel +internal class CreateProfileViewModel @Inject constructor( + //private val createUserProfileUseCase: CreateUserProfileUseCase +) : ViewModel() { + + private val _profile = MutableStateFlow(Profile()) + val profile = _profile.asStateFlow() + + fun setNickname(nickname: String) { + _profile.value = _profile.value.copy(name = nickname) + } + + fun setJob(job: Job) { + _profile.value = _profile.value.copy(job = job) + } + + fun setClub(club: Club) { + _profile.value = _profile.value.copy( + clubs = _profile.value.clubs.toggleElement(club) + ) + } + + fun setBloodType(blood: Blood) { + _profile.value = _profile.value.copy(blood = blood) + } + + fun setMbti(mbti: MbtiItem) { + //_profile.value = _profile.value.copy(mbti = mbti) + } + + fun setSubwayName(subway: String) { + _profile.value = _profile.value.copy( + subways = + listOf( + SubwayStation(name = subway) + ) + ) + } + + fun createProfile() { + viewModelScope.launch { + /*createUserProfileUseCase(_profile.value).onSuccess { + // TODO : navigate to main + }.onFailure { + // TODO : show error + }*/ + } + } + +} + +fun List.toggleElement(element: T): List { + return if (contains(element)) { + filterNot { it == element } + } else { + this + element + } +} + +sealed class CreateProfileState { + data object Loading : CreateProfileState() + data object Success : CreateProfileState() + data object Error : CreateProfileState() +} diff --git a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt index b34af6a5..6225bacd 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt @@ -1,22 +1,494 @@ package com.moya.funch +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.interaction.collectIsFocusedAsState +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -import androidx.compose.material3.Button +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow +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.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.text.KeyboardActions +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.geometry.Rect import androidx.compose.ui.graphics.Color -import androidx.compose.ui.unit.sp +import androidx.compose.ui.layout.boundsInWindow +import androidx.compose.ui.layout.onGloballyPositioned +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalFocusManager +import androidx.compose.ui.text.input.ImeAction +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.hilt.navigation.compose.hiltViewModel +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.moya.funch.common.searchPainter +import com.moya.funch.component.FunchButtonType +import com.moya.funch.component.FunchChip +import com.moya.funch.component.FunchIcon +import com.moya.funch.component.FunchIconTextField +import com.moya.funch.component.FunchLargeLabel +import com.moya.funch.component.FunchMainButton +import com.moya.funch.component.FunchMaxLengthTextField +import com.moya.funch.component.FunchSmallLabel +import com.moya.funch.entity.Blood +import com.moya.funch.entity.Club +import com.moya.funch.entity.Job +import com.moya.funch.entity.profile.Profile +import com.moya.funch.icon.FunchIconAsset +import com.moya.funch.theme.FunchTheme +import com.moya.funch.theme.Gray300 +import com.moya.funch.theme.Gray400 +import com.moya.funch.theme.Gray500 +import com.moya.funch.theme.Gray800 +import com.moya.funch.theme.Gray900 +import com.moya.funch.theme.LocalBackgroundTheme +import com.moya.funch.theme.White +import com.moya.funch.ui.FunchDropDownButton +import com.moya.funch.ui.FunchDropDownMenu +import com.moya.funch.ui.FunchTopBar +import com.moya.funch.uimodel.MbtiItem +import com.moya.funch.uimodel.ProfileLabel @Composable -fun CreateProfileScreen(onNavigateToHome: () -> Unit) { - Column { +internal fun CreateProfileRoute( + onNavigateToHome: () -> Unit, + viewModel: CreateProfileViewModel = hiltViewModel() +) { + val profile by viewModel.profile.collectAsStateWithLifecycle() + + CreateProfileScreen( + profile = profile, + onSelectJob = viewModel::setJob, + onSelectClub = viewModel::setClub, + onSelectMbti = viewModel::setMbti, + onSelectBloodType = viewModel::setBloodType, + onNicknameChange = viewModel::setNickname, + onSubwayStationChange = viewModel::setSubwayName, + onNavigateToHome = onNavigateToHome, + onSendFeedback = {} + ) +} + +@Composable +fun CreateProfileScreen( + profile: Profile, + onSelectJob: (Job) -> Unit, + onSelectClub: (Club) -> Unit, + onSelectMbti: (MbtiItem) -> Unit, + onSelectBloodType: (Blood) -> Unit, + onNicknameChange: (String) -> Unit, + onSubwayStationChange: (String) -> Unit, + onNavigateToHome: () -> Unit, + onSendFeedback: () -> Unit, +) { + val scrollState = rememberScrollState() + val backgroundColor = LocalBackgroundTheme.current.color + val context = LocalContext.current + val isKeyboardVisible = remember { mutableStateOf(false) } + + + Scaffold( + topBar = { + FunchTopBar( + modifier = Modifier.padding(end = 20.dp), + leadingIcon = null, + onClickTrailingIcon = onSendFeedback + ) + }, + bottomBar = { + Box( + modifier = Modifier + .background(color = backgroundColor) + .padding( + top = 16.dp, + start = 20.dp, + end = 20.dp + ), + contentAlignment = Alignment.Center + ) { + FunchMainButton( + enabled = false, + modifier = Modifier.fillMaxWidth(), + buttonType = FunchButtonType.Full, + onClick = onNavigateToHome, + text = "이제 매칭할래요!" + ) + } + }, + containerColor = backgroundColor, + ) { padding -> + Column( + modifier = Modifier + .fillMaxSize() + .verticalScroll( + state = scrollState, + ) + .padding(padding) + .padding(horizontal = 20.dp) + ) { + Spacer(modifier = Modifier.height(8.dp)) + Text( + text = "프로필 만들기", + color = White, + style = FunchTheme.typography.t2 + ) + Spacer(modifier = Modifier.height(2.dp)) + Text( + text = "프로필을 만들어 공통점을 찾을 수 있어요", + color = Gray300, + style = FunchTheme.typography.b + ) + Spacer(modifier = Modifier.height(24.dp)) + NicknameRow( + nickname = profile.name, + onNicknameChange = onNicknameChange + ) + Spacer(modifier = Modifier.height(14.dp)) + Column( + verticalArrangement = Arrangement.spacedBy(16.dp) + ) { + JobRow(profile = profile, onSelected = onSelectJob) + ClubRow(onSelectClub = onSelectClub) + MbtiRow(onSelectMbti = onSelectMbti) + BooldTypeRow(onSelectBloodType = onSelectBloodType) + SubwayRow( + subwayStation = profile.subways[0].name, + onSubwayStationChange = onSubwayStationChange + ) + } + Text(text = "프로필을 만들면 매칭이 시작돼요", color = Gray300, style = FunchTheme.typography.b) + Spacer(modifier = Modifier.height(39.dp)) + } + } +} + +private const val MAX_NICKNAME_LENGTH = 9 + +@Composable +private fun NicknameRow( + nickname: String, + onNicknameChange: (String) -> Unit, +) { + var isNicknameError by remember { mutableStateOf(false) } + val interactionSource = remember { MutableInteractionSource() } + val isFocused by interactionSource.collectIsFocusedAsState() + val focusManager = LocalFocusManager.current + + LaunchedEffect(isFocused) { + if (!isFocused || nickname.length < MAX_NICKNAME_LENGTH) { + isNicknameError = false + } + } + + Row { + FunchLargeLabel(text = "닉네임") + Column { + FunchMaxLengthTextField( + value = nickname, + onValueChange = { innerText -> + isNicknameError = if (innerText.length <= MAX_NICKNAME_LENGTH) { + onNicknameChange(innerText) + false + } else { + true + } + }, + maxLength = MAX_NICKNAME_LENGTH, + hint = "최대 ${MAX_NICKNAME_LENGTH}글자", + isError = isNicknameError, + interactionSource = interactionSource, + isFocus = isFocused, + errorText = "최대 ${MAX_NICKNAME_LENGTH}글자까지 입력할 수 있어요", + keyboardOptions = KeyboardOptions.Default.copy( + imeAction = ImeAction.Done + ), + keyboardActions = KeyboardActions( + onDone = { + focusManager.clearFocus() + } + ) + ) + } + } +} + +@OptIn(ExperimentalLayoutApi::class) +@Composable +private fun JobRow( + profile: Profile, + onSelected: (Job) -> Unit +) { + Row { + FunchSmallLabel(text = "직군") + FlowRow( + modifier = Modifier.fillMaxWidth(), + verticalArrangement = Arrangement.spacedBy(8.dp), + horizontalArrangement = Arrangement.spacedBy(8.dp) + ) { + Job.entries.filterNot { it == Job.IDLE }.forEach { job -> + FunchChip( + selected = profile.job == job, + enabled = true, + onSelected = { onSelected(job) }, + label = { + Text( + text = job.krName, + style = FunchTheme.typography.b, + color = White + ) + }, + leadingIcon = { + Box( + modifier = Modifier + .size(32.dp) + .background( + color = Gray900, + shape = FunchTheme.shapes.extraSmall + ) + .clip(FunchTheme.shapes.extraSmall), + contentAlignment = Alignment.Center + ) { + Image( + modifier = Modifier.size(18.dp), + painter = searchPainter(job.krName), + contentDescription = "" + ) + } + } + ) + } + } + } +} + +@OptIn(ExperimentalLayoutApi::class) +@Composable +private fun ClubRow( + onSelectClub: (Club) -> Unit +) { + Row { + FunchSmallLabel(text = "동아리") + FlowRow( + modifier = Modifier.fillMaxWidth(), + verticalArrangement = Arrangement.spacedBy(8.dp), + horizontalArrangement = Arrangement.spacedBy(8.dp) + ) { + Club.entries.filterNot { it == Club.IDLE }.forEach { club -> + var isSelected by remember { mutableStateOf(false) } + FunchChip( + selected = isSelected, + enabled = true, + onSelected = { + onSelectClub(club) + isSelected = !isSelected + }, + label = { + Text( + text = club.label, + style = FunchTheme.typography.b, + color = White + ) + }, + leadingIcon = { + Box( + modifier = Modifier + .size(32.dp) + .background( + color = Gray900, + shape = FunchTheme.shapes.extraSmall + ) + .clip(FunchTheme.shapes.extraSmall), + contentAlignment = Alignment.Center + ) { + Image( + modifier = Modifier.size(18.dp), + painter = searchPainter(club.label), + contentDescription = "" + ) + } + } + ) + } + } + } +} + +@Composable +private fun MbtiRow( + onSelectMbti: (MbtiItem) -> Unit +) { + val mbtiList = MbtiItem.entries.chunked(2) + + Row { + FunchSmallLabel(text = ProfileLabel.MBTI.labelName) + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.spacedBy(8.dp) + ) { + mbtiList.forEach { pair -> + var isSelectedMbti by remember { mutableStateOf(pair[0]) } + + Column( + modifier = Modifier + .background(color = Gray800, shape = FunchTheme.shapes.medium) + .clip(FunchTheme.shapes.medium) + ) { + pair.forEach { mbti -> + MbtiButton( + mbtiItem = mbti, + isSelected = isSelectedMbti == mbti, + onSelected = { + onSelectMbti(it) + isSelectedMbti = it + } + ) + } + } + } + } + } +} + +@Composable +private fun MbtiButton( + mbtiItem: MbtiItem, + isSelected: Boolean, + onSelected: (MbtiItem) -> Unit +) { + Box( + modifier = Modifier + .size(48.dp) + .background( + color = if (isSelected) Gray500 else Color.Transparent, + shape = FunchTheme.shapes.medium + ) + .clip(FunchTheme.shapes.medium) + .clickable( + onClick = { onSelected(mbtiItem) }, + interactionSource = remember { MutableInteractionSource() }, + indication = null + ), + contentAlignment = Alignment.Center, + ) { Text( - text = "프로필 생성 화면", - fontSize = 12.sp, - color = Color.White + text = mbtiItem.name, + color = if (isSelected) White else Gray400, + style = FunchTheme.typography.sbt2 ) - Button(onClick = onNavigateToHome) { - Text(text = "프로필 생성") + } +} + +@Composable +private fun BooldTypeRow( + onSelectBloodType: (Blood) -> Unit +) { + val bloodTypes = Blood.entries.map { it.type } + var placeHolder by remember { mutableStateOf(bloodTypes[0]) } + var isDropDownMenuExpanded by remember { mutableStateOf(false) } + val buttonBounds = remember { mutableStateOf(Rect.Zero) } + + Row { + FunchLargeLabel(text = ProfileLabel.BLOOD_TYPE.labelName) + Box { + FunchDropDownButton( + placeHolder = placeHolder, + onClick = { isDropDownMenuExpanded = !isDropDownMenuExpanded }, + isDropDownMenuExpanded = isDropDownMenuExpanded, + indication = null, + modifier = Modifier.onGloballyPositioned { coordinates -> + buttonBounds.value = coordinates.boundsInWindow() + } + ) + if (isDropDownMenuExpanded) { + FunchDropDownMenu( + items = bloodTypes, + buttonBounds = buttonBounds.value, + onItemSelected = { bloodType -> + onSelectBloodType(Blood.formType(bloodType)) + placeHolder = bloodType + isDropDownMenuExpanded = false + } + ) + } + } + } +} + +@Composable +private fun SubwayRow( + subwayStation: String, + onSubwayStationChange: (String) -> Unit +) { + val isError by remember { mutableStateOf(false) } + val focusManager = LocalFocusManager.current + + Row { + FunchLargeLabel(text = ProfileLabel.SUBWAY.labelName) + FunchIconTextField( + value = subwayStation, + onValueChange = onSubwayStationChange, + hint = "가까운 지하철역 검색", + isError = isError, + errorText = "존재하지 않는 지하철역이에요", + iconType = FunchIcon( + resId = FunchIconAsset.Search.search_24, + tint = Gray400, + description = "" + ), + keyboardOptions = KeyboardOptions.Default.copy( + imeAction = ImeAction.Done + ), + keyboardActions = KeyboardActions( + onDone = { + focusManager.clearFocus() + } + ) + ) + } +} + +@Preview( + showBackground = true, + name = "CreateProfileScreen", + widthDp = 360, + heightDp = 1040 +) +@Composable +private fun Preview1() { + FunchTheme { + val backgroundColor = LocalBackgroundTheme.current.color + + Surface( + modifier = Modifier.fillMaxSize(), + color = backgroundColor + ) { + CreateProfileRoute( + onNavigateToHome = {}, + viewModel = CreateProfileViewModel() + ) } } } diff --git a/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt b/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt index ce529ede..7ad24fd0 100644 --- a/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt +++ b/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt @@ -4,6 +4,7 @@ import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.navigation +import com.moya.funch.CreateProfileRoute import com.moya.funch.CreateProfileScreen import com.moya.funch.MyProfileRoute @@ -19,7 +20,7 @@ fun NavGraphBuilder.profileGraph(onNavigateToHome: () -> Unit, onCloseMyProfile: startDestination = ProfileScreens.Create.route ) { composable(route = ProfileScreens.Create.route) { - CreateProfileScreen( + CreateProfileRoute( onNavigateToHome = onNavigateToHome ) } From 4dd656c88e07c43573d9ec08dca1bb05714917b8 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 15:36:12 +0900 Subject: [PATCH 12/25] =?UTF-8?q?[refactor]=20:=20Funch=20UX=20=EA=B0=80?= =?UTF-8?q?=EC=9D=B4=EB=93=9C=EC=97=90=20=EB=A7=9E=EA=B2=8C=EB=81=94=20?= =?UTF-8?q?=EB=B0=94=ED=85=80=EB=B0=94=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/moya/funch/CreateProflieScreen.kt | 133 ++++++++++-------- 1 file changed, 77 insertions(+), 56 deletions(-) diff --git a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt index 6225bacd..a687657b 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt @@ -37,7 +37,6 @@ import androidx.compose.ui.geometry.Rect import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.boundsInWindow import androidx.compose.ui.layout.onGloballyPositioned -import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.tooling.preview.Preview @@ -106,9 +105,7 @@ fun CreateProfileScreen( ) { val scrollState = rememberScrollState() val backgroundColor = LocalBackgroundTheme.current.color - val context = LocalContext.current - val isKeyboardVisible = remember { mutableStateOf(false) } - + var isKeyboardVisible by remember { mutableStateOf(false) } Scaffold( topBar = { @@ -119,23 +116,8 @@ fun CreateProfileScreen( ) }, bottomBar = { - Box( - modifier = Modifier - .background(color = backgroundColor) - .padding( - top = 16.dp, - start = 20.dp, - end = 20.dp - ), - contentAlignment = Alignment.Center - ) { - FunchMainButton( - enabled = false, - modifier = Modifier.fillMaxWidth(), - buttonType = FunchButtonType.Full, - onClick = onNavigateToHome, - text = "이제 매칭할래요!" - ) + if (!isKeyboardVisible) { + BottomBar(backgroundColor = backgroundColor, onNavigateToHome = onNavigateToHome) } }, containerColor = backgroundColor, @@ -143,44 +125,47 @@ fun CreateProfileScreen( Column( modifier = Modifier .fillMaxSize() - .verticalScroll( - state = scrollState, - ) + .verticalScroll(state = scrollState) .padding(padding) - .padding(horizontal = 20.dp) ) { - Spacer(modifier = Modifier.height(8.dp)) - Text( - text = "프로필 만들기", - color = White, - style = FunchTheme.typography.t2 - ) - Spacer(modifier = Modifier.height(2.dp)) - Text( - text = "프로필을 만들어 공통점을 찾을 수 있어요", - color = Gray300, - style = FunchTheme.typography.b - ) - Spacer(modifier = Modifier.height(24.dp)) - NicknameRow( - nickname = profile.name, - onNicknameChange = onNicknameChange - ) - Spacer(modifier = Modifier.height(14.dp)) - Column( - verticalArrangement = Arrangement.spacedBy(16.dp) - ) { - JobRow(profile = profile, onSelected = onSelectJob) - ClubRow(onSelectClub = onSelectClub) - MbtiRow(onSelectMbti = onSelectMbti) - BooldTypeRow(onSelectBloodType = onSelectBloodType) - SubwayRow( - subwayStation = profile.subways[0].name, - onSubwayStationChange = onSubwayStationChange + Column(modifier = Modifier.padding(horizontal = 20.dp)) { + Spacer(modifier = Modifier.height(8.dp)) + Text( + text = "프로필 만들기", + color = White, + style = FunchTheme.typography.t2 + ) + Spacer(modifier = Modifier.height(2.dp)) + Text( + text = "프로필을 만들어 공통점을 찾을 수 있어요", + color = Gray300, + style = FunchTheme.typography.b + ) + Spacer(modifier = Modifier.height(24.dp)) + NicknameRow( + nickname = profile.name, + onNicknameChange = onNicknameChange, + isKeyboardVisible = { isKeyboardVisible = it } ) + Spacer(modifier = Modifier.height(14.dp)) + Column( + verticalArrangement = Arrangement.spacedBy(16.dp) + ) { + JobRow(profile = profile, onSelected = onSelectJob) + ClubRow(onSelectClub = onSelectClub) + MbtiRow(onSelectMbti = onSelectMbti) + BooldTypeRow(onSelectBloodType = onSelectBloodType) + SubwayRow( + subwayStation = profile.subways[0].name, + onSubwayStationChange = onSubwayStationChange, + isKeyboardVisible = { isKeyboardVisible = it } + ) + } + Spacer(modifier = Modifier.height(39.dp)) + } + if (isKeyboardVisible) { + BottomBar(backgroundColor = backgroundColor, onNavigateToHome = onNavigateToHome) } - Text(text = "프로필을 만들면 매칭이 시작돼요", color = Gray300, style = FunchTheme.typography.b) - Spacer(modifier = Modifier.height(39.dp)) } } } @@ -191,6 +176,7 @@ private const val MAX_NICKNAME_LENGTH = 9 private fun NicknameRow( nickname: String, onNicknameChange: (String) -> Unit, + isKeyboardVisible: (Boolean) -> Unit, ) { var isNicknameError by remember { mutableStateOf(false) } val interactionSource = remember { MutableInteractionSource() } @@ -201,6 +187,7 @@ private fun NicknameRow( if (!isFocused || nickname.length < MAX_NICKNAME_LENGTH) { isNicknameError = false } + isKeyboardVisible(isFocused) } Row { @@ -440,11 +427,18 @@ private fun BooldTypeRow( @Composable private fun SubwayRow( subwayStation: String, - onSubwayStationChange: (String) -> Unit + onSubwayStationChange: (String) -> Unit, + isKeyboardVisible: (Boolean) -> Unit ) { val isError by remember { mutableStateOf(false) } + val interactionSource = remember { MutableInteractionSource() } + val isFocused by interactionSource.collectIsFocusedAsState() val focusManager = LocalFocusManager.current + LaunchedEffect(isFocused) { + isKeyboardVisible(isFocused) + } + Row { FunchLargeLabel(text = ProfileLabel.SUBWAY.labelName) FunchIconTextField( @@ -458,6 +452,8 @@ private fun SubwayRow( tint = Gray400, description = "" ), + interactionSource = interactionSource, + isFocus = isFocused, keyboardOptions = KeyboardOptions.Default.copy( imeAction = ImeAction.Done ), @@ -470,6 +466,31 @@ private fun SubwayRow( } } +@Composable +private fun BottomBar( + backgroundColor: Color, + onNavigateToHome: () -> Unit +) { + Box( + modifier = Modifier + .background(color = backgroundColor) + .padding( + top = 16.dp, + start = 20.dp, + end = 20.dp + ), + contentAlignment = Alignment.Center + ) { + FunchMainButton( + enabled = false, + modifier = Modifier.fillMaxWidth(), + buttonType = FunchButtonType.Full, + onClick = onNavigateToHome, + text = "이제 매칭할래요!" + ) + } +} + @Preview( showBackground = true, name = "CreateProfileScreen", From 4818db04f3a5f96a3432b53537072fcfc963473b Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 17:07:21 +0900 Subject: [PATCH 13/25] =?UTF-8?q?[refactor]=20:=20SearchPainter=203?= =?UTF-8?q?=EA=B0=80=EC=A7=80=EB=A1=9C=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/moya/funch/common/SearchPainter.kt | 14 +++++++++++++- .../java/com/moya/funch/CreateProflieScreen.kt | 7 ++++--- .../main/java/com/moya/funch/MyProfileScreen.kt | 10 ++++------ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt b/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt index 81ceb9b8..7e32587c 100644 --- a/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt +++ b/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt @@ -6,13 +6,25 @@ import androidx.compose.ui.res.painterResource import com.moya.funch.icon.FunchIconAsset @Composable -fun searchPainter(value: String): Painter = // @Gun Hyung TODO : 신림역부터 도메인 Entity 추가 되는데로 수정 +fun jobPainter(value: String): Painter = when (value) { "개발자" -> painterResource(id = FunchIconAsset.Job.developer_24) "디자이너" -> painterResource(id = FunchIconAsset.Job.designer_24) + else -> throw IllegalArgumentException("Unknown Icon: $value") + } + +@Composable +fun clubPainter(value: String): Painter = + when (value) { "넥스터즈" -> painterResource(id = FunchIconAsset.Club.nexters_24) "SOPT" -> painterResource(id = FunchIconAsset.Club.sopt_24) "Depromeet" -> painterResource(id = FunchIconAsset.Club.depromeet_24) + else -> throw IllegalArgumentException("Unknown Icon: $value") + } + +@Composable +fun subwayLinePainter(value: String): Painter = // @Gun Hyung TODO : 신림역부터 도메인 Entity 추가 되는데로 수정 + when (value) { "ONE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_one) "TWO" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_two) "THREE" -> painterResource(id = FunchIconAsset.SubwayLine.subway_line_three) diff --git a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt index a687657b..1c95e76b 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt @@ -43,7 +43,8 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle -import com.moya.funch.common.searchPainter +import com.moya.funch.common.clubPainter +import com.moya.funch.common.jobPainter import com.moya.funch.component.FunchButtonType import com.moya.funch.component.FunchChip import com.moya.funch.component.FunchIcon @@ -260,7 +261,7 @@ private fun JobRow( ) { Image( modifier = Modifier.size(18.dp), - painter = searchPainter(job.krName), + painter = jobPainter(job.krName), contentDescription = "" ) } @@ -312,7 +313,7 @@ private fun ClubRow( ) { Image( modifier = Modifier.size(18.dp), - painter = searchPainter(club.label), + painter = clubPainter(club.label), contentDescription = "" ) } diff --git a/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt b/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt index 099e5417..7571dd4f 100644 --- a/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt @@ -22,15 +22,13 @@ 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.res.painterResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel -import com.moya.funch.common.searchPainter +import com.moya.funch.common.jobPainter +import com.moya.funch.common.subwayLinePainter import com.moya.funch.component.FunchChip import com.moya.funch.entity.profile.Profile -import com.moya.funch.icon.FunchIconAsset import com.moya.funch.theme.FunchTheme import com.moya.funch.theme.Gray400 import com.moya.funch.theme.Gray800 @@ -130,14 +128,14 @@ private fun UsersDistinct(profile: Profile) { labelValues.forEach { value -> val leadingIcon = when (profileLabel) { ProfileLabel.JOB, ProfileLabel.CLUB -> - searchPainter(value) + jobPainter(value) else -> null } val trailingIcon = when (profileLabel) { ProfileLabel.SUBWAY -> profile.subways.find { it.name == value }?.lines?.map { - searchPainter(it.name) + subwayLinePainter(it.name) } else -> null From 173269b14377cbc452b79239275b2615d909c5a5 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 17:08:43 +0900 Subject: [PATCH 14/25] =?UTF-8?q?[refactor]=20:=20=EA=B0=80=EC=8B=9C?= =?UTF-8?q?=EC=84=B1=20=EC=A7=80=EC=8B=9C=EC=9E=90=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/moya/funch/CreatePofileViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt b/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt index 1b76183e..fbee3771 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt @@ -66,7 +66,7 @@ internal class CreateProfileViewModel @Inject constructor( } -fun List.toggleElement(element: T): List { +private fun List.toggleElement(element: T): List { return if (contains(element)) { filterNot { it == element } } else { @@ -74,7 +74,7 @@ fun List.toggleElement(element: T): List { } } -sealed class CreateProfileState { +internal sealed class CreateProfileState { data object Loading : CreateProfileState() data object Success : CreateProfileState() data object Error : CreateProfileState() From 17089634803ebb6b8b2f02fb0c19a50165c8df54 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 17:13:46 +0900 Subject: [PATCH 15/25] =?UTF-8?q?[refactor]=20:=20=EB=8F=84=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20=EC=97=94=ED=8B=B0=ED=8B=B0=20=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A6=AC=20=ED=95=A8=EC=88=98=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20?= =?UTF-8?q?=EC=BB=A8=EB=B2=A4=EC=85=98=EC=97=90=20=EB=A7=9E=EA=B2=8C?= =?UTF-8?q?=EB=81=94=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/domain/src/main/java/com/moya/funch/entity/Blood.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/domain/src/main/java/com/moya/funch/entity/Blood.kt b/core/domain/src/main/java/com/moya/funch/entity/Blood.kt index 69d556d8..d24ad56f 100644 --- a/core/domain/src/main/java/com/moya/funch/entity/Blood.kt +++ b/core/domain/src/main/java/com/moya/funch/entity/Blood.kt @@ -9,8 +9,10 @@ enum class Blood(val type: String) { ; companion object { - fun formType(type: String): Blood { - return entries.find { it.type == type } ?: IDLE + fun of(bloodType: String): Blood { + val blood = runCatching { Blood.valueOf(bloodType) } + if (blood.isSuccess) return requireNotNull(blood.getOrNull()) + return requireNotNull(Blood.entries.find { it.type == bloodType }) { "Club : $bloodType not found" } } } } From a5b3a23e8768023a17c8700dce099de84319e052 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 17:14:34 +0900 Subject: [PATCH 16/25] =?UTF-8?q?[refactor]=20:=20=EB=93=9C=EB=A1=AD?= =?UTF-8?q?=EB=8B=A4=EC=9A=B4=20=EB=A9=94=EB=89=B4=EC=97=90=20'Idle'=20?= =?UTF-8?q?=ED=95=AD=EB=AA=A9=20=EB=82=98=EC=98=A4=EB=8A=94=20=ED=98=84?= =?UTF-8?q?=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/moya/funch/CreateProflieScreen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt index 1c95e76b..7db1105b 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt @@ -393,7 +393,7 @@ private fun MbtiButton( private fun BooldTypeRow( onSelectBloodType: (Blood) -> Unit ) { - val bloodTypes = Blood.entries.map { it.type } + val bloodTypes = Blood.entries.filterNot { it == Blood.IDLE }.map { it.type } var placeHolder by remember { mutableStateOf(bloodTypes[0]) } var isDropDownMenuExpanded by remember { mutableStateOf(false) } val buttonBounds = remember { mutableStateOf(Rect.Zero) } @@ -415,7 +415,7 @@ private fun BooldTypeRow( items = bloodTypes, buttonBounds = buttonBounds.value, onItemSelected = { bloodType -> - onSelectBloodType(Blood.formType(bloodType)) + onSelectBloodType(Blood.of(bloodType)) placeHolder = bloodType isDropDownMenuExpanded = false } From fa62854c4024b6b9f3323cd84f798953facca545 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 21:14:58 +0900 Subject: [PATCH 17/25] =?UTF-8?q?[feat]=20:=20mbti=20=EB=A1=9C=EC=A7=81=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 --- .../com/moya/funch/CreatePofileViewModel.kt | 44 +++++++++++++++++-- .../com/moya/funch/CreateProflieScreen.kt | 14 +++--- 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt b/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt index fbee3771..f8f22deb 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt @@ -5,16 +5,24 @@ import androidx.lifecycle.viewModelScope import com.moya.funch.entity.Blood import com.moya.funch.entity.Club import com.moya.funch.entity.Job +import com.moya.funch.entity.Mbti import com.moya.funch.entity.SubwayStation import com.moya.funch.entity.profile.Profile import com.moya.funch.uimodel.MbtiItem -import com.moya.funch.usecase.CreateUserProfileUseCase import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import javax.inject.Inject +data class MbtiState( + val eOrI: MbtiItem = MbtiItem.E, + val nOrS: MbtiItem = MbtiItem.N, + val tOrF: MbtiItem = MbtiItem.T, + val jOrP: MbtiItem = MbtiItem.J +) + @HiltViewModel internal class CreateProfileViewModel @Inject constructor( //private val createUserProfileUseCase: CreateUserProfileUseCase @@ -23,6 +31,8 @@ internal class CreateProfileViewModel @Inject constructor( private val _profile = MutableStateFlow(Profile()) val profile = _profile.asStateFlow() + private val _mbtiState = MutableStateFlow(MbtiState()) + fun setNickname(nickname: String) { _profile.value = _profile.value.copy(name = nickname) } @@ -41,8 +51,36 @@ internal class CreateProfileViewModel @Inject constructor( _profile.value = _profile.value.copy(blood = blood) } - fun setMbti(mbti: MbtiItem) { - //_profile.value = _profile.value.copy(mbti = mbti) + fun setMbti(item: MbtiItem) { + viewModelScope.launch { + when (item) { + MbtiItem.E, MbtiItem.I -> _mbtiState.update { uiModel -> uiModel.copy(eOrI = item) } + MbtiItem.N, MbtiItem.S -> _mbtiState.update { uiModel -> uiModel.copy(nOrS = item) } + MbtiItem.T, MbtiItem.F -> _mbtiState.update { uiModel -> uiModel.copy(tOrF = item) } + MbtiItem.J, MbtiItem.P -> _mbtiState.update { uiModel -> uiModel.copy(jOrP = item) } + } + _profile.value = _profile.value.copy( + mbti = Mbti.valueOf( + _mbtiState.value.eOrI.name + + _mbtiState.value.nOrS.name + + _mbtiState.value.tOrF.name + + _mbtiState.value.jOrP.name + ) + ) + } + } + + fun isSelectMbti(mbtiItem: MbtiItem): Boolean { + return when (mbtiItem) { + MbtiItem.E -> _mbtiState.value.eOrI == MbtiItem.E + MbtiItem.I -> _mbtiState.value.eOrI == MbtiItem.I + MbtiItem.N -> _mbtiState.value.nOrS == MbtiItem.N + MbtiItem.S -> _mbtiState.value.nOrS == MbtiItem.S + MbtiItem.T -> _mbtiState.value.tOrF == MbtiItem.T + MbtiItem.F -> _mbtiState.value.tOrF == MbtiItem.F + MbtiItem.J -> _mbtiState.value.jOrP == MbtiItem.J + MbtiItem.P -> _mbtiState.value.jOrP == MbtiItem.P + } } fun setSubwayName(subway: String) { diff --git a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt index 7db1105b..7eef5b3a 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt @@ -81,6 +81,7 @@ internal fun CreateProfileRoute( CreateProfileScreen( profile = profile, + isSelectMbti = viewModel::isSelectMbti, onSelectJob = viewModel::setJob, onSelectClub = viewModel::setClub, onSelectMbti = viewModel::setMbti, @@ -95,6 +96,7 @@ internal fun CreateProfileRoute( @Composable fun CreateProfileScreen( profile: Profile, + isSelectMbti: (MbtiItem) -> Boolean, onSelectJob: (Job) -> Unit, onSelectClub: (Club) -> Unit, onSelectMbti: (MbtiItem) -> Unit, @@ -154,7 +156,7 @@ fun CreateProfileScreen( ) { JobRow(profile = profile, onSelected = onSelectJob) ClubRow(onSelectClub = onSelectClub) - MbtiRow(onSelectMbti = onSelectMbti) + MbtiRow(onSelectMbti = onSelectMbti, isSelectMbti = isSelectMbti) BooldTypeRow(onSelectBloodType = onSelectBloodType) SubwayRow( subwayStation = profile.subways[0].name, @@ -326,7 +328,8 @@ private fun ClubRow( @Composable private fun MbtiRow( - onSelectMbti: (MbtiItem) -> Unit + onSelectMbti: (MbtiItem) -> Unit, + isSelectMbti: (MbtiItem) -> Boolean, ) { val mbtiList = MbtiItem.entries.chunked(2) @@ -336,9 +339,7 @@ private fun MbtiRow( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(8.dp) ) { - mbtiList.forEach { pair -> - var isSelectedMbti by remember { mutableStateOf(pair[0]) } - + mbtiList.forEachIndexed { i, pair -> Column( modifier = Modifier .background(color = Gray800, shape = FunchTheme.shapes.medium) @@ -347,10 +348,9 @@ private fun MbtiRow( pair.forEach { mbti -> MbtiButton( mbtiItem = mbti, - isSelected = isSelectedMbti == mbti, + isSelected = isSelectMbti(mbti), onSelected = { onSelectMbti(it) - isSelectedMbti = it } ) } From 8e4a28e13cd7716f6ba14b059342118a7ee2990b Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 21:48:53 +0900 Subject: [PATCH 18/25] =?UTF-8?q?[feat]=20:=20=EC=9E=85=EB=A0=A5=ED=95=AD?= =?UTF-8?q?=EB=AA=A9=20=EB=AA=A8=EB=91=90=20=EC=9E=85=EB=A0=A5=EC=8B=9C=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20=EC=83=9D=EC=84=B1=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/moya/funch/CreatePofileViewModel.kt | 9 +++++++++ .../com/moya/funch/CreateProflieScreen.kt | 19 +++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt b/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt index f8f22deb..63b7a6ec 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt @@ -92,6 +92,15 @@ internal class CreateProfileViewModel @Inject constructor( ) } + fun isCreateProfile(profile: Profile): Boolean { + return profile.job != Job.IDLE && + profile.clubs.isNotEmpty() && + profile.mbti != Mbti.IDLE && + profile.blood != Blood.IDLE && + profile.name.isNotBlank() && + profile.subways[0].name.isNotBlank() + } + fun createProfile() { viewModelScope.launch { /*createUserProfileUseCase(_profile.value).onSuccess { diff --git a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt index 7eef5b3a..64ecf768 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt @@ -82,6 +82,7 @@ internal fun CreateProfileRoute( CreateProfileScreen( profile = profile, isSelectMbti = viewModel::isSelectMbti, + isCreateProfile = viewModel::isCreateProfile, onSelectJob = viewModel::setJob, onSelectClub = viewModel::setClub, onSelectMbti = viewModel::setMbti, @@ -97,6 +98,7 @@ internal fun CreateProfileRoute( fun CreateProfileScreen( profile: Profile, isSelectMbti: (MbtiItem) -> Boolean, + isCreateProfile: (Profile) -> Boolean, onSelectJob: (Job) -> Unit, onSelectClub: (Club) -> Unit, onSelectMbti: (MbtiItem) -> Unit, @@ -120,7 +122,11 @@ fun CreateProfileScreen( }, bottomBar = { if (!isKeyboardVisible) { - BottomBar(backgroundColor = backgroundColor, onNavigateToHome = onNavigateToHome) + BottomBar( + backgroundColor = backgroundColor, + isCreateProfile = isCreateProfile(profile), + onNavigateToHome = onNavigateToHome + ) } }, containerColor = backgroundColor, @@ -167,7 +173,11 @@ fun CreateProfileScreen( Spacer(modifier = Modifier.height(39.dp)) } if (isKeyboardVisible) { - BottomBar(backgroundColor = backgroundColor, onNavigateToHome = onNavigateToHome) + BottomBar( + backgroundColor = backgroundColor, + isCreateProfile = isCreateProfile(profile), + onNavigateToHome = onNavigateToHome + ) } } } @@ -429,7 +439,7 @@ private fun BooldTypeRow( private fun SubwayRow( subwayStation: String, onSubwayStationChange: (String) -> Unit, - isKeyboardVisible: (Boolean) -> Unit + isKeyboardVisible: (Boolean) -> Unit, ) { val isError by remember { mutableStateOf(false) } val interactionSource = remember { MutableInteractionSource() } @@ -470,6 +480,7 @@ private fun SubwayRow( @Composable private fun BottomBar( backgroundColor: Color, + isCreateProfile: Boolean, onNavigateToHome: () -> Unit ) { Box( @@ -483,7 +494,7 @@ private fun BottomBar( contentAlignment = Alignment.Center ) { FunchMainButton( - enabled = false, + enabled = isCreateProfile, modifier = Modifier.fillMaxWidth(), buttonType = FunchButtonType.Full, onClick = onNavigateToHome, From 0dd9b3cd4b0a1582af8f9d96e4d754a983926cff Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Mon, 12 Feb 2024 22:09:45 +0900 Subject: [PATCH 19/25] [chore] : reformat --- .../com/moya/funch/common/SearchPainter.kt | 24 +++++---- .../java/com/moya/funch/component/Label.kt | 10 +--- .../com/moya/funch/CreatePofileViewModel.kt | 39 +++++++-------- .../com/moya/funch/CreateProflieScreen.kt | 49 +++++-------------- .../funch/navigation/MyProfileNavigatoin.kt | 1 - .../uimodel/{MbtiType.kt => MbtiItem.kt} | 12 +++-- 6 files changed, 52 insertions(+), 83 deletions(-) rename feature/profile/src/main/java/com/moya/funch/uimodel/{MbtiType.kt => MbtiItem.kt} (50%) diff --git a/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt b/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt index 7e32587c..72d22aa0 100644 --- a/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt +++ b/core/designsystem/src/main/java/com/moya/funch/common/SearchPainter.kt @@ -6,21 +6,19 @@ import androidx.compose.ui.res.painterResource import com.moya.funch.icon.FunchIconAsset @Composable -fun jobPainter(value: String): Painter = - when (value) { - "개발자" -> painterResource(id = FunchIconAsset.Job.developer_24) - "디자이너" -> painterResource(id = FunchIconAsset.Job.designer_24) - else -> throw IllegalArgumentException("Unknown Icon: $value") - } +fun jobPainter(value: String): Painter = when (value) { + "개발자" -> painterResource(id = FunchIconAsset.Job.developer_24) + "디자이너" -> painterResource(id = FunchIconAsset.Job.designer_24) + else -> throw IllegalArgumentException("Unknown Icon: $value") +} @Composable -fun clubPainter(value: String): Painter = - when (value) { - "넥스터즈" -> painterResource(id = FunchIconAsset.Club.nexters_24) - "SOPT" -> painterResource(id = FunchIconAsset.Club.sopt_24) - "Depromeet" -> painterResource(id = FunchIconAsset.Club.depromeet_24) - else -> throw IllegalArgumentException("Unknown Icon: $value") - } +fun clubPainter(value: String): Painter = when (value) { + "넥스터즈" -> painterResource(id = FunchIconAsset.Club.nexters_24) + "SOPT" -> painterResource(id = FunchIconAsset.Club.sopt_24) + "Depromeet" -> painterResource(id = FunchIconAsset.Club.depromeet_24) + else -> throw IllegalArgumentException("Unknown Icon: $value") +} @Composable fun subwayLinePainter(value: String): Painter = // @Gun Hyung TODO : 신림역부터 도메인 Entity 추가 되는데로 수정 diff --git a/core/designsystem/src/main/java/com/moya/funch/component/Label.kt b/core/designsystem/src/main/java/com/moya/funch/component/Label.kt index 77e49d48..af5da5a5 100644 --- a/core/designsystem/src/main/java/com/moya/funch/component/Label.kt +++ b/core/designsystem/src/main/java/com/moya/funch/component/Label.kt @@ -12,10 +12,7 @@ import com.moya.funch.theme.FunchTheme import com.moya.funch.theme.Gray400 @Composable -fun FunchSmallLabel( - modifier: Modifier = Modifier, - text: String -) { +fun FunchSmallLabel(modifier: Modifier = Modifier, text: String) { Box( modifier = Modifier .width(52.dp) @@ -31,10 +28,7 @@ fun FunchSmallLabel( } @Composable -fun FunchLargeLabel( - modifier: Modifier = Modifier, - text: String -) { +fun FunchLargeLabel(modifier: Modifier = Modifier, text: String) { Box( modifier = modifier .width(52.dp) diff --git a/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt b/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt index 63b7a6ec..c84be10d 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreatePofileViewModel.kt @@ -10,11 +10,11 @@ import com.moya.funch.entity.SubwayStation import com.moya.funch.entity.profile.Profile import com.moya.funch.uimodel.MbtiItem import dagger.hilt.android.lifecycle.HiltViewModel +import javax.inject.Inject import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch -import javax.inject.Inject data class MbtiState( val eOrI: MbtiItem = MbtiItem.E, @@ -25,13 +25,13 @@ data class MbtiState( @HiltViewModel internal class CreateProfileViewModel @Inject constructor( - //private val createUserProfileUseCase: CreateUserProfileUseCase + // private val createUserProfileUseCase: CreateUserProfileUseCase ) : ViewModel() { private val _profile = MutableStateFlow(Profile()) val profile = _profile.asStateFlow() - private val _mbtiState = MutableStateFlow(MbtiState()) + private val mbtiState = MutableStateFlow(MbtiState()) fun setNickname(nickname: String) { _profile.value = _profile.value.copy(name = nickname) @@ -54,17 +54,17 @@ internal class CreateProfileViewModel @Inject constructor( fun setMbti(item: MbtiItem) { viewModelScope.launch { when (item) { - MbtiItem.E, MbtiItem.I -> _mbtiState.update { uiModel -> uiModel.copy(eOrI = item) } - MbtiItem.N, MbtiItem.S -> _mbtiState.update { uiModel -> uiModel.copy(nOrS = item) } - MbtiItem.T, MbtiItem.F -> _mbtiState.update { uiModel -> uiModel.copy(tOrF = item) } - MbtiItem.J, MbtiItem.P -> _mbtiState.update { uiModel -> uiModel.copy(jOrP = item) } + MbtiItem.E, MbtiItem.I -> mbtiState.update { uiModel -> uiModel.copy(eOrI = item) } + MbtiItem.N, MbtiItem.S -> mbtiState.update { uiModel -> uiModel.copy(nOrS = item) } + MbtiItem.T, MbtiItem.F -> mbtiState.update { uiModel -> uiModel.copy(tOrF = item) } + MbtiItem.J, MbtiItem.P -> mbtiState.update { uiModel -> uiModel.copy(jOrP = item) } } _profile.value = _profile.value.copy( mbti = Mbti.valueOf( - _mbtiState.value.eOrI.name + - _mbtiState.value.nOrS.name + - _mbtiState.value.tOrF.name + - _mbtiState.value.jOrP.name + mbtiState.value.eOrI.name + + mbtiState.value.nOrS.name + + mbtiState.value.tOrF.name + + mbtiState.value.jOrP.name ) ) } @@ -72,14 +72,14 @@ internal class CreateProfileViewModel @Inject constructor( fun isSelectMbti(mbtiItem: MbtiItem): Boolean { return when (mbtiItem) { - MbtiItem.E -> _mbtiState.value.eOrI == MbtiItem.E - MbtiItem.I -> _mbtiState.value.eOrI == MbtiItem.I - MbtiItem.N -> _mbtiState.value.nOrS == MbtiItem.N - MbtiItem.S -> _mbtiState.value.nOrS == MbtiItem.S - MbtiItem.T -> _mbtiState.value.tOrF == MbtiItem.T - MbtiItem.F -> _mbtiState.value.tOrF == MbtiItem.F - MbtiItem.J -> _mbtiState.value.jOrP == MbtiItem.J - MbtiItem.P -> _mbtiState.value.jOrP == MbtiItem.P + MbtiItem.E -> mbtiState.value.eOrI == MbtiItem.E + MbtiItem.I -> mbtiState.value.eOrI == MbtiItem.I + MbtiItem.N -> mbtiState.value.nOrS == MbtiItem.N + MbtiItem.S -> mbtiState.value.nOrS == MbtiItem.S + MbtiItem.T -> mbtiState.value.tOrF == MbtiItem.T + MbtiItem.F -> mbtiState.value.tOrF == MbtiItem.F + MbtiItem.J -> mbtiState.value.jOrP == MbtiItem.J + MbtiItem.P -> mbtiState.value.jOrP == MbtiItem.P } } @@ -110,7 +110,6 @@ internal class CreateProfileViewModel @Inject constructor( }*/ } } - } private fun List.toggleElement(element: T): List { diff --git a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt index 64ecf768..009e1ecd 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt @@ -73,10 +73,7 @@ import com.moya.funch.uimodel.MbtiItem import com.moya.funch.uimodel.ProfileLabel @Composable -internal fun CreateProfileRoute( - onNavigateToHome: () -> Unit, - viewModel: CreateProfileViewModel = hiltViewModel() -) { +internal fun CreateProfileRoute(onNavigateToHome: () -> Unit, viewModel: CreateProfileViewModel = hiltViewModel()) { val profile by viewModel.profile.collectAsStateWithLifecycle() CreateProfileScreen( @@ -106,7 +103,7 @@ fun CreateProfileScreen( onNicknameChange: (String) -> Unit, onSubwayStationChange: (String) -> Unit, onNavigateToHome: () -> Unit, - onSendFeedback: () -> Unit, + onSendFeedback: () -> Unit ) { val scrollState = rememberScrollState() val backgroundColor = LocalBackgroundTheme.current.color @@ -129,7 +126,7 @@ fun CreateProfileScreen( ) } }, - containerColor = backgroundColor, + containerColor = backgroundColor ) { padding -> Column( modifier = Modifier @@ -186,11 +183,7 @@ fun CreateProfileScreen( private const val MAX_NICKNAME_LENGTH = 9 @Composable -private fun NicknameRow( - nickname: String, - onNicknameChange: (String) -> Unit, - isKeyboardVisible: (Boolean) -> Unit, -) { +private fun NicknameRow(nickname: String, onNicknameChange: (String) -> Unit, isKeyboardVisible: (Boolean) -> Unit) { var isNicknameError by remember { mutableStateOf(false) } val interactionSource = remember { MutableInteractionSource() } val isFocused by interactionSource.collectIsFocusedAsState() @@ -237,10 +230,7 @@ private fun NicknameRow( @OptIn(ExperimentalLayoutApi::class) @Composable -private fun JobRow( - profile: Profile, - onSelected: (Job) -> Unit -) { +private fun JobRow(profile: Profile, onSelected: (Job) -> Unit) { Row { FunchSmallLabel(text = "직군") FlowRow( @@ -286,9 +276,7 @@ private fun JobRow( @OptIn(ExperimentalLayoutApi::class) @Composable -private fun ClubRow( - onSelectClub: (Club) -> Unit -) { +private fun ClubRow(onSelectClub: (Club) -> Unit) { Row { FunchSmallLabel(text = "동아리") FlowRow( @@ -337,10 +325,7 @@ private fun ClubRow( } @Composable -private fun MbtiRow( - onSelectMbti: (MbtiItem) -> Unit, - isSelectMbti: (MbtiItem) -> Boolean, -) { +private fun MbtiRow(onSelectMbti: (MbtiItem) -> Unit, isSelectMbti: (MbtiItem) -> Boolean) { val mbtiList = MbtiItem.entries.chunked(2) Row { @@ -371,11 +356,7 @@ private fun MbtiRow( } @Composable -private fun MbtiButton( - mbtiItem: MbtiItem, - isSelected: Boolean, - onSelected: (MbtiItem) -> Unit -) { +private fun MbtiButton(mbtiItem: MbtiItem, isSelected: Boolean, onSelected: (MbtiItem) -> Unit) { Box( modifier = Modifier .size(48.dp) @@ -389,7 +370,7 @@ private fun MbtiButton( interactionSource = remember { MutableInteractionSource() }, indication = null ), - contentAlignment = Alignment.Center, + contentAlignment = Alignment.Center ) { Text( text = mbtiItem.name, @@ -400,9 +381,7 @@ private fun MbtiButton( } @Composable -private fun BooldTypeRow( - onSelectBloodType: (Blood) -> Unit -) { +private fun BooldTypeRow(onSelectBloodType: (Blood) -> Unit) { val bloodTypes = Blood.entries.filterNot { it == Blood.IDLE }.map { it.type } var placeHolder by remember { mutableStateOf(bloodTypes[0]) } var isDropDownMenuExpanded by remember { mutableStateOf(false) } @@ -439,7 +418,7 @@ private fun BooldTypeRow( private fun SubwayRow( subwayStation: String, onSubwayStationChange: (String) -> Unit, - isKeyboardVisible: (Boolean) -> Unit, + isKeyboardVisible: (Boolean) -> Unit ) { val isError by remember { mutableStateOf(false) } val interactionSource = remember { MutableInteractionSource() } @@ -478,11 +457,7 @@ private fun SubwayRow( } @Composable -private fun BottomBar( - backgroundColor: Color, - isCreateProfile: Boolean, - onNavigateToHome: () -> Unit -) { +private fun BottomBar(backgroundColor: Color, isCreateProfile: Boolean, onNavigateToHome: () -> Unit) { Box( modifier = Modifier .background(color = backgroundColor) diff --git a/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt b/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt index ff54d36d..6e79eb5c 100644 --- a/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt +++ b/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt @@ -6,7 +6,6 @@ import androidx.navigation.NavOptions import androidx.navigation.compose.composable import androidx.navigation.navigation import com.moya.funch.CreateProfileRoute -import com.moya.funch.CreateProfileScreen import com.moya.funch.MyProfileRoute const val PROFILE_GRAPH_ROUTE = "profile_graph" diff --git a/feature/profile/src/main/java/com/moya/funch/uimodel/MbtiType.kt b/feature/profile/src/main/java/com/moya/funch/uimodel/MbtiItem.kt similarity index 50% rename from feature/profile/src/main/java/com/moya/funch/uimodel/MbtiType.kt rename to feature/profile/src/main/java/com/moya/funch/uimodel/MbtiItem.kt index c6e434ef..cccf49df 100644 --- a/feature/profile/src/main/java/com/moya/funch/uimodel/MbtiType.kt +++ b/feature/profile/src/main/java/com/moya/funch/uimodel/MbtiItem.kt @@ -1,8 +1,12 @@ package com.moya.funch.uimodel enum class MbtiItem { - E, I, - N, S, - T, F, - J, P + E, + I, + N, + S, + T, + F, + J, + P } From 841533fd7c8cc880538ea3e8b459400b5fb4b452 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Tue, 13 Feb 2024 14:46:05 +0900 Subject: [PATCH 20/25] =?UTF-8?q?[feat]=20:=20=ED=94=84=EB=A1=9C=ED=95=84?= =?UTF-8?q?=20string=20res=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/profile/src/main/res/values/strings.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/feature/profile/src/main/res/values/strings.xml b/feature/profile/src/main/res/values/strings.xml index bae787c4..de631896 100644 --- a/feature/profile/src/main/res/values/strings.xml +++ b/feature/profile/src/main/res/values/strings.xml @@ -1,3 +1,10 @@ + - profile + 프로필 만들기 + 프로필을 만들어 공통점을 찾을 수 있어요 + 최대 %d글자 + 최대 %d글자까지 입력할 수 있어요 + 가까운 지하철역 검색 + 존재하지 않는 지하철역이에요 + 이제 매칭할래요! From 799687910126f3faafd0dc60c881ff0abe491d30 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Tue, 13 Feb 2024 14:47:04 +0900 Subject: [PATCH 21/25] =?UTF-8?q?[feat]=20:=20ProfileLabel=20'=EB=8B=89?= =?UTF-8?q?=EB=84=A4=EC=9E=84'=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile/src/main/java/com/moya/funch/MyProfileScreen.kt | 3 ++- .../src/main/java/com/moya/funch/uimodel/ProfileLabel.kt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt b/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt index 7571dd4f..34e708e0 100644 --- a/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt @@ -95,13 +95,14 @@ private fun UsersDistinct(profile: Profile) { .fillMaxSize(), verticalArrangement = Arrangement.spacedBy(16.dp) ) { - ProfileLabel.entries.forEach { profileLabel -> + ProfileLabel.entries.filterNot { it == ProfileLabel.NICKNAME }.forEach { profileLabel -> val labelValues = when (profileLabel) { ProfileLabel.JOB -> listOf(profile.job.krName) ProfileLabel.CLUB -> profile.clubs.map { it.label } ProfileLabel.MBTI -> listOf(profile.mbti.name) ProfileLabel.BLOOD_TYPE -> listOf(profile.blood.type) ProfileLabel.SUBWAY -> profile.subways.map { it.name } + ProfileLabel.NICKNAME -> emptyList() } if (labelValues.isNotEmpty()) { diff --git a/feature/profile/src/main/java/com/moya/funch/uimodel/ProfileLabel.kt b/feature/profile/src/main/java/com/moya/funch/uimodel/ProfileLabel.kt index a0a3eb4b..54bbc7a4 100644 --- a/feature/profile/src/main/java/com/moya/funch/uimodel/ProfileLabel.kt +++ b/feature/profile/src/main/java/com/moya/funch/uimodel/ProfileLabel.kt @@ -1,6 +1,7 @@ package com.moya.funch.uimodel enum class ProfileLabel(val labelName: String) { + NICKNAME("닉네임"), JOB("직군"), CLUB("동아리"), MBTI("MBTI"), From e3dc1c4c52f7384d94d2e959796e2269dd39c876 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Tue, 13 Feb 2024 14:49:08 +0900 Subject: [PATCH 22/25] =?UTF-8?q?[refactor]=20:=20CreateProfile=20string?= =?UTF-8?q?=20res=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/moya/funch/CreateProflieScreen.kt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt index 009e1ecd..2055b815 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt @@ -38,6 +38,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.boundsInWindow import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.platform.LocalFocusManager +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -58,6 +59,7 @@ import com.moya.funch.entity.Club import com.moya.funch.entity.Job import com.moya.funch.entity.profile.Profile import com.moya.funch.icon.FunchIconAsset +import com.moya.funch.profile.R import com.moya.funch.theme.FunchTheme import com.moya.funch.theme.Gray300 import com.moya.funch.theme.Gray400 @@ -137,13 +139,13 @@ fun CreateProfileScreen( Column(modifier = Modifier.padding(horizontal = 20.dp)) { Spacer(modifier = Modifier.height(8.dp)) Text( - text = "프로필 만들기", + text = stringResource(id = R.string.create_profile_title), color = White, style = FunchTheme.typography.t2 ) Spacer(modifier = Modifier.height(2.dp)) Text( - text = "프로필을 만들어 공통점을 찾을 수 있어요", + text = stringResource(id = R.string.create_profile_sub_title), color = Gray300, style = FunchTheme.typography.b ) @@ -210,11 +212,11 @@ private fun NicknameRow(nickname: String, onNicknameChange: (String) -> Unit, is } }, maxLength = MAX_NICKNAME_LENGTH, - hint = "최대 ${MAX_NICKNAME_LENGTH}글자", + hint = stringResource(id = R.string.nickname_textfield_hint, MAX_NICKNAME_LENGTH), isError = isNicknameError, interactionSource = interactionSource, isFocus = isFocused, - errorText = "최대 ${MAX_NICKNAME_LENGTH}글자까지 입력할 수 있어요", + errorText = stringResource(id = R.string.nickname_error_caption, MAX_NICKNAME_LENGTH), keyboardOptions = KeyboardOptions.Default.copy( imeAction = ImeAction.Done ), @@ -434,9 +436,9 @@ private fun SubwayRow( FunchIconTextField( value = subwayStation, onValueChange = onSubwayStationChange, - hint = "가까운 지하철역 검색", + hint = stringResource(id = R.string.subway_textfield_hint), isError = isError, - errorText = "존재하지 않는 지하철역이에요", + errorText = stringResource(id = R.string.subway_error_caption), iconType = FunchIcon( resId = FunchIconAsset.Search.search_24, tint = Gray400, @@ -473,7 +475,7 @@ private fun BottomBar(backgroundColor: Color, isCreateProfile: Boolean, onNaviga modifier = Modifier.fillMaxWidth(), buttonType = FunchButtonType.Full, onClick = onNavigateToHome, - text = "이제 매칭할래요!" + text = stringResource(id = R.string.bottom_button_title) ) } } From ffcf53fbc197457bd9f5c77476fa59a185737b0a Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Tue, 13 Feb 2024 14:50:07 +0900 Subject: [PATCH 23/25] =?UTF-8?q?[refactor]=20:=20=EB=9D=BC=EB=B2=A8?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20ProfileLabel=EC=9D=98=20labelName=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/moya/funch/CreateProflieScreen.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt index 2055b815..8d208d4d 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt @@ -199,7 +199,7 @@ private fun NicknameRow(nickname: String, onNicknameChange: (String) -> Unit, is } Row { - FunchLargeLabel(text = "닉네임") + FunchLargeLabel(text = ProfileLabel.NICKNAME.labelName) Column { FunchMaxLengthTextField( value = nickname, @@ -234,7 +234,7 @@ private fun NicknameRow(nickname: String, onNicknameChange: (String) -> Unit, is @Composable private fun JobRow(profile: Profile, onSelected: (Job) -> Unit) { Row { - FunchSmallLabel(text = "직군") + FunchSmallLabel(text = ProfileLabel.JOB.labelName) FlowRow( modifier = Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp), @@ -280,7 +280,7 @@ private fun JobRow(profile: Profile, onSelected: (Job) -> Unit) { @Composable private fun ClubRow(onSelectClub: (Club) -> Unit) { Row { - FunchSmallLabel(text = "동아리") + FunchSmallLabel(text = ProfileLabel.CLUB.labelName) FlowRow( modifier = Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp), From d18d788ae521787f5c8feaf2a7de525bf91e70c1 Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Tue, 13 Feb 2024 14:51:19 +0900 Subject: [PATCH 24/25] =?UTF-8?q?[refactor]=20:=20mbtiRow=20=EA=B5=AC?= =?UTF-8?q?=EB=AC=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/moya/funch/CreateProflieScreen.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt index 8d208d4d..4e92734c 100644 --- a/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/CreateProflieScreen.kt @@ -328,15 +328,13 @@ private fun ClubRow(onSelectClub: (Club) -> Unit) { @Composable private fun MbtiRow(onSelectMbti: (MbtiItem) -> Unit, isSelectMbti: (MbtiItem) -> Boolean) { - val mbtiList = MbtiItem.entries.chunked(2) - Row { FunchSmallLabel(text = ProfileLabel.MBTI.labelName) Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(8.dp) ) { - mbtiList.forEachIndexed { i, pair -> + MbtiItem.entries.chunked(2).forEach { pair -> Column( modifier = Modifier .background(color = Gray800, shape = FunchTheme.shapes.medium) From 2ffa49442b8d15a467709ec0472ea8e3869d757d Mon Sep 17 00:00:00 2001 From: GunHyung Ham Date: Tue, 13 Feb 2024 14:52:23 +0900 Subject: [PATCH 25/25] =?UTF-8?q?[refactor]=20:=20MyProfile=20clubPainter?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=EB=A1=9C=20=EC=98=A4=EB=A5=98=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 --- .../profile/src/main/java/com/moya/funch/MyProfileScreen.kt | 6 +++--- .../java/com/moya/funch/navigation/MyProfileNavigatoin.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt b/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt index 34e708e0..0ca1c1f0 100644 --- a/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt +++ b/feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt @@ -25,6 +25,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.moya.funch.common.clubPainter import com.moya.funch.common.jobPainter import com.moya.funch.common.subwayLinePainter import com.moya.funch.component.FunchChip @@ -128,9 +129,8 @@ private fun UsersDistinct(profile: Profile) { ) { labelValues.forEach { value -> val leadingIcon = when (profileLabel) { - ProfileLabel.JOB, ProfileLabel.CLUB -> - jobPainter(value) - + ProfileLabel.JOB -> jobPainter(value) + ProfileLabel.CLUB -> clubPainter(value) else -> null } val trailingIcon = when (profileLabel) { diff --git a/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt b/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt index 6e79eb5c..e64f244f 100644 --- a/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt +++ b/feature/profile/src/main/java/com/moya/funch/navigation/MyProfileNavigatoin.kt @@ -13,7 +13,7 @@ const val PROFILE_GRAPH_ROUTE = "profile_graph" fun NavController.navigateToMyProfile(navOptions: NavOptions? = null) = navigate(ProfileScreens.MyProfile.route, navOptions) -fun NavController.closeMyProfile() = popBackStack() // 텍스트 필드의 값을 남기기 위해 사용 +fun NavController.closeMyProfile() = popBackStack() fun NavGraphBuilder.profileGraph(onNavigateToHome: () -> Unit, onCloseMyProfile: () -> Unit) { navigation(