diff --git a/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/Button.kt b/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/Button.kt index 1cbbb27..80b7fe1 100644 --- a/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/Button.kt +++ b/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/Button.kt @@ -2,14 +2,19 @@ package com.appleroid.core.designsystem.component import androidx.compose.foundation.Image import androidx.compose.foundation.background +import androidx.compose.foundation.border import androidx.compose.foundation.clickable import androidx.compose.foundation.gestures.Orientation import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.foundation.layout.wrapContentWidth import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -21,13 +26,16 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import com.appleroid.core.designsystem.theme.BLACK import com.appleroid.core.designsystem.theme.DOT import com.appleroid.core.designsystem.theme.GREY05 +import com.appleroid.core.designsystem.theme.GREY08 import com.appleroid.core.designsystem.theme.POINT01 import com.appleroid.core.designsystem.theme.WHITE @@ -123,3 +131,36 @@ fun ImageWithTextBtn( } } } + +@Composable +fun LabelBtn( + modifier: Modifier, + text: String, + textColor: Color, + borderColor : Color, + horizontalPadding : Dp +){ + Box( + modifier = modifier + .wrapContentWidth() + .wrapContentHeight() + .background( + color = Color.Transparent, + shape = RoundedCornerShape(17.dp) + ) + .border( + width = 1.dp, + color = borderColor, + shape = RoundedCornerShape(17.dp) + ) + ){ + Text( + text = text, + style = MaterialTheme.typography.labelSmall, + color = textColor, + modifier = Modifier + .padding(horizontal = horizontalPadding) + .padding(top = 2.dp, bottom = 3.5.dp) + ) + } +} diff --git a/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/CheckBox.kt b/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/CheckBox.kt index fbdb4f2..0d543f5 100644 --- a/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/CheckBox.kt +++ b/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/CheckBox.kt @@ -26,15 +26,22 @@ 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.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import com.appleroid.core.designsystem.R import com.appleroid.core.designsystem.theme.BTN_BACKGROUND import com.appleroid.core.designsystem.theme.DOT import com.appleroid.core.designsystem.theme.GREY01 +import com.appleroid.core.designsystem.theme.GREY02 +import com.appleroid.core.designsystem.theme.GREY04 import com.appleroid.core.designsystem.theme.GREY05 import com.appleroid.core.designsystem.theme.POINT01 import com.appleroid.core.designsystem.theme.POINT01_23 import com.appleroid.core.designsystem.theme.WHITE +import com.appleroid.core.designsystem.utils.textSp @Composable fun WithTextCheckBoxCard( @@ -65,14 +72,18 @@ fun WithTextCheckBoxCard( Image( painter = painterResource(if(isSelected) R.drawable.ic_select_check else R.drawable.ic_unselect_check), contentDescription = "icon_check", - modifier = Modifier.size(16.dp) + modifier = Modifier + .size(16.dp) + .align(Alignment.CenterVertically) ) - Text( + LabelText( text = text, color = if(isSelected) POINT01 else WHITE, style = MaterialTheme.typography.labelMedium, - modifier = Modifier.padding(start = 12.dp) + modifier = Modifier + .padding(start = 12.dp) + .align(Alignment.CenterVertically) ) if (percentText.isNotBlank()) { @@ -82,7 +93,9 @@ fun WithTextCheckBoxCard( text = percentText, color = WHITE, style = MaterialTheme.typography.labelMedium, - modifier = Modifier.padding(start = 8.dp, end = 16.dp) + modifier = Modifier + .padding(start = 8.dp, end = 16.dp) + .align(Alignment.CenterVertically) ) } } @@ -94,7 +107,6 @@ fun MbtiCheckBox( modifier: Modifier = Modifier, key : String, text : String, - painter : Painter, isChecked : Boolean, onClick : (String) -> Unit ){ @@ -106,43 +118,31 @@ fun MbtiCheckBox( ){ Box(modifier = Modifier .fillMaxSize() - .padding(8.dp) - .clip(CircleShape) + .padding(5.dp) + .clip(RoundedCornerShape(12.dp)) .border( - width = 1.dp, - color = if(isChecked) POINT01 else BTN_BACKGROUND, - shape = CircleShape - ) - .background( - color = if(isChecked) POINT01_23 else BTN_BACKGROUND, + width = 2.dp, + color = if(isChecked) POINT01 else GREY04, + shape = RoundedCornerShape(12.dp) ) + .background(color = GREY04) ){ - Icon( - painter = painter, - tint = if(isChecked) POINT01 else DOT, - contentDescription = "mbti", - modifier = Modifier.align(Alignment.Center) - ) - } - - if(isChecked){ - Box( + LabelText( modifier = Modifier - .width(33.dp) - .height(20.dp) - .align(Alignment.BottomCenter) - .background( - color = POINT01, - shape = RoundedCornerShape(6.dp) - ) - ){ - Text( - text = text, - style = MaterialTheme.typography.displaySmall, - color = Color.Black, - modifier = Modifier.align(Alignment.Center) - ) - } + .height(44.dp) + .align(Alignment.Center), + text = text, + color = if(isChecked) POINT01 else GREY02, + style = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 14.dp.textSp, + lineHeight = 21.dp.textSp, + letterSpacing = 0.dp.textSp, + textAlign = TextAlign.Center + ), + alignment = Alignment.Center + ) } } } diff --git a/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/Text.kt b/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/Text.kt index e2af60f..4ba06a5 100644 --- a/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/Text.kt +++ b/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/Text.kt @@ -36,7 +36,8 @@ fun TitleText( fun DescriptionText( modifier: Modifier = Modifier, title : String = "", - alignment: Alignment = Alignment.CenterStart + alignment: Alignment = Alignment.CenterStart, + textAlign: TextAlign = TextAlign.Left ){ Box( modifier = modifier @@ -45,6 +46,7 @@ fun DescriptionText( text = title, color = GREY01, style = MaterialTheme.typography.labelMedium, + textAlign = textAlign, modifier = Modifier.align(alignment) ) } diff --git a/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/TextField.kt b/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/TextField.kt index 63c3882..be47eed 100644 --- a/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/TextField.kt +++ b/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/TextField.kt @@ -50,7 +50,6 @@ fun MKungTextField( textStyle: TextStyle, placeholder : String = "", placeholderColor : Color = GREY01, - isLimitWidth : Boolean = false, focusRequester: FocusRequester = remember { FocusRequester() }, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, @@ -87,10 +86,7 @@ fun MKungTextField( modifier = Modifier .align(Alignment.CenterStart) .focusRequester(focusRequester) - .then( - if(isLimitWidth) Modifier.width(textFieldWidth) - else Modifier.wrapContentWidth() - ) + .fillMaxWidth() ) } } diff --git a/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/TopAppBar.kt b/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/TopAppBar.kt index f459e06..94abfdb 100644 --- a/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/TopAppBar.kt +++ b/core/designsystem/src/main/java/com/appleroid/core/designsystem/component/TopAppBar.kt @@ -1,8 +1,11 @@ package com.appleroid.core.designsystem.component import androidx.compose.foundation.Image + +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -59,7 +62,7 @@ fun BackWithTextTopAppBar( .align(Alignment.CenterStart) .size(28.dp) .clickable { - + } ) diff --git a/core/designsystem/src/main/java/com/appleroid/core/designsystem/theme/Color.kt b/core/designsystem/src/main/java/com/appleroid/core/designsystem/theme/Color.kt index f76af14..01462d9 100644 --- a/core/designsystem/src/main/java/com/appleroid/core/designsystem/theme/Color.kt +++ b/core/designsystem/src/main/java/com/appleroid/core/designsystem/theme/Color.kt @@ -3,6 +3,9 @@ package com.appleroid.core.designsystem.theme import androidx.compose.ui.graphics.Color val BLACK = Color(0xFF000000) + +val GREY08 = Color(0xFF454545) +val GREY07 = Color(0xFF212121) val GREY06 = Color(0xFF141414) val GREY05 = Color(0xFF292929) val GREY04 = Color(0xFF383838) diff --git a/core/designsystem/src/main/java/com/appleroid/core/designsystem/theme/Type.kt b/core/designsystem/src/main/java/com/appleroid/core/designsystem/theme/Type.kt index 258e0ea..866ce5b 100644 --- a/core/designsystem/src/main/java/com/appleroid/core/designsystem/theme/Type.kt +++ b/core/designsystem/src/main/java/com/appleroid/core/designsystem/theme/Type.kt @@ -35,15 +35,15 @@ fun mKungTypography() = Typography( fontFamily = FontFamily.Default, fontWeight = FontWeight.SemiBold, fontSize = 18.dp.textSp, - lineHeight = 20.dp.textSp, + lineHeight = 27.dp.textSp, letterSpacing = 0.dp.textSp, color = WHITE ), labelMedium = TextStyle( fontFamily = FontFamily.Default, - fontWeight = FontWeight.SemiBold, + fontWeight = FontWeight.Normal, fontSize = 14.dp.textSp, - lineHeight = 16.dp.textSp, + lineHeight = 21.dp.textSp, letterSpacing = 0.dp.textSp, color = WHITE ), @@ -54,6 +54,14 @@ fun mKungTypography() = Typography( lineHeight = 16.dp.textSp, letterSpacing = 0.dp.textSp ), + displayMedium = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 14.dp.textSp, + lineHeight = 21.dp.textSp, + letterSpacing = 0.dp.textSp, + color = WHITE + ), displaySmall = TextStyle( fontFamily = FontFamily.Default, fontWeight = FontWeight.Normal, diff --git a/core/designsystem/src/main/java/com/appleroid/core/designsystem/utils/TextUtils.kt b/core/designsystem/src/main/java/com/appleroid/core/designsystem/utils/TextUtils.kt index c711f64..402ad1b 100644 --- a/core/designsystem/src/main/java/com/appleroid/core/designsystem/utils/TextUtils.kt +++ b/core/designsystem/src/main/java/com/appleroid/core/designsystem/utils/TextUtils.kt @@ -20,8 +20,11 @@ fun Int.toDp(): Dp { return (this / Resources.getSystem().displayMetrics.density).dp } class PhoneNumberVisualTransformation : VisualTransformation { + override fun filter(text: AnnotatedString): TransformedText { - val formattedText = formatPhoneNumber(text.text) + + val formattedText = formatPhoneNumber(text.text.replace(".","").replace(",","")) + val offsetMapping = object : OffsetMapping { override fun originalToTransformed(offset: Int): Int { if (offset <= 2) return offset diff --git a/feature/ask/src/main/java/com/appleroid/feature/ask/AskScreen.kt b/feature/ask/src/main/java/com/appleroid/feature/ask/AskScreen.kt index 6546131..fdeef62 100644 --- a/feature/ask/src/main/java/com/appleroid/feature/ask/AskScreen.kt +++ b/feature/ask/src/main/java/com/appleroid/feature/ask/AskScreen.kt @@ -1,27 +1,226 @@ package com.appleroid.feature.ask +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.Text +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.safeDrawing +import androidx.compose.foundation.layout.windowInsetsPadding +import androidx.compose.foundation.layout.wrapContentSize +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Switch +import androidx.compose.material3.SwitchDefaults import androidx.compose.runtime.Composable +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.graphics.Color -import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.unit.dp +import com.appleroid.core.designsystem.component.BackWithTextTopAppBar +import com.appleroid.core.designsystem.component.LabelText +import com.appleroid.core.designsystem.component.MKungBtn +import com.appleroid.core.designsystem.component.MKungTextField +import com.appleroid.core.designsystem.theme.BLACK +import com.appleroid.core.designsystem.theme.GREY02 +import com.appleroid.core.designsystem.theme.GREY03 +import com.appleroid.core.designsystem.theme.GREY05 +import com.appleroid.core.designsystem.theme.POINT01 +import com.appleroid.core.designsystem.theme.WHITE +import kotlinx.coroutines.launch @Composable fun AskRoute() { AskScreen() } - @Composable fun AskScreen() { - Box(modifier = Modifier.fillMaxSize()) { - Text( - text = "ask", - modifier = Modifier.align(Alignment.Center), - style = TextStyle(color = Color.White) + var inputTitle by remember { mutableStateOf("") } + var inputContent by remember { mutableStateOf("") } + var isChecked by remember { mutableStateOf(false) } + var bottomBtnEnable by remember { mutableStateOf(false) } + + val boxModifier = Modifier + .fillMaxWidth() + .background(color = GREY05, shape = RoundedCornerShape(12.dp)) + + Box( + modifier = Modifier + .fillMaxSize() + .background(BLACK) + .windowInsetsPadding(WindowInsets.safeDrawing) + ) { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 20.dp) + .verticalScroll(rememberScrollState()) + ) { + BackWithTextTopAppBar( + height = 52.dp, + title = stringResource(R.string.ask_add), + ) + + Spacer(modifier = Modifier.height(20.dp)) + + InputField( + text = inputTitle, + onTextChanged = { inputTitle = it }, + placeholder = stringResource(R.string.ask_input_title), + modifier = boxModifier.height(48.dp) + ) + + Spacer(modifier = Modifier.height(16.dp)) + + InputField( + text = inputContent, + onTextChanged = { inputContent = it }, + placeholder = stringResource(R.string.ask_input_content_free), + modifier = boxModifier.height(300.dp) + ) + + Spacer(modifier = Modifier.height(16.dp)) + + ToggleSwitch( + isChecked = isChecked, + onCheckedChange = { isChecked = it } + ) + + AnimatedVisibility(visible = isChecked) { + Column { + Spacer(modifier = Modifier.height(12.dp)) + VoteTextField() + Spacer(modifier = Modifier.height(12.dp)) + VoteTextField() + } + } + } + + if (inputTitle.isNotBlank() && inputContent.isNotBlank()) { + bottomBtnEnable = true + } else bottomBtnEnable = true + + Box( + modifier = Modifier.fillMaxSize() // 화면 전체를 채우는 Box + ) { + AnimatedVisibility( + visible = inputTitle.isNotBlank() && inputContent.isNotBlank(), + modifier = Modifier.align(Alignment.BottomCenter) + ) { + MKungBtn( + modifier = Modifier + .fillMaxWidth() + .height(48.dp) + .padding(horizontal = 20.dp), + enable = bottomBtnEnable, + text = stringResource(R.string.registration), + ) { + + } + } + } + } +} + +@Composable +fun InputField( + text: String, + onTextChanged: (String) -> Unit, + placeholder: String, + modifier: Modifier = Modifier +) { + Box( + modifier = modifier, + contentAlignment = Alignment.TopStart + ) { + MKungTextField( + modifier = Modifier.padding(12.dp), + textStyle = MaterialTheme.typography.bodyMedium.copy(color = Color.White), + placeholder = placeholder, + placeholderColor = GREY03, + keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), + text = text, + onChangedText = onTextChanged ) } -} \ No newline at end of file +} + +@Composable +fun ToggleSwitch( + isChecked: Boolean, + onCheckedChange: (Boolean) -> Unit +) { + Row( + modifier = Modifier + .height(48.dp) + .fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically + ) { + LabelText( + modifier = Modifier.wrapContentSize(), + text = stringResource(R.string.ask_vote), + style = MaterialTheme.typography.titleMedium, + color = Color.White + ) + + Spacer(modifier = Modifier.weight(1F)) + + Switch( + checked = isChecked, + onCheckedChange = onCheckedChange, + colors = SwitchDefaults.colors( + uncheckedBorderColor = GREY02, + uncheckedThumbColor = WHITE, + uncheckedTrackColor = GREY02, + checkedBorderColor = POINT01, + checkedThumbColor = WHITE, + checkedTrackColor = POINT01, + + ), + ) + } +} + +@Composable +fun VoteTextField() { + var inputText by remember { mutableStateOf("") } + + Box( + modifier = Modifier + .fillMaxWidth() + .height(48.dp) + .background( + color = GREY05, + shape = RoundedCornerShape(12.dp) + ), + contentAlignment = Alignment.TopStart + ) { + MKungTextField( + modifier = Modifier.padding(12.dp), + textStyle = MaterialTheme.typography.bodyMedium.copy(color = Color.White), + placeholder = stringResource(R.string.ask_input_vote), + placeholderColor = GREY03, + keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), + text = inputText, + onChangedText = { + inputText = it + } + ) + } +} diff --git a/feature/ask/src/main/res/values/strings.xml b/feature/ask/src/main/res/values/strings.xml new file mode 100644 index 0000000..ba1a31a --- /dev/null +++ b/feature/ask/src/main/res/values/strings.xml @@ -0,0 +1,9 @@ + + + 질문 추가 + 제목을 입력해 주세요 + 내용을 자유롭게 입력해 보세요. + 투표 + 투표 항목을 입력해 주세요. + 등록 + \ No newline at end of file diff --git a/feature/home/src/main/java/com/appleroid/feature/home/HomeScreen.kt b/feature/home/src/main/java/com/appleroid/feature/home/HomeScreen.kt index 6504d68..8443293 100644 --- a/feature/home/src/main/java/com/appleroid/feature/home/HomeScreen.kt +++ b/feature/home/src/main/java/com/appleroid/feature/home/HomeScreen.kt @@ -1,6 +1,5 @@ package com.appleroid.feature.home -import android.util.Log import android.widget.Toast import androidx.compose.animation.Crossfade import androidx.compose.foundation.Image @@ -34,11 +33,9 @@ import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.SheetState -import androidx.compose.material3.Text import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.MutableState import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf @@ -61,27 +58,22 @@ import com.appleroid.core.designsystem.component.CircleImage import com.appleroid.core.designsystem.component.CustomDragHandle import com.appleroid.core.designsystem.component.EmptyContent import com.appleroid.core.designsystem.component.LabelText -import com.appleroid.core.designsystem.component.MKungTextField import com.appleroid.core.designsystem.component.SendTextField import com.appleroid.core.designsystem.component.TitleText import com.appleroid.core.designsystem.component.VoteStatisticsRow import com.appleroid.core.designsystem.component.WithTextCheckBoxCard -import com.appleroid.core.designsystem.theme.BTN_BACKGROUND -import com.appleroid.core.designsystem.theme.GREY01 import com.appleroid.core.designsystem.theme.GREY03 import com.appleroid.core.designsystem.theme.GREY04 import com.appleroid.core.designsystem.theme.GREY05 import com.appleroid.core.designsystem.theme.GREY06 import com.appleroid.core.designsystem.theme.POINT01 import com.appleroid.core.designsystem.theme.WHITE -import com.appleroid.core.designsystem.utils.PhoneNumberVisualTransformation import com.appleroid.core.ui.FeedCard import com.appleroid.core.ui.FeedComment import com.appleroid.core.ui.MKungTabRow import com.appleroid.core.ui.ReportButtonSheet import com.appleroid.core.ui.UserInfoRow import com.appleroid.feature.home.model.FeedType -import com.appleroid.feature.home.model.ReplyType import com.appleroid.model.CommentInfo import com.appleroid.model.CommentItem import com.appleroid.model.FeedInfoItem diff --git a/feature/join/src/main/java/com/appleroid/feature/join/JoinScreen.kt b/feature/join/src/main/java/com/appleroid/feature/join/JoinScreen.kt index 3cd3619..54395d3 100644 --- a/feature/join/src/main/java/com/appleroid/feature/join/JoinScreen.kt +++ b/feature/join/src/main/java/com/appleroid/feature/join/JoinScreen.kt @@ -1,5 +1,6 @@ package com.appleroid.feature.join +import android.annotation.SuppressLint import androidx.compose.foundation.Canvas import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -36,13 +37,17 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.text.input.VisualTransformation +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import com.appleroid.core.designsystem.component.CheckTextField import com.appleroid.core.designsystem.component.DescriptionText +import com.appleroid.core.designsystem.component.LabelBtn import com.appleroid.core.designsystem.component.LabelText import com.appleroid.core.designsystem.component.MKungBtn import com.appleroid.core.designsystem.component.MKungTextField @@ -52,15 +57,17 @@ import com.appleroid.core.designsystem.component.TopAppBar import com.appleroid.core.designsystem.component.WithTextCheckBoxCard import com.appleroid.core.designsystem.theme.DOT import com.appleroid.core.designsystem.theme.GREY01 -import com.appleroid.core.designsystem.theme.GREY04 import com.appleroid.core.designsystem.theme.GREY06 +import com.appleroid.core.designsystem.theme.GREY07 +import com.appleroid.core.designsystem.theme.GREY08 import com.appleroid.core.designsystem.utils.PhoneNumberVisualTransformation import com.appleroid.core.designsystem.utils.keyboardAsState import com.appleroid.feature.join.model.BottomSheetType import com.appleroid.feature.join.model.CarrierType import com.appleroid.feature.join.model.ENERGY_DIRECTION +import com.appleroid.feature.join.model.InputType import com.appleroid.feature.join.model.JUDGMENT -import com.appleroid.feature.join.model.MbtiImage +import com.appleroid.feature.join.model.MbtiResult import com.appleroid.feature.join.model.MbtiType import com.appleroid.feature.join.model.PagerType import com.appleroid.feature.join.model.RECOGNIZE @@ -78,7 +85,6 @@ fun JoinRoute( ) } -@OptIn(ExperimentalMaterial3Api::class) @Composable fun JoinScreen( modifier: Modifier = Modifier, @@ -86,23 +92,23 @@ fun JoinScreen( ) { val pagerState = rememberPagerState { 4 } val scope = rememberCoroutineScope() - val bottomSheetState = rememberModalBottomSheetState() val focusManager = LocalFocusManager.current val isKeyboardOpen by keyboardAsState() var selectedAllTerm by remember { mutableStateOf(false) } var selectedPrivacyTerm by remember { mutableStateOf(false) } var selectedServiceTerm by remember { mutableStateOf(false) } - var isShowBottomSheet by remember { mutableStateOf(false) } var bottomBtnEnable by remember { mutableStateOf(false) } var selectedEnergyDirection by remember { mutableStateOf(null) } var selectedRecognize by remember { mutableStateOf(null) } var selectedJudgment by remember { mutableStateOf(null) } var selectedPlanning by remember { mutableStateOf(null) } + var isSendVerifyNumber by remember{ mutableStateOf(false) } + var selectedCarrier by remember { mutableStateOf(null) } var phoneNumber by remember { mutableStateOf("") } - var bottomSheetType by remember { mutableStateOf(BottomSheetType.CARRIER) } + var verifyNumber by remember { mutableStateOf("") } var nickname by remember { mutableStateOf("") } @@ -188,13 +194,12 @@ fun JoinScreen( PagerType.PHONE_VERIFY.index -> { PhoneVerifyScreen( modifier = Modifier.align(Alignment.TopCenter), - selectedCarrier = selectedCarrier, + isSendVerifyNumber = isSendVerifyNumber, phoneNumber = phoneNumber, + verifyNumber = verifyNumber, onChangedPhoneNumber = { newValue -> phoneNumber = newValue }, - onClickCarrier = { - bottomSheetType = BottomSheetType.CARRIER - isShowBottomSheet = true - } + onChangedVerifyNumber = { newValue -> verifyNumber = newValue }, + onClickVerifySend = { isSendVerifyNumber = true } ) } @@ -250,31 +255,13 @@ fun JoinScreen( } } - if ( - selectedEnergyDirection != null - && selectedRecognize != null - && selectedJudgment != null - && selectedPlanning != null - ){ - Image( - modifier = Modifier - .fillMaxWidth() - .height(394.dp) - .align(Alignment.TopCenter), - painter = painterResource(R.drawable.img_mbti_selected), - contentDescription = "img_mbti_selected", - contentScale = ContentScale.FillBounds - ) - } - - MKungBtn( modifier = Modifier .fillMaxWidth() - .height(73.dp) + .padding(bottom = 28.dp) + .height(48.dp) .align(Alignment.BottomCenter) - .padding(horizontal = 20.dp) - .padding(bottom = 20.dp), + .padding(horizontal = 20.dp), enable = bottomBtnEnable, text = stringResource( when (pagerState.currentPage) { @@ -288,8 +275,7 @@ fun JoinScreen( scope.launch { when (pagerState.currentPage) { PagerType.PHONE_VERIFY.index -> { - bottomSheetType = BottomSheetType.VERIFY - isShowBottomSheet = true + pagerState.animateScrollToPage(pagerState.currentPage + 1) } PagerType.MBTI.index -> { joinCompleteClicked.invoke() @@ -301,41 +287,6 @@ fun JoinScreen( } } } - - if (isShowBottomSheet) { - ModalBottomSheet( - onDismissRequest = { isShowBottomSheet = false }, - sheetState = bottomSheetState, - containerColor = GREY06, - dragHandle = null - ) { - when (bottomSheetType) { - BottomSheetType.CARRIER -> { - CarrierScreen( - onClickCarrier = { - selectedCarrier = it - isShowBottomSheet = false - }, - onClose = { isShowBottomSheet = false } - ) - } - - BottomSheetType.VERIFY -> { - VerifyScreen( - onClose = { - isShowBottomSheet = false - }, - onComplete = { - isShowBottomSheet = false - scope.launch { - pagerState.animateScrollToPage(pagerState.currentPage + 1) - } - } - ) - } - } - } - } } @Composable @@ -352,14 +303,14 @@ fun TermScreen( Column( modifier = modifier + .padding(horizontal = 20.dp) ) { Spacer(modifier = Modifier.height(20.dp)) TitleText( modifier = Modifier .fillMaxWidth() - .height(64.dp) - .padding(horizontal = 24.dp), + .height(64.dp), title = stringResource(R.string.term_title) ) @@ -371,8 +322,7 @@ fun TermScreen( WithTextCheckBoxCard( modifier = Modifier .fillMaxWidth() - .height(48.dp) - .padding(horizontal = 24.dp), + .height(48.dp), text = stringResource(type.stringRes), isSelected = when (type) { TermType.ALL_TERM -> selectedAllTerm @@ -394,159 +344,52 @@ fun TermScreen( @Composable fun PhoneVerifyScreen( modifier: Modifier = Modifier, - selectedCarrier: CarrierType?, + isSendVerifyNumber: Boolean, phoneNumber: String, + verifyNumber: String, onChangedPhoneNumber: (String) -> Unit, - onClickCarrier: () -> Unit + onChangedVerifyNumber: (String) -> Unit, + onClickVerifySend : () -> Unit ) { Column( modifier = modifier + .padding(horizontal = 20.dp) ) { Spacer(modifier = Modifier.height(20.dp)) TitleText( modifier = Modifier .fillMaxWidth() - .height(64.dp) - .padding(horizontal = 24.dp), + .height(64.dp), title = stringResource(R.string.phone_verify_title) ) DescriptionText( modifier = Modifier .fillMaxWidth() - .height(21.dp) - .padding(horizontal = 24.dp), + .height(21.dp), title = stringResource(R.string.phone_verify_description) ) - Column( - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 20.dp) - .padding(top = 30.dp) - .background( - color = GREY04, - shape = RoundedCornerShape(12.dp) - ) - ) { - Spacer(modifier = Modifier.height(6.dp)) - - PhoneVerifyInput( - title = stringResource(R.string.phone_number), - inputContent = { - Row { - LabelText( - modifier = Modifier - .height(27.dp) - .align(Alignment.CenterVertically) - .clickable { onClickCarrier() }, - text = stringResource(selectedCarrier?.stringRes ?: R.string.carrier), - style = MaterialTheme.typography.labelLarge, - color = Color.White - ) - - Spacer(modifier = Modifier.width(2.dp)) - - Image( - painter = painterResource(R.drawable.ic_dowm), - contentDescription = "down", - modifier = Modifier.align(Alignment.CenterVertically) - ) - - - MKungTextField( - modifier = Modifier - .padding(start = 10.dp) - .align(Alignment.CenterVertically), - textStyle = MaterialTheme.typography.labelLarge, - placeholder = stringResource(R.string.phone_number_placeholder), - placeholderColor = GREY01, - visualTransformation = PhoneNumberVisualTransformation(), - keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Phone), - text = phoneNumber, - onChangedText = { - if (it.isNotEmpty() && it.toIntOrNull() == null) return@MKungTextField - if (it.length < 12) onChangedPhoneNumber(it) - } - ) - } - } - ) + Spacer(modifier = Modifier.height(28.dp)) -// PhoneVerifyInput( -// title = stringResource(R.string.registration_number), -// inputContent = { -// Row{ -// MKungTextField( -// modifier = Modifier -// .height(27.dp) -// .align(Alignment.CenterVertically), -// textStyle = MaterialTheme.typography.labelLarge, -// placeholder = stringResource(R.string.registration_number_placeholder), -// placeholderColor = GREY01, -// isLimitWidth = true, -// focusRequester = focusRequesterRegistration, -// keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Phone), -// text = registrationNumber, -// onChangedText = { -// if(it.isNotEmpty() && it.toIntOrNull() == null) return@MKungTextField -// if(it.length == 6) focusRequesterRegistrationSecond.requestFocus() -// if(it.length < 7) onChangedRegistrationNumber(it) -// } -// ) -// -// LabelText( -// modifier = Modifier.padding(horizontal = 3.dp), -// text = stringResource(R.string.bar), -// style = MaterialTheme.typography.labelLarge, -// color = Color.White -// ) -// -// MKungTextField( -// modifier = Modifier -// .height(27.dp) -// .align(Alignment.CenterVertically), -// textStyle = MaterialTheme.typography.labelLarge, -// placeholder = stringResource(R.string.registration_number_second_placeholder), -// placeholderColor = GREY01, -// isLimitWidth = true, -// focusRequester = focusRequesterRegistrationSecond, -// keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Phone), -// text = registrationSecondNumber, -// onChangedText = { -// if(it.isNotEmpty() && it.toIntOrNull() == null) return@MKungTextField -// if(it.length == 1) focusRequesterName.requestFocus() -// if(it.length < 2) onChangedRegistrationSecondNumber(it) -// } -// ) -// -// repeat(6){ -// Dot(modifier = Modifier.align(Alignment.CenterVertically)) -// } -// } -// } -// ) -// -// PhoneVerifyInput( -// title = stringResource(R.string.name), -// inputContent = { -// MKungTextField( -// modifier = Modifier -// .height(27.dp), -// textStyle = MaterialTheme.typography.labelLarge, -// placeholder = stringResource(R.string.name_placeholder), -// placeholderColor = GREY01, -// focusRequester = focusRequesterName, -// keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), -// text = name, -// onChangedText = { -// if(it.length < 8 && it.all { text -> text.isKorean() }) onChangedName(it) -// } -// ) -// } -// ) + InputContent( + inputType = InputType.PHONE_VERIFY, + text = phoneNumber, + onChangedText = onChangedPhoneNumber, + onClick = onClickVerifySend + ) + + if(isSendVerifyNumber){ + Spacer(modifier = Modifier.height(18.dp)) + + InputContent( + inputType = InputType.VERIFY_NUMBER, + text = verifyNumber, + onChangedText = onChangedVerifyNumber, + onClick = {} + ) } } } @@ -558,7 +401,8 @@ fun NicknameScreen( onChangeNickname: (String) -> Unit ) { Column( - modifier = modifier.padding(horizontal = 24.dp) + modifier = modifier + .padding(horizontal = 20.dp) ) { Spacer(modifier = Modifier.height(20.dp)) @@ -578,13 +422,11 @@ fun NicknameScreen( Spacer(modifier = Modifier.height(23.dp)) - CheckTextField( + InputContent( + inputType = InputType.NICKNAME, text = nickname, - onChangeText = { - if (it.length < 11) onChangeNickname(it) - }, - label = stringResource(R.string.nickname_label), - btnImageRes = R.drawable.ic_valid + onChangedText = onChangeNickname, + onClick = {} ) } } @@ -599,60 +441,89 @@ fun MbtiScreen( onClick: (MbtiType) -> Unit ) { - val isAllChecked = selectedEnergyDirection != null - && selectedRecognize != null - && selectedJudgment != null - && selectedPlanning != null + val screenWidth = LocalConfiguration.current.screenWidthDp + + val mbtiResult = mbtiCheck( + selectedEnergyDirection = selectedEnergyDirection, + selectedRecognize = selectedRecognize, + selectedJudgment = selectedJudgment, + selectedPlanning = selectedPlanning + ) Column( modifier = modifier ) { - Spacer(modifier = Modifier.height(20.dp)) - TitleText( - modifier = Modifier - .fillMaxWidth() - .height(59.dp), - alignment = Alignment.TopCenter, - title = stringResource(R.string.mbti_title) - ) + Column( + modifier = Modifier.padding(horizontal = 20.dp) + ) { + Spacer(modifier = Modifier.height(20.dp)) + TitleText( + modifier = Modifier + .fillMaxWidth(), + alignment = Alignment.TopCenter, + textAlign = TextAlign.Center, + title = mbtiResult?.let { + stringResource(it.titleRes) + }?:run{ + stringResource(R.string.mbti_title) + } + ) - DescriptionText( - modifier = Modifier - .fillMaxWidth() - .height(21.dp), - title = stringResource(R.string.mbti_description), - alignment = Alignment.TopCenter - ) + Spacer(modifier = Modifier.height(5.dp)) + + DescriptionText( + modifier = Modifier + .fillMaxWidth(), + title = mbtiResult?.let { + stringResource(it.descriptionRes) + }?:run{ + stringResource(R.string.mbti_description) + }, + alignment = Alignment.TopCenter, + textAlign = TextAlign.Center, + ) + } + + Spacer(modifier = Modifier.weight(1f)) Box( modifier = Modifier .fillMaxWidth() - .height(234.dp) + .height((screenWidth * 0.55).dp) ) { - if (isAllChecked) { + mbtiResult?.let { Image( - painter = painterResource(R.drawable.img_mbti_background), + painter = painterResource(it.drawableRes), contentDescription = "mbti_background", modifier = Modifier.align(Alignment.Center) ) - } + }?:run{ + Image( + painter = painterResource(R.drawable.img_empty_mbti), + contentDescription = "mbti_image", + modifier = Modifier + .align(Alignment.Center) + .size(154.dp) + ) - Image( - painter = if (isAllChecked) { - val mbtiText = selectedEnergyDirection?.key + selectedRecognize?.key + selectedJudgment?.key + selectedPlanning?.key - painterResource(MbtiImage.valueOf(mbtiText).drawableRes) - }else painterResource(R.drawable.img_empty_mbti), - contentDescription = "mbti_image", - modifier = Modifier.align(Alignment.Center) - ) + Image( + painter = painterResource(R.drawable.img_empty_text), + contentDescription = "mbti_image", + modifier = Modifier + .align(Alignment.Center) + .padding(top = 4.dp, start = 2.dp) + ) + } } - Spacer(modifier = Modifier.height(11.dp)) + Spacer(modifier = Modifier.weight(1f)) + Row( modifier = Modifier - .padding(horizontal = 24.dp) + .padding(horizontal = 15.dp) + .padding(bottom = 86.dp) ) { repeat(4) { MbtiList( @@ -694,152 +565,111 @@ fun MbtiList( MbtiCheckBox( key = it.key, text = stringResource(it.stringRes), - painter = painterResource(it.drawableRes), isChecked = isChecked, onClick = { key -> onClick(MbtiType.valueOf(key)) } ) - Spacer(modifier = Modifier.height(8.dp)) + Spacer(modifier = Modifier.height(10.dp)) } } } -@Composable -fun PhoneVerifyInput( - modifier: Modifier = Modifier, - title: String, - inputContent: @Composable () -> Unit -) { +@Composable +fun InputContent( + inputType : InputType, + text : String, + onChangedText : (String) -> Unit, + onClick : () -> Unit +){ Column( - modifier = modifier.padding(horizontal = 24.dp) + modifier = Modifier + .fillMaxWidth() ) { - Spacer(modifier = Modifier.height(11.dp)) - LabelText( modifier = Modifier .height(18.dp), - text = title, + text = stringResource(inputType.titleRes), style = MaterialTheme.typography.labelSmall, color = GREY01 ) - inputContent() - - Spacer(modifier = Modifier.height(21.dp)) - } - -} + Spacer(modifier = Modifier.height(5.dp)) -@Composable -fun CarrierScreen( - modifier: Modifier = Modifier, - onClickCarrier: (CarrierType) -> Unit, - onClose: () -> Unit -) { - val list = CarrierType.entries - - Box( - modifier = modifier - ) { - Column( + Box( modifier = Modifier .fillMaxWidth() - .padding(horizontal = 24.dp) - .align(Alignment.TopCenter) - ) { - Spacer(modifier = Modifier.height(15.dp)) - LabelText( - modifier = Modifier - .height(64.dp) - .align(Alignment.Start), - text = stringResource(R.string.carrier_title), - style = MaterialTheme.typography.labelLarge, - color = Color.White - ) - Spacer(modifier = Modifier.height(13.dp)) - list.forEach { - LabelText( - modifier = Modifier - .fillMaxWidth() - .height(24.dp) - .align(Alignment.Start) - .clickable { onClickCarrier(it) }, - text = stringResource(it.stringRes), - style = MaterialTheme.typography.titleSmall, - color = GREY01 + .height(42.dp) + .background( + color = GREY07, + shape = RoundedCornerShape(12.dp) ) - - Spacer(modifier = Modifier.height(25.dp)) - } - } - - Image( - painter = painterResource(R.drawable.ic_close), - contentDescription = "close", - modifier = Modifier - .align(Alignment.TopEnd) - .padding(top = 16.dp) - .padding(end = 16.dp) - .clickable { onClose() } - ) - } -} - -@Composable -fun VerifyScreen( - modifier: Modifier = Modifier, - onClose: () -> Unit, - onComplete: () -> Unit -) { - var verifyNumber by remember { mutableStateOf("") } - - Box(modifier = modifier.fillMaxWidth().padding(horizontal = 20.dp)) { - Column(modifier = Modifier.fillMaxWidth()) { - Spacer(modifier = Modifier.height(25.dp)) - TitleText( - modifier = Modifier.height(64.dp), - title = stringResource(R.string.verify_title) + ){ + MKungTextField( + modifier = Modifier + .padding(start = 17.dp) + .fillMaxWidth() + .align(Alignment.CenterStart), + textStyle = MaterialTheme.typography.displayMedium, + visualTransformation = if(inputType == InputType.PHONE_VERIFY) PhoneNumberVisualTransformation() else VisualTransformation.None, + keyboardOptions = KeyboardOptions( + keyboardType = when(inputType){ + InputType.PHONE_VERIFY, InputType.VERIFY_NUMBER -> KeyboardType.Number + InputType.NICKNAME -> KeyboardType.Text + } + ), + text = text, + onChangedText = { + when(inputType){ + InputType.PHONE_VERIFY -> if(it.length <= 11) onChangedText(it.replace(".","").replace(",","")) + InputType.VERIFY_NUMBER -> if(it.length <= 6) onChangedText(it.replace(".","").replace(",","")) + InputType.NICKNAME -> onChangedText(it.replace(" ","")) + } + } ) - Spacer(modifier = Modifier.height(22.dp)) - CheckTextField( - keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Phone), - text = verifyNumber, - onChangeText = { - if (it.isNotEmpty() && it.toIntOrNull() == null) return@CheckTextField - if (it.length < 7) verifyNumber = it - if (it.length == 6) onComplete() - }, - label = stringResource(R.string.verify_number), - btnImageRes = R.drawable.ic_resend, - showTimer = true + LabelBtn( + modifier = Modifier + .align(Alignment.CenterEnd) + .padding(end = 14.dp) + .clickable { onClick() }, + text = stringResource(inputType.btnRes), + textColor = GREY01, + borderColor = GREY08, + horizontalPadding = 9.dp ) - - Spacer(modifier = Modifier.height(60.dp)) } - - Image( - painter = painterResource(R.drawable.ic_close), - contentDescription = "close", - modifier = Modifier - .align(Alignment.TopEnd) - .padding(top = 16.dp) - .clickable { onClose() } - ) } } -@Composable -fun Dot( - modifier: Modifier = Modifier -) { - Row(modifier = modifier) { - Canvas(modifier = Modifier.size(5.dp)) { - drawCircle(color = DOT, radius = 2.5.dp.toPx()) +private fun mbtiCheck( + selectedEnergyDirection: MbtiType?, + selectedRecognize: MbtiType?, + selectedJudgment: MbtiType?, + selectedPlanning: MbtiType?, +) : MbtiResult?{ + return if(selectedEnergyDirection != null && selectedRecognize != null && selectedJudgment != null && selectedPlanning != null){ + when{ + selectedEnergyDirection == MbtiType.E && selectedRecognize == MbtiType.S && selectedJudgment == MbtiType.T && selectedPlanning == MbtiType.J -> MbtiResult.ESTJ + selectedEnergyDirection == MbtiType.I && selectedRecognize == MbtiType.S && selectedJudgment == MbtiType.T && selectedPlanning == MbtiType.J -> MbtiResult.ISTJ + selectedEnergyDirection == MbtiType.E && selectedRecognize == MbtiType.S && selectedJudgment == MbtiType.F && selectedPlanning == MbtiType.J -> MbtiResult.ESFJ + selectedEnergyDirection == MbtiType.I && selectedRecognize == MbtiType.S && selectedJudgment == MbtiType.F && selectedPlanning == MbtiType.J -> MbtiResult.ISFJ + selectedEnergyDirection == MbtiType.E && selectedRecognize == MbtiType.S && selectedJudgment == MbtiType.T && selectedPlanning == MbtiType.P -> MbtiResult.ESTP + selectedEnergyDirection == MbtiType.I && selectedRecognize == MbtiType.S && selectedJudgment == MbtiType.T && selectedPlanning == MbtiType.P -> MbtiResult.ISTP + selectedEnergyDirection == MbtiType.E && selectedRecognize == MbtiType.S && selectedJudgment == MbtiType.F && selectedPlanning == MbtiType.P -> MbtiResult.ESFP + selectedEnergyDirection == MbtiType.I && selectedRecognize == MbtiType.S && selectedJudgment == MbtiType.F && selectedPlanning == MbtiType.P -> MbtiResult.ISFP + selectedEnergyDirection == MbtiType.E && selectedRecognize == MbtiType.N && selectedJudgment == MbtiType.T && selectedPlanning == MbtiType.J -> MbtiResult.ENTJ + selectedEnergyDirection == MbtiType.I && selectedRecognize == MbtiType.N && selectedJudgment == MbtiType.T && selectedPlanning == MbtiType.J -> MbtiResult.INTJ + selectedEnergyDirection == MbtiType.E && selectedRecognize == MbtiType.N && selectedJudgment == MbtiType.F && selectedPlanning == MbtiType.J -> MbtiResult.ENFJ + selectedEnergyDirection == MbtiType.I && selectedRecognize == MbtiType.N && selectedJudgment == MbtiType.F && selectedPlanning == MbtiType.J -> MbtiResult.INFJ + selectedEnergyDirection == MbtiType.E && selectedRecognize == MbtiType.N && selectedJudgment == MbtiType.T && selectedPlanning == MbtiType.P -> MbtiResult.ENTP + selectedEnergyDirection == MbtiType.I && selectedRecognize == MbtiType.N && selectedJudgment == MbtiType.T && selectedPlanning == MbtiType.P -> MbtiResult.INTP + selectedEnergyDirection == MbtiType.E && selectedRecognize == MbtiType.N && selectedJudgment == MbtiType.F && selectedPlanning == MbtiType.P -> MbtiResult.ENFP + else -> MbtiResult.INFP } - Spacer(modifier = Modifier.width(2.dp)) + }else{ + null } } \ No newline at end of file diff --git a/feature/join/src/main/java/com/appleroid/feature/join/model/InputType.kt b/feature/join/src/main/java/com/appleroid/feature/join/model/InputType.kt new file mode 100644 index 0000000..b21e195 --- /dev/null +++ b/feature/join/src/main/java/com/appleroid/feature/join/model/InputType.kt @@ -0,0 +1,11 @@ +package com.appleroid.feature.join.model + +import androidx.annotation.StringRes +import androidx.compose.ui.text.input.KeyboardType +import com.appleroid.feature.join.R + +enum class InputType(@StringRes val titleRes : Int,@StringRes val btnRes : Int) { + PHONE_VERIFY(R.string.phone_number, R.string.send), + VERIFY_NUMBER(R.string.verify_number, R.string.resend), + NICKNAME(R.string.nickname_label, R.string.duplicate_check) +} \ No newline at end of file diff --git a/feature/join/src/main/java/com/appleroid/feature/join/model/MbtiType.kt b/feature/join/src/main/java/com/appleroid/feature/join/model/MbtiType.kt index 9c4f731..ff7e61c 100644 --- a/feature/join/src/main/java/com/appleroid/feature/join/model/MbtiType.kt +++ b/feature/join/src/main/java/com/appleroid/feature/join/model/MbtiType.kt @@ -13,37 +13,38 @@ const val PLANNING = 3 enum class MbtiType( val key : String, val type : Int, - @StringRes val stringRes: Int, - @DrawableRes val drawableRes: Int + @StringRes val stringRes: Int ){ - I("I",ENERGY_DIRECTION,R.string.mbti_i, R.drawable.icon_i), - E("E",ENERGY_DIRECTION,R.string.mbti_e, R.drawable.icon_e), - S("S",RECOGNIZE,R.string.mbti_s, R.drawable.icon_s), - N("N",RECOGNIZE,R.string.mbti_n, R.drawable.icon_n), - T("T",JUDGMENT,R.string.mbti_t, R.drawable.icon_t), - F("F",JUDGMENT,R.string.mbti_f, R.drawable.icon_f), - P("P",PLANNING,R.string.mbti_p, R.drawable.icon_p), - J("J",PLANNING,R.string.mbti_j, R.drawable.icon_j) + I("I",ENERGY_DIRECTION,R.string.mbti_i), + E("E",ENERGY_DIRECTION,R.string.mbti_e), + S("S",RECOGNIZE,R.string.mbti_s), + N("N",RECOGNIZE,R.string.mbti_n), + T("T",JUDGMENT,R.string.mbti_t), + F("F",JUDGMENT,R.string.mbti_f), + P("P",PLANNING,R.string.mbti_p), + J("J",PLANNING,R.string.mbti_j) } -enum class MbtiImage( +enum class MbtiResult( val value : String, - @DrawableRes val drawableRes: Int + @DrawableRes val drawableRes: Int, + @StringRes val titleRes: Int, + @StringRes val descriptionRes: Int ){ - ENFJ("ENFJ",R.drawable.img_enfj), - ENFP("ENFP",R.drawable.img_enfp), - ENTJ("ENTJ",R.drawable.img_entj), - ENTP("ENTP",R.drawable.img_entp), - ESFJ("ESFJ",R.drawable.img_esfj), - ESFP("ESFP",R.drawable.img_esfp), - ESTJ("ESTJ",R.drawable.img_estj), - ESTP("ESTP",R.drawable.img_estp), - INFJ("INFJ",R.drawable.img_infj), - INFP("INFP",R.drawable.img_infp), - INTJ("INTJ",R.drawable.img_intj), - INTP("INTP",R.drawable.img_intp), - ISFJ("ISFJ",R.drawable.img_isfj), - ISFP("ISFP",R.drawable.img_isfp), - ISTJ("ISTJ",R.drawable.img_istj), - ISTP("ISTP",R.drawable.img_istp) + ENFJ("ENFJ",R.drawable.img_login_enfj, R.string.enfj_title, R.string.enfj_discription), + ENFP("ENFP",R.drawable.img_login_enfp, R.string.enfp_title, R.string.enfp_discription), + ENTJ("ENTJ",R.drawable.img_login_entj, R.string.entj_title, R.string.entj_discription), + ENTP("ENTP",R.drawable.img_login_entp, R.string.entp_title, R.string.entp_discription), + ESFJ("ESFJ",R.drawable.img_login_esfj, R.string.esfj_title, R.string.esfj_discription), + ESFP("ESFP",R.drawable.img_login_esfp, R.string.esfp_title, R.string.esfp_discription), + ESTJ("ESTJ",R.drawable.img_login_estj, R.string.estj_title, R.string.estj_discription), + ESTP("ESTP",R.drawable.img_login_estp, R.string.estp_title, R.string.estp_discription), + INFJ("INFJ",R.drawable.img_login_infj, R.string.infj_title, R.string.infj_discription), + INFP("INFP",R.drawable.img_login_infp, R.string.infp_title, R.string.infp_discription), + INTJ("INTJ",R.drawable.img_login_intj, R.string.intj_title, R.string.intj_discription), + INTP("INTP",R.drawable.img_login_intp, R.string.intp_title, R.string.intp_discription), + ISFJ("ISFJ",R.drawable.img_login_isfj, R.string.isfj_title, R.string.isfj_discription), + ISFP("ISFP",R.drawable.img_login_isfp, R.string.isfp_title, R.string.isfp_discription), + ISTJ("ISTJ",R.drawable.img_login_istj, R.string.istj_title, R.string.istj_discription), + ISTP("ISTP",R.drawable.img_login_istp, R.string.istp_title, R.string.istp_discription) } \ No newline at end of file diff --git a/feature/join/src/main/res/drawable/img_empty_mbti.png b/feature/join/src/main/res/drawable/img_empty_mbti.png new file mode 100644 index 0000000..b2bf611 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_empty_mbti.png differ diff --git a/feature/join/src/main/res/drawable/img_empty_mbti.xml b/feature/join/src/main/res/drawable/img_empty_mbti.xml deleted file mode 100644 index 984cbad..0000000 --- a/feature/join/src/main/res/drawable/img_empty_mbti.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_empty_text.xml b/feature/join/src/main/res/drawable/img_empty_text.xml new file mode 100644 index 0000000..b6fc602 --- /dev/null +++ b/feature/join/src/main/res/drawable/img_empty_text.xml @@ -0,0 +1,9 @@ + + + diff --git a/feature/join/src/main/res/drawable/img_enfj.xml b/feature/join/src/main/res/drawable/img_enfj.xml deleted file mode 100644 index 8dc4e46..0000000 --- a/feature/join/src/main/res/drawable/img_enfj.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_enfp.xml b/feature/join/src/main/res/drawable/img_enfp.xml deleted file mode 100644 index bda7053..0000000 --- a/feature/join/src/main/res/drawable/img_enfp.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_entj.xml b/feature/join/src/main/res/drawable/img_entj.xml deleted file mode 100644 index fc035c7..0000000 --- a/feature/join/src/main/res/drawable/img_entj.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_entp.xml b/feature/join/src/main/res/drawable/img_entp.xml deleted file mode 100644 index b28196c..0000000 --- a/feature/join/src/main/res/drawable/img_entp.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_esfj.xml b/feature/join/src/main/res/drawable/img_esfj.xml deleted file mode 100644 index 0cf10ce..0000000 --- a/feature/join/src/main/res/drawable/img_esfj.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_esfp.xml b/feature/join/src/main/res/drawable/img_esfp.xml deleted file mode 100644 index ba41172..0000000 --- a/feature/join/src/main/res/drawable/img_esfp.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_estj.xml b/feature/join/src/main/res/drawable/img_estj.xml deleted file mode 100644 index 22ac5b3..0000000 --- a/feature/join/src/main/res/drawable/img_estj.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_estp.xml b/feature/join/src/main/res/drawable/img_estp.xml deleted file mode 100644 index 72ea8b7..0000000 --- a/feature/join/src/main/res/drawable/img_estp.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_infj.xml b/feature/join/src/main/res/drawable/img_infj.xml deleted file mode 100644 index 081e1f6..0000000 --- a/feature/join/src/main/res/drawable/img_infj.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_infp.xml b/feature/join/src/main/res/drawable/img_infp.xml deleted file mode 100644 index ffe2590..0000000 --- a/feature/join/src/main/res/drawable/img_infp.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_intj.xml b/feature/join/src/main/res/drawable/img_intj.xml deleted file mode 100644 index 30673cc..0000000 --- a/feature/join/src/main/res/drawable/img_intj.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_intp.xml b/feature/join/src/main/res/drawable/img_intp.xml deleted file mode 100644 index 5b78d0b..0000000 --- a/feature/join/src/main/res/drawable/img_intp.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_isfj.xml b/feature/join/src/main/res/drawable/img_isfj.xml deleted file mode 100644 index dc939e1..0000000 --- a/feature/join/src/main/res/drawable/img_isfj.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_isfp.xml b/feature/join/src/main/res/drawable/img_isfp.xml deleted file mode 100644 index 5c53e8c..0000000 --- a/feature/join/src/main/res/drawable/img_isfp.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_istj.xml b/feature/join/src/main/res/drawable/img_istj.xml deleted file mode 100644 index 724f76c..0000000 --- a/feature/join/src/main/res/drawable/img_istj.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_istp.xml b/feature/join/src/main/res/drawable/img_istp.xml deleted file mode 100644 index 37ecd3c..0000000 --- a/feature/join/src/main/res/drawable/img_istp.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/feature/join/src/main/res/drawable/img_login_enfj.png b/feature/join/src/main/res/drawable/img_login_enfj.png new file mode 100644 index 0000000..0754eab Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_enfj.png differ diff --git a/feature/join/src/main/res/drawable/img_login_enfp.png b/feature/join/src/main/res/drawable/img_login_enfp.png new file mode 100644 index 0000000..bcd90b2 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_enfp.png differ diff --git a/feature/join/src/main/res/drawable/img_login_entj.png b/feature/join/src/main/res/drawable/img_login_entj.png new file mode 100644 index 0000000..c591f13 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_entj.png differ diff --git a/feature/join/src/main/res/drawable/img_login_entp.png b/feature/join/src/main/res/drawable/img_login_entp.png new file mode 100644 index 0000000..11809c2 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_entp.png differ diff --git a/feature/join/src/main/res/drawable/img_login_esfj.png b/feature/join/src/main/res/drawable/img_login_esfj.png new file mode 100644 index 0000000..67132cc Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_esfj.png differ diff --git a/feature/join/src/main/res/drawable/img_login_esfp.png b/feature/join/src/main/res/drawable/img_login_esfp.png new file mode 100644 index 0000000..1240e84 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_esfp.png differ diff --git a/feature/join/src/main/res/drawable/img_login_estj.png b/feature/join/src/main/res/drawable/img_login_estj.png new file mode 100644 index 0000000..c2522c2 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_estj.png differ diff --git a/feature/join/src/main/res/drawable/img_login_estp.png b/feature/join/src/main/res/drawable/img_login_estp.png new file mode 100644 index 0000000..123b797 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_estp.png differ diff --git a/feature/join/src/main/res/drawable/img_login_infj.png b/feature/join/src/main/res/drawable/img_login_infj.png new file mode 100644 index 0000000..f91005f Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_infj.png differ diff --git a/feature/join/src/main/res/drawable/img_login_infp.png b/feature/join/src/main/res/drawable/img_login_infp.png new file mode 100644 index 0000000..33ba7f6 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_infp.png differ diff --git a/feature/join/src/main/res/drawable/img_login_intj.png b/feature/join/src/main/res/drawable/img_login_intj.png new file mode 100644 index 0000000..e870b34 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_intj.png differ diff --git a/feature/join/src/main/res/drawable/img_login_intp.png b/feature/join/src/main/res/drawable/img_login_intp.png new file mode 100644 index 0000000..9d7db14 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_intp.png differ diff --git a/feature/join/src/main/res/drawable/img_login_isfj.png b/feature/join/src/main/res/drawable/img_login_isfj.png new file mode 100644 index 0000000..3936494 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_isfj.png differ diff --git a/feature/join/src/main/res/drawable/img_login_isfp.png b/feature/join/src/main/res/drawable/img_login_isfp.png new file mode 100644 index 0000000..5df4d7f Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_isfp.png differ diff --git a/feature/join/src/main/res/drawable/img_login_istj.png b/feature/join/src/main/res/drawable/img_login_istj.png new file mode 100644 index 0000000..4fc1778 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_istj.png differ diff --git a/feature/join/src/main/res/drawable/img_login_istp.png b/feature/join/src/main/res/drawable/img_login_istp.png new file mode 100644 index 0000000..6fc84c4 Binary files /dev/null and b/feature/join/src/main/res/drawable/img_login_istp.png differ diff --git a/feature/join/src/main/res/values/strings.xml b/feature/join/src/main/res/values/strings.xml index 88ce2fd..3c7c574 100644 --- a/feature/join/src/main/res/values/strings.xml +++ b/feature/join/src/main/res/values/strings.xml @@ -12,7 +12,7 @@ MBTI 이러쿵 저러쿵\n엠쿵에 오신 것을 환영합니다! 엠쿵을 시작하기 위해 전화번호 인증이 필요해요. - 휴대폰 번호 + 휴대폰번호 010–1234-5678 주민등록번호 - @@ -30,7 +30,9 @@ LG U+ 알뜰폰 문자로 받은\n인증번호 6자리를 입력해주세요 인증번호 + 전송 재전송 + 중복확인 인증번호 유효시간이 지났어요. 다시 전송해주세요! 인증번호가 일치하지 않습니다. 다시 확인해주세요! @@ -40,16 +42,50 @@ MBTI는 무엇인가요? MBTI를 설정해 프로필을 완성하세요! - 내향 - 외향 - 직관 - 감각 - 사고 - 감정 - 인식 - 판단 + I\n내향 + E\n외향 + N\n직관 + S\n감각 + T\n사고 + F\n감정 + P\n인식 + J\n판단 계속하기 인증하기 완료 + + 엠쿵님은\n효율적인 감독자 이시군요! + 엠쿵님은\n부지런한 관리인 이시군요! + 엠쿵님은\n친절한 도우미 이시군요! + 엠쿵님은\n헌신적 상담자 이시군요! + 엠쿵님은\n활기찬 혁신가 이시군요! + 엠쿵님은\n호기심 황성한 독불장군 이시군요! + 엠쿵님은\n트렌디한 사교가 이시군요! + 엠쿵님은\n상냥한 아티스트 이시군요! + 엠쿵님은\n야심찬 리더 이시군요! + 엠쿵님은\n독립적인 전략가 이시군요! + 엠쿵님은\n수다스러운 발명가 이시군요! + 엠쿵님은\n상상력이 풍부한 과학자 이시군요! + 엠쿵님은\n열정적인 패실리테이터 이시군요! + 엠쿵님은\n이상주의적인 힐러 이시군요! + 엠쿵님은\n활기찬 탐험가 이시군요! + 엠쿵님은\n사려깊은 몽상가 이시군요! + + 사물과 사람을 관리하는 데 뛰어난 능력을 지닌 경영자입니다. + 사실을 중시하는 믿음직한 현실주의자입니다. + 배려심이 넘치고 항상 다른 사람을 도울 준비가 되어 있는 성격으로, 인기가 많고 사교성 높은 마당발입니다. + 주변 사람을 보호할 준비가 되어 있는 헌신적이고 따뜻한 수호자입니다. + 위험을 기꺼이 감수하는 성격으로, 영리하고 에너지 넘치며 관찰력이 뛰어난 사업가입니다. + 대담하면서도 현실적인 성격으로, 모든 종류의 도구를 자유자재로 다루는 장인입니다. + 즉흥적이고 넘치는 에너지와 열정으로 주변 사람을 즐겁게 하는 연예인입니다. + 항상 새로운 경험을 추구하는 유연하고 매력 넘치는 예술가입니다. + 항상 문제 해결 방법을 찾아내는 성격으로, 대담하고 상상력이 풍부하며 의지가 강력한 지도자 입니다. + 모든 일에 대해 계획을 세우며 상상력이 풍부한 전략가입니다. + 지적 도전을 즐기는 영리하고 호기심이 많은 사색가입니다. + 지식을 끝없이 갈망하는 혁신적인 발명가입니다. + 청중을 사로잡고 의욕을 불어넣는 카리스마 넘치는 지도자입니다. + 차분하고 신비한 분위기를 풍기는 성격으로, 다른 사람에게 의욕을 불어넣는 의상주의자입니다. + 열정적이고 창의적인 성격으로, 긍정적으로 삶을 바라보는 사교적이면서도 자유로운 영혼입니다. + 항상 선을 행할 준비가 되어 있는 부드럽고 친절한 이타주의자입니다. \ No newline at end of file