From a1b05e53041a3c79e603537c3d2f19563e4a360a Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 5 Apr 2024 00:52:27 +0900 Subject: [PATCH 01/10] =?UTF-8?q?feat=20:=20SuffixTextField=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/compose/atom/SuffixTextField.kt | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt diff --git a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt new file mode 100644 index 00000000..6cb5b697 --- /dev/null +++ b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt @@ -0,0 +1,120 @@ +package com.yourssu.design.system.compose.atom + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.material.OutlinedTextField +import androidx.compose.material.TextFieldDefaults +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.yourssu.design.system.compose.YdsTheme +import com.yourssu.design.system.compose.base.YdsText + +@Composable +fun SuffixTextField( + text: String = "", + modifier: Modifier = Modifier, + isError: Boolean = false, + isEnabled: Boolean = true, + placeHolder: String = "", + suffixLabel: String = "", + onValueChange: (value: String) -> Unit, + keyboardOptions: KeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), + hintText: String = "", + onErrorChange: (Boolean) -> Unit = {}, +) { + Column(modifier = modifier) { + OutlinedTextField( + value = text, + onValueChange = onValueChange, + modifier = Modifier.fillMaxWidth(), + shape = RoundedCornerShape(8.dp), + colors = TextFieldDefaults.outlinedTextFieldColors( + backgroundColor = YdsTheme.colors.inputFieldElevated, + cursorColor = YdsTheme.colors.textPointed, + errorBorderColor = YdsTheme.colors.textWarned, + unfocusedBorderColor = Color.Transparent, + focusedBorderColor = YdsTheme.colors.textPointed, + disabledTextColor = YdsTheme.colors.textDisabled, + disabledBorderColor = Color.Transparent, + textColor = YdsTheme.colors.textSecondary, + ), + isError = isError, + enabled = isEnabled, + placeholder = { + YdsText( + text = placeHolder, + style = YdsTheme.typography.body1, + color = YdsTheme.colors.textTertiary, + ) + }, + trailingIcon = { + YdsText( + text = suffixLabel, + style = YdsTheme.typography.body1, + color = YdsTheme.colors.textTertiary, + ) + }, + textStyle = YdsTheme.typography.body1.toTextStyle(), + keyboardOptions = keyboardOptions, + singleLine = true, + ) + if (hintText.isNotEmpty()) { + Row(modifier = Modifier.padding(top = 8.dp)) { + Spacer( + modifier = Modifier + .width(16.dp), + ) + YdsText( + text = hintText, + style = YdsTheme.typography.caption1, + color = if (isError) { + YdsTheme.colors.textWarned + } else if (!isEnabled) { + YdsTheme.colors.textDisabled + } else { + YdsTheme.colors.textTertiary + }, + ) + + } + } + } +} + +@Preview +@Composable +private fun PreviewSuffixTextField() { + var isError by remember { mutableStateOf(false) } + var text by rememberSaveable { mutableStateOf("") } + Column { + SuffixTextField( + text = text, + isError = isError, isEnabled = true, + placeHolder = "플레이스 홀더", + onValueChange = { value -> + text = value + }, + hintText = "힌트 텍스트", + modifier = Modifier.padding(10.dp), + onErrorChange = { error -> + isError = error + }, + suffixLabel = "하이", + ) + } +} \ No newline at end of file From d059950d4f6bf2291fc1ce95d6897a0f753b91a0 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 9 Apr 2024 02:14:31 +0900 Subject: [PATCH 02/10] =?UTF-8?q?chore=20:=20SuffixTextField=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 --- .../design/system/compose/atom/SuffixTextField.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt index 6cb5b697..17ec1544 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt @@ -32,10 +32,9 @@ fun SuffixTextField( isEnabled: Boolean = true, placeHolder: String = "", suffixLabel: String = "", + hintText: String = "", onValueChange: (value: String) -> Unit, keyboardOptions: KeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), - hintText: String = "", - onErrorChange: (Boolean) -> Unit = {}, ) { Column(modifier = modifier) { OutlinedTextField( @@ -64,6 +63,7 @@ fun SuffixTextField( }, trailingIcon = { YdsText( + modifier = Modifier.padding(16.dp), text = suffixLabel, style = YdsTheme.typography.body1, color = YdsTheme.colors.textTertiary, @@ -111,10 +111,7 @@ private fun PreviewSuffixTextField() { }, hintText = "힌트 텍스트", modifier = Modifier.padding(10.dp), - onErrorChange = { error -> - isError = error - }, - suffixLabel = "하이", + suffixLabel = "@soongsil.ac.kr", ) } } \ No newline at end of file From 1fdb7033f27916430637844c25b9afdb1bebf78b Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 9 Apr 2024 02:39:26 +0900 Subject: [PATCH 03/10] =?UTF-8?q?chore=20:=20Preview=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/compose/atom/SuffixTextField.kt | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt index 17ec1544..02fdebb2 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt @@ -100,18 +100,42 @@ fun SuffixTextField( @Composable private fun PreviewSuffixTextField() { var isError by remember { mutableStateOf(false) } - var text by rememberSaveable { mutableStateOf("") } + var text1 by rememberSaveable { mutableStateOf("") } + var text2 by rememberSaveable { mutableStateOf("") } + var text3 by rememberSaveable { mutableStateOf("") } + Column { SuffixTextField( - text = text, + text = text1, isError = isError, isEnabled = true, placeHolder = "플레이스 홀더", onValueChange = { value -> - text = value + text1 = value }, hintText = "힌트 텍스트", modifier = Modifier.padding(10.dp), suffixLabel = "@soongsil.ac.kr", ) + + SuffixTextField( + text = text2, + isEnabled = false, + onValueChange = { value -> + text2 = value + }, + hintText = "힌트 텍스트", + modifier = Modifier.padding(bottom = 10.dp), + suffixLabel = "@soongsil.ac.kr", + ) + + SuffixTextField( + text = text3, + isError = true, + hintText = "힌트 텍스트", + suffixLabel = "@soongsil.ac.kr", + onValueChange = { value -> + text3 = value + }, + ) } } \ No newline at end of file From b270a38fd32f778ec6b9be9780eba8b0cbec73f4 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 9 Apr 2024 02:48:36 +0900 Subject: [PATCH 04/10] chore : versionName 2.5.10 -> 2.5.11 --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 42988410..a9fdd465 100644 --- a/version.properties +++ b/version.properties @@ -1,2 +1,2 @@ -versionName=2.5.10 +versionName=2.5.11 #자동 배포를 위해서 버전은 여기 한 군데에서 관리하면 된다 From 86aea11979ed90b2c3859f9c7e93059a2143c351 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 9 Apr 2024 19:14:49 +0900 Subject: [PATCH 05/10] =?UTF-8?q?fix=20:=20text,=20suffixLabel=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=EA=B0=92=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yourssu/design/system/compose/atom/SuffixTextField.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt index 02fdebb2..afc0289f 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt @@ -26,12 +26,12 @@ import com.yourssu.design.system.compose.base.YdsText @Composable fun SuffixTextField( - text: String = "", + text: String, modifier: Modifier = Modifier, isError: Boolean = false, isEnabled: Boolean = true, placeHolder: String = "", - suffixLabel: String = "", + suffixLabel: String, hintText: String = "", onValueChange: (value: String) -> Unit, keyboardOptions: KeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), From 06177d1e719c9b3409b19f67f3ef9a4bb2b86998 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 9 Apr 2024 19:16:17 +0900 Subject: [PATCH 06/10] =?UTF-8?q?fix=20:=20versionName=202.6.0=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index a9fdd465..fc152168 100644 --- a/version.properties +++ b/version.properties @@ -1,2 +1,2 @@ -versionName=2.5.11 +versionName=2.6.0 #자동 배포를 위해서 버전은 여기 한 군데에서 관리하면 된다 From f01dbc1647718bbf400b4ff8e4e03f5f69e6a1a9 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 9 Apr 2024 19:20:34 +0900 Subject: [PATCH 07/10] =?UTF-8?q?fix=20:=20isDisabled=20=EB=84=A4=EC=9D=B4?= =?UTF-8?q?=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/system/compose/atom/SuffixTextField.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt index afc0289f..551d6c01 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt @@ -29,7 +29,7 @@ fun SuffixTextField( text: String, modifier: Modifier = Modifier, isError: Boolean = false, - isEnabled: Boolean = true, + isDisabled: Boolean = true, placeHolder: String = "", suffixLabel: String, hintText: String = "", @@ -53,7 +53,7 @@ fun SuffixTextField( textColor = YdsTheme.colors.textSecondary, ), isError = isError, - enabled = isEnabled, + enabled = isDisabled, placeholder = { YdsText( text = placeHolder, @@ -84,7 +84,7 @@ fun SuffixTextField( style = YdsTheme.typography.caption1, color = if (isError) { YdsTheme.colors.textWarned - } else if (!isEnabled) { + } else if (!isDisabled) { YdsTheme.colors.textDisabled } else { YdsTheme.colors.textTertiary @@ -107,7 +107,7 @@ private fun PreviewSuffixTextField() { Column { SuffixTextField( text = text1, - isError = isError, isEnabled = true, + isError = isError, isDisabled = true, placeHolder = "플레이스 홀더", onValueChange = { value -> text1 = value @@ -119,7 +119,7 @@ private fun PreviewSuffixTextField() { SuffixTextField( text = text2, - isEnabled = false, + isDisabled = false, onValueChange = { value -> text2 = value }, From 396a063b0702fb279a20d1cdbb9974aa4a54e4b4 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 10 Apr 2024 13:29:00 +0900 Subject: [PATCH 08/10] =?UTF-8?q?fix=20:=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/system/compose/atom/SuffixTextField.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt index 551d6c01..e7bb0546 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt @@ -27,11 +27,11 @@ import com.yourssu.design.system.compose.base.YdsText @Composable fun SuffixTextField( text: String, + suffixLabel: String, modifier: Modifier = Modifier, isError: Boolean = false, - isDisabled: Boolean = true, + isDisabled: Boolean = false, placeHolder: String = "", - suffixLabel: String, hintText: String = "", onValueChange: (value: String) -> Unit, keyboardOptions: KeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text), @@ -53,7 +53,7 @@ fun SuffixTextField( textColor = YdsTheme.colors.textSecondary, ), isError = isError, - enabled = isDisabled, + enabled = !isDisabled, placeholder = { YdsText( text = placeHolder, @@ -107,7 +107,7 @@ private fun PreviewSuffixTextField() { Column { SuffixTextField( text = text1, - isError = isError, isDisabled = true, + isError = isError, isDisabled = false, placeHolder = "플레이스 홀더", onValueChange = { value -> text1 = value @@ -119,7 +119,7 @@ private fun PreviewSuffixTextField() { SuffixTextField( text = text2, - isDisabled = false, + isDisabled = true, onValueChange = { value -> text2 = value }, From a162d4a4c732ee93b7d54a87b5d2b33ad225fd6a Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 10 Apr 2024 14:56:16 +0900 Subject: [PATCH 09/10] =?UTF-8?q?fix=20:=20hintText=208dp=EB=A1=9C=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 --- .../com/yourssu/design/system/compose/atom/SuffixTextField.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt index e7bb0546..98799947 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/atom/SuffixTextField.kt @@ -77,7 +77,7 @@ fun SuffixTextField( Row(modifier = Modifier.padding(top = 8.dp)) { Spacer( modifier = Modifier - .width(16.dp), + .width(8.dp), ) YdsText( text = hintText, From 640432e09fe1587586d544e28108f7dfdb146346 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 10 Apr 2024 15:06:01 +0900 Subject: [PATCH 10/10] =?UTF-8?q?fix=20:=20TextField=EC=9D=98=20hintText?= =?UTF-8?q?=208dp=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yourssu/design/system/compose/atom/PasswordTextField.kt | 2 +- .../com/yourssu/design/system/compose/atom/SimpleTextField.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compose/src/main/java/com/yourssu/design/system/compose/atom/PasswordTextField.kt b/compose/src/main/java/com/yourssu/design/system/compose/atom/PasswordTextField.kt index e9b8d59a..b7c001f0 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/atom/PasswordTextField.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/atom/PasswordTextField.kt @@ -106,7 +106,7 @@ fun PasswordTextField( Row(modifier = Modifier.padding(top = 8.dp)) { Spacer( modifier = Modifier - .width(16.dp), + .width(8.dp), ) YdsText( text = hintText, diff --git a/compose/src/main/java/com/yourssu/design/system/compose/atom/SimpleTextField.kt b/compose/src/main/java/com/yourssu/design/system/compose/atom/SimpleTextField.kt index 037dc3dd..a62a15db 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/atom/SimpleTextField.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/atom/SimpleTextField.kt @@ -88,7 +88,7 @@ fun SimpleTextField( Row(modifier = Modifier.padding(top = 8.dp)) { Spacer( modifier = Modifier - .width(16.dp), + .width(8.dp), ) YdsText( text = hintText,