From 4b64d63d70b57d7d7e1fc9c5ad13c839923db7b9 Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sat, 29 Jun 2024 15:27:10 +0900 Subject: [PATCH 01/15] =?UTF-8?q?[#28=20feature]=20save=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/save/.gitignore | 1 + feature/save/build.gradle.kts | 78 +++++++++++++++++++ feature/save/consumer-rules.pro | 0 feature/save/proguard-rules.pro | 21 +++++ .../feature/save/ExampleInstrumentedTest.kt | 22 ++++++ feature/save/src/main/AndroidManifest.xml | 4 + .../dorabangs/feature/save/ExampleUnitTest.kt | 16 ++++ save/.gitignore | 1 + save/build.gradle.kts | 43 ++++++++++ save/consumer-rules.pro | 0 save/proguard-rules.pro | 21 +++++ .../feature/save/ExampleInstrumentedTest.kt | 24 ++++++ save/src/main/AndroidManifest.xml | 4 + .../dorabangs/feature/save/ExampleUnitTest.kt | 17 ++++ settings.gradle.kts | 1 + 15 files changed, 253 insertions(+) create mode 100644 feature/save/.gitignore create mode 100644 feature/save/build.gradle.kts create mode 100644 feature/save/consumer-rules.pro create mode 100644 feature/save/proguard-rules.pro create mode 100644 feature/save/src/androidTest/java/com/dorabangs/feature/save/ExampleInstrumentedTest.kt create mode 100644 feature/save/src/main/AndroidManifest.xml create mode 100644 feature/save/src/test/java/com/dorabangs/feature/save/ExampleUnitTest.kt create mode 100644 save/.gitignore create mode 100644 save/build.gradle.kts create mode 100644 save/consumer-rules.pro create mode 100644 save/proguard-rules.pro create mode 100644 save/src/androidTest/java/com/mashup/dorabangs/feature/save/ExampleInstrumentedTest.kt create mode 100644 save/src/main/AndroidManifest.xml create mode 100644 save/src/test/java/com/mashup/dorabangs/feature/save/ExampleUnitTest.kt diff --git a/feature/save/.gitignore b/feature/save/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/feature/save/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/feature/save/build.gradle.kts b/feature/save/build.gradle.kts new file mode 100644 index 00000000..cd08517c --- /dev/null +++ b/feature/save/build.gradle.kts @@ -0,0 +1,78 @@ +@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed +plugins { + alias(libs.plugins.com.android.library) + alias(libs.plugins.org.jetbrains.kotlin.android) + alias(libs.plugins.hilt) + alias(libs.plugins.kotlin.kapt) +} + +android { + namespace = "com.dorabangs.feature.save" + compileSdk = 34 + + defaultConfig { + minSdk = 24 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) + } + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = "1.4.3" + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_18 + targetCompatibility = JavaVersion.VERSION_18 + } + kotlinOptions { + jvmTarget = "18" + } +} + +dependencies { + implementation(project(":domain")) + implementation(project(":core:coroutine")) + implementation(project(":core:designsystem")) + implementation(project(":core:navigation")) + + // Compose + implementation(libs.ui) + implementation(libs.ui.graphics) + implementation(libs.ui.tooling.preview) + implementation(libs.material3) + implementation(platform(libs.compose.bom)) + implementation(libs.material) + implementation(libs.lifecycle.compose.ktx) + + // Test + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.espresso.core) + androidTestImplementation(platform(libs.compose.bom)) + androidTestImplementation(libs.ui.test.junit4) + debugImplementation(libs.ui.tooling) + debugImplementation(libs.ui.test.manifest) + testImplementation(libs.junit) + + // Hilt + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) + implementation(libs.hilt.navigation.compose) + + // Orbit + implementation(libs.orbit.core) + implementation(libs.orbit.viewmodel) + implementation(libs.orbit.compose) +} diff --git a/feature/save/consumer-rules.pro b/feature/save/consumer-rules.pro new file mode 100644 index 00000000..e69de29b diff --git a/feature/save/proguard-rules.pro b/feature/save/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/feature/save/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/feature/save/src/androidTest/java/com/dorabangs/feature/save/ExampleInstrumentedTest.kt b/feature/save/src/androidTest/java/com/dorabangs/feature/save/ExampleInstrumentedTest.kt new file mode 100644 index 00000000..045506bd --- /dev/null +++ b/feature/save/src/androidTest/java/com/dorabangs/feature/save/ExampleInstrumentedTest.kt @@ -0,0 +1,22 @@ +package com.dorabangs.feature.save + +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import junit.framework.TestCase.assertEquals +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.dorabangs.feature.save.test", appContext.packageName) + } +} diff --git a/feature/save/src/main/AndroidManifest.xml b/feature/save/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a5918e68 --- /dev/null +++ b/feature/save/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/feature/save/src/test/java/com/dorabangs/feature/save/ExampleUnitTest.kt b/feature/save/src/test/java/com/dorabangs/feature/save/ExampleUnitTest.kt new file mode 100644 index 00000000..e9092e9e --- /dev/null +++ b/feature/save/src/test/java/com/dorabangs/feature/save/ExampleUnitTest.kt @@ -0,0 +1,16 @@ +package com.dorabangs.feature.save + +import junit.framework.TestCase.assertEquals +import org.junit.Test + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} diff --git a/save/.gitignore b/save/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/save/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/save/build.gradle.kts b/save/build.gradle.kts new file mode 100644 index 00000000..61127e9f --- /dev/null +++ b/save/build.gradle.kts @@ -0,0 +1,43 @@ +plugins { + alias(libs.plugins.com.android.library) + alias(libs.plugins.org.jetbrains.kotlin.android) +} + +android { + namespace = "com.mashup.dorabangs.feature.save" + compileSdk = 34 + + defaultConfig { + minSdk = 24 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + + implementation(libs.core.ktx) + implementation(libs.appcompat) + implementation(libs.material) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.espresso.core) +} \ No newline at end of file diff --git a/save/consumer-rules.pro b/save/consumer-rules.pro new file mode 100644 index 00000000..e69de29b diff --git a/save/proguard-rules.pro b/save/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/save/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/save/src/androidTest/java/com/mashup/dorabangs/feature/save/ExampleInstrumentedTest.kt b/save/src/androidTest/java/com/mashup/dorabangs/feature/save/ExampleInstrumentedTest.kt new file mode 100644 index 00000000..51614f40 --- /dev/null +++ b/save/src/androidTest/java/com/mashup/dorabangs/feature/save/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.mashup.dorabangs.feature.save + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.mashup.dorabangs.feature.save.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/save/src/main/AndroidManifest.xml b/save/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a5918e68 --- /dev/null +++ b/save/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/save/src/test/java/com/mashup/dorabangs/feature/save/ExampleUnitTest.kt b/save/src/test/java/com/mashup/dorabangs/feature/save/ExampleUnitTest.kt new file mode 100644 index 00000000..492db8ae --- /dev/null +++ b/save/src/test/java/com/mashup/dorabangs/feature/save/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.mashup.dorabangs.feature.save + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index c1374270..dfc08aa5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -23,3 +23,4 @@ include(":feature:home") include(":core:coroutine") include(":core:designsystem") include(":core:navigation") +include(":feature:save") From c1aa3772ea7b8da79d161d3f578c1a16c04aa76d Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sat, 29 Jun 2024 20:38:34 +0900 Subject: [PATCH 02/15] =?UTF-8?q?[#28=20feature]=20=ED=85=8D=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=95=84=EB=93=9C=20=EB=A7=8C=EB=93=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/textfield/DoraTextField.kt | 128 ++++++++++++++++++ .../core/designsystem/theme/Colors.kt | 5 + .../src/main/res/values/strings.xml | 1 + 3 files changed, 134 insertions(+) create mode 100644 core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt new file mode 100644 index 00000000..dcbbccb2 --- /dev/null +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt @@ -0,0 +1,128 @@ +package com.mashup.dorabangs.core.designsystem.component.textfield + +import androidx.compose.foundation.background +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.Spacer +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.Text +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.res.stringResource +import androidx.compose.ui.text.TextRange +import androidx.compose.ui.text.input.TextFieldValue +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.mashup.dorabangs.core.designsystem.R +import com.mashup.dorabangs.core.designsystem.component.snackbar.doraiconclose.CloseCircle +import com.mashup.dorabangs.core.designsystem.component.snackbar.doraiconclose.DoraIconClose +import com.mashup.dorabangs.core.designsystem.theme.ClipBoardColorTokens +import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens +import com.mashup.dorabangs.core.designsystem.theme.TextFieldColorTokens + +@Composable +fun DoraTextField( + modifier: Modifier = Modifier, + text: String = "", + hintText: String = "", +) { + var textFieldValue by remember { + mutableStateOf( + TextFieldValue( + text = text, + selection = TextRange(text.length), + ), + ) + } + + Column( + modifier = modifier + .size(width = 350.dp, height = 48.dp) + .background(TextFieldColorTokens.TextFieldBackGroundColor), + ) { + BasicTextField( + modifier = Modifier + .fillMaxHeight() + .padding(horizontal = 12.dp, vertical = 13.dp), + value = textFieldValue, + singleLine = true, + textStyle = DoraTypoTokens.caption1Medium, + onValueChange = { + textFieldValue = it + }, + decorationBox = { innerTextField -> + Box( + modifier = Modifier.width(326.dp), + contentAlignment = Alignment.CenterStart, + ) { + if (textFieldValue.text.isBlank()) { + Text( + modifier = Modifier.fillMaxWidth(), + text = hintText, + maxLines = 1, + color = TextFieldColorTokens.TextFieldHintTextColor, + style = DoraTypoTokens.caption1Medium, + textAlign = TextAlign.Start, + ) + } else { + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween, // 양끝 배치 + ) { + Box( + modifier = Modifier.weight(1f), // innerTextField가 가로로 확장되지 않도록 설정 + ) { + innerTextField() + } + Spacer(modifier = Modifier.width(width = 4.dp)) + IconButton( + modifier = Modifier.size(size = 24.dp), + onClick = { textFieldValue = TextFieldValue("") }, + ) { + Icon( + imageVector = DoraIconClose.CloseCircle, + contentDescription = stringResource(id = R.string.url_text_clear), + tint = ClipBoardColorTokens.UrlLinkSubColor1, + ) + } + } + } + } + }, + ) + } +} + +@Composable +@Preview +fun DoraTextFieldPreview() { + DoraTextField( + text = "테스트용 이다 어쩔래 ? ? ? asogihasio gasiofhgaioshgioashgaosighoasihg", + hintText = "URL을 입력해주세요.", + ) +} + +@Composable +@Preview +fun DoraTextFieldPreviewWithHint() { + DoraTextField( + text = "", + hintText = "URL을 입력해주세요.", + ) +} diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt index ee33d1e7..01058da0 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt @@ -40,6 +40,11 @@ object ClipBoardColorTokens { val ArrowColor = DoraColorTokens.G3 } +object TextFieldColorTokens { + val TextFieldBackGroundColor = DoraColorTokens.G1 + val TextFieldHintTextColor = DoraColorTokens.G4 +} + object TopBarColorTokens { val isDarkMode = false // 임시 다크모드 체크 val ContainerColor diff --git a/core/designsystem/src/main/res/values/strings.xml b/core/designsystem/src/main/res/values/strings.xml index 4b37ce2c..6e6bf29a 100644 --- a/core/designsystem/src/main/res/values/strings.xml +++ b/core/designsystem/src/main/res/values/strings.xml @@ -4,4 +4,5 @@ 보관함 클립보드에 복사한 링크 저장 스낵바 취소 + url 모두 지우기 \ No newline at end of file From ae84283d191c4c91c5d38257001817fdb04f7abb Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sat, 29 Jun 2024 20:52:13 +0900 Subject: [PATCH 03/15] =?UTF-8?q?[#28=20feature]=20=EB=9D=BC=EB=B2=A8=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 --- .../component/textfield/DoraLabel.kt | 20 +++ .../component/textfield/DoraTextField.kt | 118 ++++++++++-------- .../core/designsystem/theme/Colors.kt | 5 + .../{DorabansTheme.kt => DorabangsTheme.kt} | 0 4 files changed, 91 insertions(+), 52 deletions(-) create mode 100644 core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt rename core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/{DorabansTheme.kt => DorabangsTheme.kt} (100%) diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt new file mode 100644 index 00000000..a1ea2bb1 --- /dev/null +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt @@ -0,0 +1,20 @@ +package com.mashup.dorabangs.core.designsystem.component.textfield + +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens +import com.mashup.dorabangs.core.designsystem.theme.LabelColorTokens + +@Composable +fun DoraLabel( + labelText: String, + modifier: Modifier = Modifier, +) { + Text( + modifier = modifier, + text = labelText, + style = DoraTypoTokens.caption1Medium, + color = LabelColorTokens.LabelColor, + ) +} \ No newline at end of file diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt index dcbbccb2..4378d720 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight 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.layout.width @@ -22,6 +23,7 @@ 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.res.stringResource import androidx.compose.ui.text.TextRange import androidx.compose.ui.text.input.TextFieldValue @@ -31,15 +33,16 @@ import androidx.compose.ui.unit.dp import com.mashup.dorabangs.core.designsystem.R import com.mashup.dorabangs.core.designsystem.component.snackbar.doraiconclose.CloseCircle import com.mashup.dorabangs.core.designsystem.component.snackbar.doraiconclose.DoraIconClose -import com.mashup.dorabangs.core.designsystem.theme.ClipBoardColorTokens +import com.mashup.dorabangs.core.designsystem.theme.DoraRoundTokens import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens import com.mashup.dorabangs.core.designsystem.theme.TextFieldColorTokens @Composable fun DoraTextField( + text: String, + hintText: String, + labelText: String, modifier: Modifier = Modifier, - text: String = "", - hintText: String = "", ) { var textFieldValue by remember { mutableStateOf( @@ -51,62 +54,71 @@ fun DoraTextField( } Column( - modifier = modifier - .size(width = 350.dp, height = 48.dp) - .background(TextFieldColorTokens.TextFieldBackGroundColor), + modifier = modifier.padding(horizontal = 20.dp) ) { - BasicTextField( + DoraLabel(labelText = labelText) + Spacer(modifier = Modifier.height(height = 8.dp)) + Column( modifier = Modifier - .fillMaxHeight() - .padding(horizontal = 12.dp, vertical = 13.dp), - value = textFieldValue, - singleLine = true, - textStyle = DoraTypoTokens.caption1Medium, - onValueChange = { - textFieldValue = it - }, - decorationBox = { innerTextField -> - Box( - modifier = Modifier.width(326.dp), - contentAlignment = Alignment.CenterStart, - ) { - if (textFieldValue.text.isBlank()) { - Text( - modifier = Modifier.fillMaxWidth(), - text = hintText, - maxLines = 1, - color = TextFieldColorTokens.TextFieldHintTextColor, - style = DoraTypoTokens.caption1Medium, - textAlign = TextAlign.Start, - ) - } else { - Row( - modifier = Modifier.fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.SpaceBetween, // 양끝 배치 - ) { - Box( - modifier = Modifier.weight(1f), // innerTextField가 가로로 확장되지 않도록 설정 + .size(width = 350.dp, height = 48.dp) + .clip(DoraRoundTokens.Round8) + .background(TextFieldColorTokens.TextFieldBackGroundColor), + ) { + BasicTextField( + modifier = Modifier + .fillMaxHeight() + .padding(horizontal = 12.dp, vertical = 13.dp), + value = textFieldValue, + singleLine = true, + textStyle = DoraTypoTokens.caption1Medium, + onValueChange = { + textFieldValue = it + }, + decorationBox = { innerTextField -> + Box( + modifier = Modifier.width(326.dp), + contentAlignment = Alignment.CenterStart, + ) { + if (textFieldValue.text.isBlank()) { + Text( + modifier = Modifier.fillMaxWidth(), + text = hintText, + maxLines = 1, + color = TextFieldColorTokens.TextFieldHintTextColor, + style = DoraTypoTokens.caption1Medium, + textAlign = TextAlign.Start, + ) + } else { + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween, // 양끝 배치 ) { - innerTextField() - } - Spacer(modifier = Modifier.width(width = 4.dp)) - IconButton( - modifier = Modifier.size(size = 24.dp), - onClick = { textFieldValue = TextFieldValue("") }, - ) { - Icon( - imageVector = DoraIconClose.CloseCircle, - contentDescription = stringResource(id = R.string.url_text_clear), - tint = ClipBoardColorTokens.UrlLinkSubColor1, - ) + Box( + modifier = Modifier.weight(1f), // innerTextField가 가로로 확장되지 않도록 설정 + ) { + innerTextField() + } + Spacer(modifier = Modifier.width(width = 4.dp)) + IconButton( + modifier = Modifier.size(size = 24.dp), + onClick = { textFieldValue = TextFieldValue("") }, + ) { + Icon( + imageVector = DoraIconClose.CloseCircle, + contentDescription = stringResource(id = R.string.url_text_clear), + tint = TextFieldColorTokens.TextFieldClearButtonColor, + ) + } } } } - } - }, - ) + }, + ) + } } + + } @Composable @@ -115,6 +127,7 @@ fun DoraTextFieldPreview() { DoraTextField( text = "테스트용 이다 어쩔래 ? ? ? asogihasio gasiofhgaioshgioashgaosighoasihg", hintText = "URL을 입력해주세요.", + labelText = "바보", ) } @@ -124,5 +137,6 @@ fun DoraTextFieldPreviewWithHint() { DoraTextField( text = "", hintText = "URL을 입력해주세요.", + labelText = "링크", ) } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt index 01058da0..1ca186ee 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt @@ -43,6 +43,11 @@ object ClipBoardColorTokens { object TextFieldColorTokens { val TextFieldBackGroundColor = DoraColorTokens.G1 val TextFieldHintTextColor = DoraColorTokens.G4 + val TextFieldClearButtonColor = DoraColorTokens.G4 +} + +object LabelColorTokens { + val LabelColor = DoraColorTokens.G9 } object TopBarColorTokens { diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/DorabansTheme.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/DorabangsTheme.kt similarity index 100% rename from core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/DorabansTheme.kt rename to core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/DorabangsTheme.kt From 41a3b8502d1d97f921ca3cc5613e7525697bf440 Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sat, 29 Jun 2024 20:57:39 +0900 Subject: [PATCH 04/15] =?UTF-8?q?[#28=20feature]=20=EC=97=90=EB=9F=AC=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 --- .../component/textfield/DoraErrorLabel.kt | 20 +++++++++++++++++++ .../component/textfield/DoraLabel.kt | 2 +- .../component/textfield/DoraTextField.kt | 10 +++++++--- .../core/designsystem/theme/Colors.kt | 4 ++++ 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraErrorLabel.kt diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraErrorLabel.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraErrorLabel.kt new file mode 100644 index 00000000..f87ac7eb --- /dev/null +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraErrorLabel.kt @@ -0,0 +1,20 @@ +package com.mashup.dorabangs.core.designsystem.component.textfield + +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens +import com.mashup.dorabangs.core.designsystem.theme.ErrorLabelColorTokens + +@Composable +fun DoraErrorLabel( + errorText: String, + modifier: Modifier = Modifier, +) { + Text( + modifier = modifier, + text = errorText, + color = ErrorLabelColorTokens.LabelColor, + style = DoraTypoTokens.SMedium, + ) +} diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt index a1ea2bb1..46ad655c 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt @@ -17,4 +17,4 @@ fun DoraLabel( style = DoraTypoTokens.caption1Medium, color = LabelColorTokens.LabelColor, ) -} \ No newline at end of file +} diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt index 4378d720..6bb2a7c4 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt @@ -43,6 +43,7 @@ fun DoraTextField( hintText: String, labelText: String, modifier: Modifier = Modifier, + errorText: String = "", ) { var textFieldValue by remember { mutableStateOf( @@ -54,7 +55,7 @@ fun DoraTextField( } Column( - modifier = modifier.padding(horizontal = 20.dp) + modifier = modifier.padding(horizontal = 20.dp), ) { DoraLabel(labelText = labelText) Spacer(modifier = Modifier.height(height = 8.dp)) @@ -116,9 +117,11 @@ fun DoraTextField( }, ) } + Spacer(modifier = Modifier.height(height = 8.dp)) + if (errorText.isNotBlank()) { + DoraErrorLabel(errorText = errorText) + } } - - } @Composable @@ -128,6 +131,7 @@ fun DoraTextFieldPreview() { text = "테스트용 이다 어쩔래 ? ? ? asogihasio gasiofhgaioshgioashgaosighoasihg", hintText = "URL을 입력해주세요.", labelText = "바보", + errorText = "유효한 링크를 입력해주세요.", ) } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt index 1ca186ee..d817a847 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt @@ -50,6 +50,10 @@ object LabelColorTokens { val LabelColor = DoraColorTokens.G9 } +object ErrorLabelColorTokens { + val LabelColor = DoraColorTokens.Alert +} + object TopBarColorTokens { val isDarkMode = false // 임시 다크모드 체크 val ContainerColor From 1405166b240c009f8662815f2a9a499d82826ea4 Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sat, 29 Jun 2024 20:58:38 +0900 Subject: [PATCH 05/15] =?UTF-8?q?[#28=20feature]=20short=20preview=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 --- .../component/textfield/DoraTextField.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt index 6bb2a7c4..0b264379 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt @@ -126,7 +126,7 @@ fun DoraTextField( @Composable @Preview -fun DoraTextFieldPreview() { +fun DoraTextFieldLongPreview() { DoraTextField( text = "테스트용 이다 어쩔래 ? ? ? asogihasio gasiofhgaioshgioashgaosighoasihg", hintText = "URL을 입력해주세요.", @@ -135,6 +135,17 @@ fun DoraTextFieldPreview() { ) } +@Composable +@Preview +fun DoraTextFieldShortPreview() { + DoraTextField( + text = "테스트용 이다 어쩔래 ? ? ?", + hintText = "URL을 입력해주세요.", + labelText = "바보", + errorText = "유효한 링크를 입력해주세요.", + ) +} + @Composable @Preview fun DoraTextFieldPreviewWithHint() { From e5d91738e3c50205c347749cf1d822d85d7edc82 Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sat, 29 Jun 2024 21:01:46 +0900 Subject: [PATCH 06/15] =?UTF-8?q?[#28=20feature]=20focus=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/textfield/DoraTextField.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt index 0b264379..183c9534 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt @@ -17,6 +17,7 @@ import androidx.compose.material3.Icon import androidx.compose.material3.IconButton 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 @@ -24,6 +25,8 @@ 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.focus.FocusRequester +import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.TextRange import androidx.compose.ui.text.input.TextFieldValue @@ -53,6 +56,10 @@ fun DoraTextField( ), ) } + val focusRequester = remember { FocusRequester() } + LaunchedEffect(key1 = Unit) { + focusRequester.requestFocus() + } Column( modifier = modifier.padding(horizontal = 20.dp), @@ -67,6 +74,7 @@ fun DoraTextField( ) { BasicTextField( modifier = Modifier + .focusRequester(focusRequester) .fillMaxHeight() .padding(horizontal = 12.dp, vertical = 13.dp), value = textFieldValue, From 7626d3150768e1fc7a9114a3fcde0b2cf2d80a62 Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sat, 29 Jun 2024 21:22:22 +0900 Subject: [PATCH 07/15] =?UTF-8?q?[#28=20refactoring]=20=EB=A6=AC=EB=B7=B0?= =?UTF-8?q?=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/textfield/DoraTextField.kt | 10 +++++----- .../{DoraErrorLabel.kt => DoraTextFieldErrorLabel.kt} | 6 +++--- .../textfield/{DoraLabel.kt => DoraTextFieldLabel.kt} | 6 +++--- .../mashup/dorabangs/core/designsystem/theme/Colors.kt | 10 +++++----- core/designsystem/src/main/res/values/string.xml | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) rename core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/{DoraErrorLabel.kt => DoraTextFieldErrorLabel.kt} (72%) rename core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/{DoraLabel.kt => DoraTextFieldLabel.kt} (74%) diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt index 183c9534..cb042966 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt @@ -64,13 +64,13 @@ fun DoraTextField( Column( modifier = modifier.padding(horizontal = 20.dp), ) { - DoraLabel(labelText = labelText) + DoraTextFieldLabel(labelText = labelText) Spacer(modifier = Modifier.height(height = 8.dp)) Column( modifier = Modifier .size(width = 350.dp, height = 48.dp) .clip(DoraRoundTokens.Round8) - .background(TextFieldColorTokens.TextFieldBackGroundColor), + .background(TextFieldColorTokens.BackGroundColor), ) { BasicTextField( modifier = Modifier @@ -93,7 +93,7 @@ fun DoraTextField( modifier = Modifier.fillMaxWidth(), text = hintText, maxLines = 1, - color = TextFieldColorTokens.TextFieldHintTextColor, + color = TextFieldColorTokens.HintTextColor, style = DoraTypoTokens.caption1Medium, textAlign = TextAlign.Start, ) @@ -116,7 +116,7 @@ fun DoraTextField( Icon( imageVector = DoraIconClose.CloseCircle, contentDescription = stringResource(id = R.string.url_text_clear), - tint = TextFieldColorTokens.TextFieldClearButtonColor, + tint = TextFieldColorTokens.ClearButtonColor, ) } } @@ -127,7 +127,7 @@ fun DoraTextField( } Spacer(modifier = Modifier.height(height = 8.dp)) if (errorText.isNotBlank()) { - DoraErrorLabel(errorText = errorText) + DoraTextFieldErrorLabel(errorText = errorText) } } } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraErrorLabel.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldErrorLabel.kt similarity index 72% rename from core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraErrorLabel.kt rename to core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldErrorLabel.kt index f87ac7eb..13db38b3 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraErrorLabel.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldErrorLabel.kt @@ -4,17 +4,17 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens -import com.mashup.dorabangs.core.designsystem.theme.ErrorLabelColorTokens +import com.mashup.dorabangs.core.designsystem.theme.TextFieldErrorLabelColorTokens @Composable -fun DoraErrorLabel( +fun DoraTextFieldErrorLabel( errorText: String, modifier: Modifier = Modifier, ) { Text( modifier = modifier, text = errorText, - color = ErrorLabelColorTokens.LabelColor, + color = TextFieldErrorLabelColorTokens.LabelColor, style = DoraTypoTokens.SMedium, ) } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldLabel.kt similarity index 74% rename from core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt rename to core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldLabel.kt index 46ad655c..3134e964 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraLabel.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldLabel.kt @@ -4,10 +4,10 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens -import com.mashup.dorabangs.core.designsystem.theme.LabelColorTokens +import com.mashup.dorabangs.core.designsystem.theme.TextFieldLabelColorTokens @Composable -fun DoraLabel( +fun DoraTextFieldLabel( labelText: String, modifier: Modifier = Modifier, ) { @@ -15,6 +15,6 @@ fun DoraLabel( modifier = modifier, text = labelText, style = DoraTypoTokens.caption1Medium, - color = LabelColorTokens.LabelColor, + color = TextFieldLabelColorTokens.LabelColor, ) } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt index 4a8fe1e5..31ab3b06 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt @@ -44,16 +44,16 @@ object ClipBoardColorTokens { } object TextFieldColorTokens { - val TextFieldBackGroundColor = DoraColorTokens.G1 - val TextFieldHintTextColor = DoraColorTokens.G4 - val TextFieldClearButtonColor = DoraColorTokens.G4 + val BackGroundColor = DoraColorTokens.G1 + val HintTextColor = DoraColorTokens.G4 + val ClearButtonColor = DoraColorTokens.G4 } -object LabelColorTokens { +object TextFieldLabelColorTokens { val LabelColor = DoraColorTokens.G9 } -object ErrorLabelColorTokens { +object TextFieldErrorLabelColorTokens { val LabelColor = DoraColorTokens.Alert } diff --git a/core/designsystem/src/main/res/values/string.xml b/core/designsystem/src/main/res/values/string.xml index 7ef84878..76420138 100644 --- a/core/designsystem/src/main/res/values/string.xml +++ b/core/designsystem/src/main/res/values/string.xml @@ -7,5 +7,5 @@ 테스트 테스트 테스트 테스트 클립보드에 복사한 링크 저장 스낵바 취소 - url 모두 지우기 + url 모두 지우기 \ No newline at end of file From 072316eae5182ae211df136b59f1666316462fae Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sat, 29 Jun 2024 21:25:32 +0900 Subject: [PATCH 08/15] =?UTF-8?q?[#28=20refactoring]=20=EB=A6=AC=EB=B7=B0?= =?UTF-8?q?=20=EB=B0=98=EC=98=81=20v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/designsystem/component/textfield/DoraTextField.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt index cb042966..da5db593 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt @@ -115,7 +115,7 @@ fun DoraTextField( ) { Icon( imageVector = DoraIconClose.CloseCircle, - contentDescription = stringResource(id = R.string.url_text_clear), + contentDescription = stringResource(id = R.string.text_field_url_text_clear), tint = TextFieldColorTokens.ClearButtonColor, ) } From 8c0544f84481610f2ac945f15b6ca2d780b225fd Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sat, 29 Jun 2024 21:27:53 +0900 Subject: [PATCH 09/15] =?UTF-8?q?build=20->=20assembleDebug=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 --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e75fa6ad..ce034d69 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,4 +30,4 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build + run: ./gradlew assembleDebug From e5d14bbe8a67b770f68168694862e8767427bd16 Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sat, 29 Jun 2024 23:27:05 +0900 Subject: [PATCH 10/15] =?UTF-8?q?[#28=20refactoring]=20=EC=A7=9C=EC=9E=98?= =?UTF-8?q?=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../snackbar/doraiconclose/CloseCircle.kt | 104 +++++------------- .../snackbar/doraiconclose/DoraIconClose.kt | 12 +- .../component/textfield/DoraTextField.kt | 67 +++++------ .../textfield/DoraTextFieldErrorLabel.kt | 20 ---- .../textfield/DoraTextFieldHelperText.kt | 32 ++++++ .../core/designsystem/theme/Colors.kt | 6 +- .../feature/save/DoraLinkSaveRouter.kt | 40 +++++++ .../feature/save/DoraLinkSaveScreen.kt | 49 +++++++++ feature/save/src/main/res/values/string.xml | 6 + 9 files changed, 201 insertions(+), 135 deletions(-) delete mode 100644 core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldErrorLabel.kt create mode 100644 core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldHelperText.kt create mode 100644 feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt create mode 100644 feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt create mode 100644 feature/save/src/main/res/values/string.xml diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/CloseCircle.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/CloseCircle.kt index 755b24a3..03ccd1d7 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/CloseCircle.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/CloseCircle.kt @@ -4,6 +4,8 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.PathFillType.Companion.NonZero import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.graphics.StrokeCap.Companion.Butt +import androidx.compose.ui.graphics.StrokeCap.Companion.Round +import androidx.compose.ui.graphics.StrokeJoin import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector.Builder @@ -12,86 +14,36 @@ import androidx.compose.ui.unit.dp public val DoraIconClose.CloseCircle: ImageVector get() { - if (_closeCircle != null) { - return _closeCircle!! + if (_icCloseWhite != null) { + return _icCloseWhite!! } - _closeCircle = Builder( - name = "CloseCircle", - defaultWidth = 26.0.dp, - defaultHeight = - 26.0.dp, - viewportWidth = 26.0f, - viewportHeight = 26.0f, - ).apply { - path( - fill = SolidColor(Color(0x00000000)), - stroke = SolidColor(Color(0xFF000000)), - strokeLineWidth = 0.5f, - strokeLineCap = Butt, - strokeLineJoin = Miter, - strokeLineMiter = 4.0f, - pathFillType = NonZero, - ) { - moveTo(5.0f, 0.75f) - lineTo(21.0f, 0.75f) - arcTo(4.25f, 4.25f, 0.0f, false, true, 25.25f, 5.0f) - lineTo(25.25f, 21.0f) - arcTo(4.25f, 4.25f, 0.0f, false, true, 21.0f, 25.25f) - lineTo(5.0f, 25.25f) - arcTo(4.25f, 4.25f, 0.0f, false, true, 0.75f, 21.0f) - lineTo(0.75f, 5.0f) - arcTo(4.25f, 4.25f, 0.0f, false, true, 5.0f, 0.75f) + _icCloseWhite = Builder(name = "IcCloseWhite", defaultWidth = 24.0.dp, defaultHeight = + 24.0.dp, viewportWidth = 24.0f, viewportHeight = 24.0f).apply { + path(fill = SolidColor(Color(0xFFADB5BD)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero) { + moveTo(12.0f, 22.0f) + curveTo(17.5f, 22.0f, 22.0f, 17.5f, 22.0f, 12.0f) + curveTo(22.0f, 6.5f, 17.5f, 2.0f, 12.0f, 2.0f) + curveTo(6.5f, 2.0f, 2.0f, 6.5f, 2.0f, 12.0f) + curveTo(2.0f, 17.5f, 6.5f, 22.0f, 12.0f, 22.0f) close() } - path( - fill = SolidColor(Color(0xFFDEE2E6)), - stroke = null, - strokeLineWidth = 0.0f, - strokeLineCap = Butt, - strokeLineJoin = Miter, - strokeLineMiter = 4.0f, - pathFillType = NonZero, - ) { - moveTo(13.0f, 3.25f) - curveTo(7.6239f, 3.25f, 3.25f, 7.6239f, 3.25f, 13.0f) - curveTo(3.25f, 18.3761f, 7.6239f, 22.75f, 13.0f, 22.75f) - curveTo(18.3761f, 22.75f, 22.75f, 18.3761f, 22.75f, 13.0f) - curveTo(22.75f, 7.6239f, 18.3761f, 3.25f, 13.0f, 3.25f) - close() - moveTo(16.5302f, 15.4698f) - curveTo(16.6027f, 15.5388f, 16.6608f, 15.6216f, 16.7008f, 15.7133f) - curveTo(16.7409f, 15.805f, 16.7622f, 15.9039f, 16.7635f, 16.004f) - curveTo(16.7648f, 16.1041f, 16.746f, 16.2034f, 16.7083f, 16.2961f) - curveTo(16.6706f, 16.3889f, 16.6147f, 16.4731f, 16.5439f, 16.5439f) - curveTo(16.4731f, 16.6147f, 16.3889f, 16.6706f, 16.2961f, 16.7083f) - curveTo(16.2034f, 16.746f, 16.1041f, 16.7648f, 16.004f, 16.7635f) - curveTo(15.9039f, 16.7622f, 15.805f, 16.7409f, 15.7133f, 16.7008f) - curveTo(15.6216f, 16.6608f, 15.5388f, 16.6027f, 15.4698f, 16.5302f) - lineTo(13.0f, 14.0608f) - lineTo(10.5302f, 16.5302f) - curveTo(10.3884f, 16.6649f, 10.1995f, 16.7389f, 10.004f, 16.7364f) - curveTo(9.8084f, 16.7339f, 9.6215f, 16.6551f, 9.4832f, 16.5168f) - curveTo(9.3449f, 16.3785f, 9.2661f, 16.1916f, 9.2636f, 15.996f) - curveTo(9.2611f, 15.8005f, 9.3351f, 15.6116f, 9.4698f, 15.4698f) - lineTo(11.9392f, 13.0f) - lineTo(9.4698f, 10.5302f) - curveTo(9.3351f, 10.3884f, 9.2611f, 10.1995f, 9.2636f, 10.004f) - curveTo(9.2661f, 9.8084f, 9.3449f, 9.6215f, 9.4832f, 9.4832f) - curveTo(9.6215f, 9.3449f, 9.8084f, 9.2661f, 10.004f, 9.2636f) - curveTo(10.1995f, 9.2611f, 10.3884f, 9.3351f, 10.5302f, 9.4698f) - lineTo(13.0f, 11.9392f) - lineTo(15.4698f, 9.4698f) - curveTo(15.6116f, 9.3351f, 15.8005f, 9.2611f, 15.996f, 9.2636f) - curveTo(16.1916f, 9.2661f, 16.3785f, 9.3449f, 16.5168f, 9.4832f) - curveTo(16.6551f, 9.6215f, 16.7339f, 9.8084f, 16.7364f, 10.004f) - curveTo(16.7389f, 10.1995f, 16.6649f, 10.3884f, 16.5302f, 10.5302f) - lineTo(14.0608f, 13.0f) - lineTo(16.5302f, 15.4698f) - close() + path(fill = SolidColor(Color(0x00000000)), stroke = SolidColor(Color(0xFFffffff)), + strokeLineWidth = 1.2f, strokeLineCap = Round, strokeLineJoin = + StrokeJoin.Companion.Round, strokeLineMiter = 4.0f, pathFillType = NonZero) { + moveTo(9.0f, 15.0f) + lineTo(15.0f, 9.0f) + } + path(fill = SolidColor(Color(0x00000000)), stroke = SolidColor(Color(0xFFffffff)), + strokeLineWidth = 1.2f, strokeLineCap = Round, strokeLineJoin = + StrokeJoin.Companion.Round, strokeLineMiter = 4.0f, pathFillType = NonZero) { + moveTo(15.0f, 15.0f) + lineTo(9.0f, 9.0f) } } - .build() - return _closeCircle!! + .build() + return _icCloseWhite!! } -private var _closeCircle: ImageVector? = null +private var _icCloseWhite: ImageVector? = null diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/DoraIconClose.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/DoraIconClose.kt index a02c5329..56722a5f 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/DoraIconClose.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/DoraIconClose.kt @@ -8,10 +8,10 @@ public object DoraIconClose private var __AllIcons: ____KtList? = null public val DoraIconClose.AllIcons: ____KtList - get() { - if (__AllIcons != null) { - return __AllIcons!! - } - __AllIcons = listOf(CloseCircle) - return __AllIcons!! + get() { + if (__AllIcons != null) { + return __AllIcons!! } + __AllIcons = listOf(CloseCircle) + return __AllIcons!! + } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt index da5db593..0def7530 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt @@ -1,5 +1,6 @@ package com.mashup.dorabangs.core.designsystem.component.textfield +import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -13,7 +14,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.text.BasicTextField -import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -34,8 +34,8 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.mashup.dorabangs.core.designsystem.R -import com.mashup.dorabangs.core.designsystem.component.snackbar.doraiconclose.CloseCircle import com.mashup.dorabangs.core.designsystem.component.snackbar.doraiconclose.DoraIconClose +import com.mashup.dorabangs.core.designsystem.component.snackbar.doraiconclose.CloseCircle import com.mashup.dorabangs.core.designsystem.theme.DoraRoundTokens import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens import com.mashup.dorabangs.core.designsystem.theme.TextFieldColorTokens @@ -45,8 +45,9 @@ fun DoraTextField( text: String, hintText: String, labelText: String, + helperEnabled: Boolean, modifier: Modifier = Modifier, - errorText: String = "", + helperText: String = "", ) { var textFieldValue by remember { mutableStateOf( @@ -62,13 +63,13 @@ fun DoraTextField( } Column( - modifier = modifier.padding(horizontal = 20.dp), + modifier = modifier.fillMaxWidth(), ) { DoraTextFieldLabel(labelText = labelText) Spacer(modifier = Modifier.height(height = 8.dp)) Column( modifier = Modifier - .size(width = 350.dp, height = 48.dp) + .height(height = 48.dp) .clip(DoraRoundTokens.Round8) .background(TextFieldColorTokens.BackGroundColor), ) { @@ -85,38 +86,39 @@ fun DoraTextField( }, decorationBox = { innerTextField -> Box( - modifier = Modifier.width(326.dp), + modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.CenterStart, ) { - if (textFieldValue.text.isBlank()) { - Text( - modifier = Modifier.fillMaxWidth(), - text = hintText, - maxLines = 1, - color = TextFieldColorTokens.HintTextColor, - style = DoraTypoTokens.caption1Medium, - textAlign = TextAlign.Start, - ) - } else { - Row( - modifier = Modifier.fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.SpaceBetween, // 양끝 배치 + Row( + modifier = Modifier + .fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween, + ) { + Box( + modifier = Modifier.weight(1f), ) { - Box( - modifier = Modifier.weight(1f), // innerTextField가 가로로 확장되지 않도록 설정 - ) { - innerTextField() + if (textFieldValue.text.isBlank()) { + Text( + modifier = Modifier.fillMaxWidth(), + text = hintText, + maxLines = 1, + color = TextFieldColorTokens.HintTextColor, + style = DoraTypoTokens.caption1Medium, + textAlign = TextAlign.Start, + ) } - Spacer(modifier = Modifier.width(width = 4.dp)) + innerTextField() + } + Spacer(modifier = Modifier.width(width = 4.dp)) + if (textFieldValue.text.isNotBlank()) { IconButton( modifier = Modifier.size(size = 24.dp), onClick = { textFieldValue = TextFieldValue("") }, ) { - Icon( + Image( imageVector = DoraIconClose.CloseCircle, contentDescription = stringResource(id = R.string.text_field_url_text_clear), - tint = TextFieldColorTokens.ClearButtonColor, ) } } @@ -126,9 +128,7 @@ fun DoraTextField( ) } Spacer(modifier = Modifier.height(height = 8.dp)) - if (errorText.isNotBlank()) { - DoraTextFieldErrorLabel(errorText = errorText) - } + DoraTextFieldHelperText(helperText = helperText, enabled = helperEnabled) } } @@ -139,7 +139,8 @@ fun DoraTextFieldLongPreview() { text = "테스트용 이다 어쩔래 ? ? ? asogihasio gasiofhgaioshgioashgaosighoasihg", hintText = "URL을 입력해주세요.", labelText = "바보", - errorText = "유효한 링크를 입력해주세요.", + helperText = "유효한 링크를 입력해주세요.", + helperEnabled = true ) } @@ -150,7 +151,8 @@ fun DoraTextFieldShortPreview() { text = "테스트용 이다 어쩔래 ? ? ?", hintText = "URL을 입력해주세요.", labelText = "바보", - errorText = "유효한 링크를 입력해주세요.", + helperText = "유효한 링크를 입력해주세요.", + helperEnabled = true ) } @@ -161,5 +163,6 @@ fun DoraTextFieldPreviewWithHint() { text = "", hintText = "URL을 입력해주세요.", labelText = "링크", + helperEnabled = false, ) } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldErrorLabel.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldErrorLabel.kt deleted file mode 100644 index 13db38b3..00000000 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldErrorLabel.kt +++ /dev/null @@ -1,20 +0,0 @@ -package com.mashup.dorabangs.core.designsystem.component.textfield - -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens -import com.mashup.dorabangs.core.designsystem.theme.TextFieldErrorLabelColorTokens - -@Composable -fun DoraTextFieldErrorLabel( - errorText: String, - modifier: Modifier = Modifier, -) { - Text( - modifier = modifier, - text = errorText, - color = TextFieldErrorLabelColorTokens.LabelColor, - style = DoraTypoTokens.SMedium, - ) -} diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldHelperText.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldHelperText.kt new file mode 100644 index 00000000..a88a29bb --- /dev/null +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldHelperText.kt @@ -0,0 +1,32 @@ +package com.mashup.dorabangs.core.designsystem.component.textfield + +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens +import com.mashup.dorabangs.core.designsystem.theme.TextFieldHelperTextColorTokens + +@Composable +fun DoraTextFieldHelperText( + enabled: Boolean, + helperText: String, + modifier: Modifier = Modifier, +) { + if (enabled) { + Text( + modifier = modifier, + text = helperText, + color = TextFieldHelperTextColorTokens.LabelColor, + style = DoraTypoTokens.SMedium, + ) + } else { + Spacer( + modifier = Modifier.height( + height = 14.dp + ) + ) + } +} diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt index 31ab3b06..b2e6a29f 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt @@ -53,10 +53,14 @@ object TextFieldLabelColorTokens { val LabelColor = DoraColorTokens.G9 } -object TextFieldErrorLabelColorTokens { +object TextFieldHelperTextColorTokens { val LabelColor = DoraColorTokens.Alert } +object LinkSaveColorTokens { + val ContainerColor = DoraColorTokens.White +} + object TopBarColorTokens { val ContainerColor = DoraColorTokens.White val OnContainerColor = DoraColorTokens.G9 diff --git a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt new file mode 100644 index 00000000..129c5171 --- /dev/null +++ b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt @@ -0,0 +1,40 @@ +package com.dorabangs.feature.save + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.mashup.dorabangs.core.designsystem.component.topbar.DoraTopBar +import com.mashup.dorabangs.core.designsystem.theme.LinkSaveColorTokens + +@Composable +fun DoraLinkSaveRouter( + modifier: Modifier = Modifier, +) { + Column( + modifier = modifier + .fillMaxSize() + .background(color = LinkSaveColorTokens.ContainerColor), + ) { + DoraTopBar.BackNavigationTopBar( + modifier = Modifier, + title = "링크저장", + titleAlignment = Alignment.Center, + onClickBackIcon = {} + ) + Spacer(modifier = Modifier.height(height = 24.dp)) + DoraLinkSaveScreen() + } +} + +@Composable +@Preview +fun DoraLinkSaveRouterPreview() { + DoraLinkSaveRouter() +} \ No newline at end of file diff --git a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt new file mode 100644 index 00000000..6c309b11 --- /dev/null +++ b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt @@ -0,0 +1,49 @@ +package com.dorabangs.feature.save + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.mashup.dorabangs.core.designsystem.component.buttons.DoraButtons +import com.mashup.dorabangs.core.designsystem.component.textfield.DoraTextField + +@Composable +fun DoraLinkSaveScreen( + modifier: Modifier = Modifier, +) { + Column( + modifier = modifier + .fillMaxSize() + .padding(horizontal = 20.dp), + ) { + DoraTextField( + text = "", + hintText = stringResource(id = R.string.link_save_hint_text), + labelText = stringResource(id = R.string.link_save_label_text), + helperText = stringResource(id = R.string.link_save_error_text), + helperEnabled = true, // 서버통신 이후에 알 수 있음 + ) + Spacer(modifier = Modifier.height(20.dp)) + DoraButtons.DoraBtnMaxFull( + modifier = Modifier + .fillMaxWidth(), + buttonText = "저장", + enabled = true, + onClickButton = {}, + ) + Spacer(modifier = Modifier.height(20.dp)) + } +} + +@Composable +@Preview +fun DoraLinkSaveScreenPreview() { + DoraLinkSaveScreen() +} \ No newline at end of file diff --git a/feature/save/src/main/res/values/string.xml b/feature/save/src/main/res/values/string.xml new file mode 100644 index 00000000..9ea05ac2 --- /dev/null +++ b/feature/save/src/main/res/values/string.xml @@ -0,0 +1,6 @@ + + + URL을 입력해주세요. + 링크 + 유효한 링크를 입력해주세요. + \ No newline at end of file From 3e9ff9eb5bdb11dcbd2f968f0eb12f2fb841b5e9 Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sun, 30 Jun 2024 00:57:15 +0900 Subject: [PATCH 11/15] =?UTF-8?q?[#28=20refactoring]=20=EC=A7=9C=EC=9E=98?= =?UTF-8?q?=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 최대 길이 못넘김 - 버튼 이미지 수정 --- .../snackbar/doraiconclose/CloseCircle.kt | 50 ++++++++++++++----- .../snackbar/doraiconclose/DoraIconClose.kt | 12 ++--- .../component/textfield/DoraTextCounter.kt | 33 ++++++++++++ .../component/textfield/DoraTextField.kt | 30 +++++++++-- .../textfield/DoraTextFieldHelperText.kt | 4 +- .../core/designsystem/theme/Colors.kt | 2 +- .../feature/save/DoraLinkSaveRouter.kt | 4 +- .../feature/save/DoraLinkSaveScreen.kt | 3 +- 8 files changed, 109 insertions(+), 29 deletions(-) create mode 100644 core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextCounter.kt diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/CloseCircle.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/CloseCircle.kt index 03ccd1d7..107ef491 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/CloseCircle.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/CloseCircle.kt @@ -17,11 +17,23 @@ public val DoraIconClose.CloseCircle: ImageVector if (_icCloseWhite != null) { return _icCloseWhite!! } - _icCloseWhite = Builder(name = "IcCloseWhite", defaultWidth = 24.0.dp, defaultHeight = - 24.0.dp, viewportWidth = 24.0f, viewportHeight = 24.0f).apply { - path(fill = SolidColor(Color(0xFFADB5BD)), stroke = null, strokeLineWidth = 0.0f, - strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, - pathFillType = NonZero) { + _icCloseWhite = Builder( + name = "IcCloseWhite", + defaultWidth = 24.0.dp, + defaultHeight = + 24.0.dp, + viewportWidth = 24.0f, + viewportHeight = 24.0f, + ).apply { + path( + fill = SolidColor(Color(0xFFADB5BD)), + stroke = null, + strokeLineWidth = 0.0f, + strokeLineCap = Butt, + strokeLineJoin = Miter, + strokeLineMiter = 4.0f, + pathFillType = NonZero, + ) { moveTo(12.0f, 22.0f) curveTo(17.5f, 22.0f, 22.0f, 17.5f, 22.0f, 12.0f) curveTo(22.0f, 6.5f, 17.5f, 2.0f, 12.0f, 2.0f) @@ -29,20 +41,34 @@ public val DoraIconClose.CloseCircle: ImageVector curveTo(2.0f, 17.5f, 6.5f, 22.0f, 12.0f, 22.0f) close() } - path(fill = SolidColor(Color(0x00000000)), stroke = SolidColor(Color(0xFFffffff)), - strokeLineWidth = 1.2f, strokeLineCap = Round, strokeLineJoin = - StrokeJoin.Companion.Round, strokeLineMiter = 4.0f, pathFillType = NonZero) { + path( + fill = SolidColor(Color(0x00000000)), + stroke = SolidColor(Color(0xFFffffff)), + strokeLineWidth = 1.2f, + strokeLineCap = Round, + strokeLineJoin = + StrokeJoin.Companion.Round, + strokeLineMiter = 4.0f, + pathFillType = NonZero, + ) { moveTo(9.0f, 15.0f) lineTo(15.0f, 9.0f) } - path(fill = SolidColor(Color(0x00000000)), stroke = SolidColor(Color(0xFFffffff)), - strokeLineWidth = 1.2f, strokeLineCap = Round, strokeLineJoin = - StrokeJoin.Companion.Round, strokeLineMiter = 4.0f, pathFillType = NonZero) { + path( + fill = SolidColor(Color(0x00000000)), + stroke = SolidColor(Color(0xFFffffff)), + strokeLineWidth = 1.2f, + strokeLineCap = Round, + strokeLineJoin = + StrokeJoin.Companion.Round, + strokeLineMiter = 4.0f, + pathFillType = NonZero, + ) { moveTo(15.0f, 15.0f) lineTo(9.0f, 9.0f) } } - .build() + .build() return _icCloseWhite!! } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/DoraIconClose.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/DoraIconClose.kt index 56722a5f..a02c5329 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/DoraIconClose.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/snackbar/doraiconclose/DoraIconClose.kt @@ -8,10 +8,10 @@ public object DoraIconClose private var __AllIcons: ____KtList? = null public val DoraIconClose.AllIcons: ____KtList - get() { - if (__AllIcons != null) { - return __AllIcons!! + get() { + if (__AllIcons != null) { + return __AllIcons!! + } + __AllIcons = listOf(CloseCircle) + return __AllIcons!! } - __AllIcons = listOf(CloseCircle) - return __AllIcons!! - } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextCounter.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextCounter.kt new file mode 100644 index 00000000..17cae11a --- /dev/null +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextCounter.kt @@ -0,0 +1,33 @@ +package com.mashup.dorabangs.core.designsystem.component.textfield + +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens +import com.mashup.dorabangs.core.designsystem.theme.TextFieldColorTokens + +@Composable +fun DoraTextCounter( + counterEnabled: Boolean, + textLength: Int, + modifier: Modifier = Modifier, +) { + if (counterEnabled) { + Text( + modifier = modifier, + text = "$textLength/15", + color = TextFieldColorTokens.TextCounterColor, + style = DoraTypoTokens.SNormal, + ) + } +} + +@Composable +@Preview +fun DoraTextCounterPreview() { + DoraTextCounter( + counterEnabled = true, + textLength = 3, + ) +} diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt index 0def7530..1ec059ef 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt @@ -34,8 +34,8 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.mashup.dorabangs.core.designsystem.R -import com.mashup.dorabangs.core.designsystem.component.snackbar.doraiconclose.DoraIconClose import com.mashup.dorabangs.core.designsystem.component.snackbar.doraiconclose.CloseCircle +import com.mashup.dorabangs.core.designsystem.component.snackbar.doraiconclose.DoraIconClose import com.mashup.dorabangs.core.designsystem.theme.DoraRoundTokens import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens import com.mashup.dorabangs.core.designsystem.theme.TextFieldColorTokens @@ -46,6 +46,7 @@ fun DoraTextField( hintText: String, labelText: String, helperEnabled: Boolean, + counterEnabled: Boolean, modifier: Modifier = Modifier, helperText: String = "", ) { @@ -82,7 +83,11 @@ fun DoraTextField( singleLine = true, textStyle = DoraTypoTokens.caption1Medium, onValueChange = { - textFieldValue = it + if (counterEnabled) { + if (it.text.length <= 15) textFieldValue = it + } else { + textFieldValue = it + } }, decorationBox = { innerTextField -> Box( @@ -128,7 +133,19 @@ fun DoraTextField( ) } Spacer(modifier = Modifier.height(height = 8.dp)) - DoraTextFieldHelperText(helperText = helperText, enabled = helperEnabled) + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween, + ) { + DoraTextFieldHelperText( + helperText = helperText, + enabled = helperEnabled, + ) + DoraTextCounter( + counterEnabled = counterEnabled, + textLength = textFieldValue.text.length, + ) + } } } @@ -140,7 +157,8 @@ fun DoraTextFieldLongPreview() { hintText = "URL을 입력해주세요.", labelText = "바보", helperText = "유효한 링크를 입력해주세요.", - helperEnabled = true + helperEnabled = true, + counterEnabled = true, ) } @@ -152,7 +170,8 @@ fun DoraTextFieldShortPreview() { hintText = "URL을 입력해주세요.", labelText = "바보", helperText = "유효한 링크를 입력해주세요.", - helperEnabled = true + helperEnabled = true, + counterEnabled = true, ) } @@ -164,5 +183,6 @@ fun DoraTextFieldPreviewWithHint() { hintText = "URL을 입력해주세요.", labelText = "링크", helperEnabled = false, + counterEnabled = true, ) } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldHelperText.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldHelperText.kt index a88a29bb..a4ff8f8f 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldHelperText.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextFieldHelperText.kt @@ -25,8 +25,8 @@ fun DoraTextFieldHelperText( } else { Spacer( modifier = Modifier.height( - height = 14.dp - ) + height = 14.dp, + ), ) } } diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt index b2e6a29f..a85f15f1 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/theme/Colors.kt @@ -46,7 +46,7 @@ object ClipBoardColorTokens { object TextFieldColorTokens { val BackGroundColor = DoraColorTokens.G1 val HintTextColor = DoraColorTokens.G4 - val ClearButtonColor = DoraColorTokens.G4 + val TextCounterColor = DoraColorTokens.G6 } object TextFieldLabelColorTokens { diff --git a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt index 129c5171..c9e827f4 100644 --- a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt +++ b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt @@ -26,7 +26,7 @@ fun DoraLinkSaveRouter( modifier = Modifier, title = "링크저장", titleAlignment = Alignment.Center, - onClickBackIcon = {} + onClickBackIcon = {}, ) Spacer(modifier = Modifier.height(height = 24.dp)) DoraLinkSaveScreen() @@ -37,4 +37,4 @@ fun DoraLinkSaveRouter( @Preview fun DoraLinkSaveRouterPreview() { DoraLinkSaveRouter() -} \ No newline at end of file +} diff --git a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt index 6c309b11..ed1feea1 100644 --- a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt +++ b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt @@ -29,6 +29,7 @@ fun DoraLinkSaveScreen( labelText = stringResource(id = R.string.link_save_label_text), helperText = stringResource(id = R.string.link_save_error_text), helperEnabled = true, // 서버통신 이후에 알 수 있음 + counterEnabled = true, ) Spacer(modifier = Modifier.height(20.dp)) DoraButtons.DoraBtnMaxFull( @@ -46,4 +47,4 @@ fun DoraLinkSaveScreen( @Preview fun DoraLinkSaveScreenPreview() { DoraLinkSaveScreen() -} \ No newline at end of file +} From 455d10973bac183381cf310c9348d21c3ef5e10a Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sun, 30 Jun 2024 01:02:50 +0900 Subject: [PATCH 12/15] =?UTF-8?q?[#28=20refactoring]=20docs=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/textfield/DoraTextField.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt index 1ec059ef..b30320e3 100644 --- a/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt +++ b/core/designsystem/src/main/java/com/mashup/dorabangs/core/designsystem/component/textfield/DoraTextField.kt @@ -40,6 +40,15 @@ import com.mashup.dorabangs.core.designsystem.theme.DoraRoundTokens import com.mashup.dorabangs.core.designsystem.theme.DoraTypoTokens import com.mashup.dorabangs.core.designsystem.theme.TextFieldColorTokens +/** + * @param text 텍필에 가지고 들어갈 text + * @param hintText 텍필에서 text가 없을 때 보여줄 hint text + * @param labelText 텍필에 가지고 라벨 텍스트, ex) 링크 + * @param helperEnabled 헬퍼 텍스트를 보여줄지 말지에 대한 값 + * @param counterEnabled text counter를 보여줄지 말지에 대한 값 + * @param modifier 알잖아요 + * @param helperText 헬퍼텍스트에 대한 값, ex) 유효한 링크를 입력해주세요 + */ @Composable fun DoraTextField( text: String, From 45e71ad825a3cb8d2e481b0905e4b92469810712 Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sun, 30 Jun 2024 01:32:39 +0900 Subject: [PATCH 13/15] =?UTF-8?q?[#28=20refactoring]=20resource=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt | 3 ++- .../main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt | 2 +- feature/save/src/main/res/values/string.xml | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt index c9e827f4..6ec3a742 100644 --- a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt +++ b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.mashup.dorabangs.core.designsystem.component.topbar.DoraTopBar @@ -24,7 +25,7 @@ fun DoraLinkSaveRouter( ) { DoraTopBar.BackNavigationTopBar( modifier = Modifier, - title = "링크저장", + title = stringResource(id = R.string.link_save_title_text), titleAlignment = Alignment.Center, onClickBackIcon = {}, ) diff --git a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt index ed1feea1..323d624d 100644 --- a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt +++ b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt @@ -35,7 +35,7 @@ fun DoraLinkSaveScreen( DoraButtons.DoraBtnMaxFull( modifier = Modifier .fillMaxWidth(), - buttonText = "저장", + buttonText = stringResource(R.string.link_save_button_text), enabled = true, onClickButton = {}, ) diff --git a/feature/save/src/main/res/values/string.xml b/feature/save/src/main/res/values/string.xml index 9ea05ac2..e967178b 100644 --- a/feature/save/src/main/res/values/string.xml +++ b/feature/save/src/main/res/values/string.xml @@ -3,4 +3,6 @@ URL을 입력해주세요. 링크 유효한 링크를 입력해주세요. + 저장 + 링크저장 \ No newline at end of file From f04cfc3db13c9a909becd937b915704280eb6aaf Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sun, 30 Jun 2024 01:40:46 +0900 Subject: [PATCH 14/15] =?UTF-8?q?[#28=20refactoring]=20=EB=A6=AC=EB=B6=80?= =?UTF-8?q?=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/save/DoraLinkSaveRouter.kt | 31 ++-------- .../feature/save/DoraLinkSaveScreen.kt | 57 +++++++++++++------ 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt index 6ec3a742..7b32d593 100644 --- a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt +++ b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt @@ -1,41 +1,22 @@ package com.dorabangs.feature.save -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.height import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp -import com.mashup.dorabangs.core.designsystem.component.topbar.DoraTopBar -import com.mashup.dorabangs.core.designsystem.theme.LinkSaveColorTokens @Composable fun DoraLinkSaveRouter( + onClickBackIcon: () -> Unit, modifier: Modifier = Modifier, ) { - Column( - modifier = modifier - .fillMaxSize() - .background(color = LinkSaveColorTokens.ContainerColor), - ) { - DoraTopBar.BackNavigationTopBar( - modifier = Modifier, - title = stringResource(id = R.string.link_save_title_text), - titleAlignment = Alignment.Center, - onClickBackIcon = {}, - ) - Spacer(modifier = Modifier.height(height = 24.dp)) - DoraLinkSaveScreen() - } + DoraLinkSaveScreen( + modifier = modifier, + onClickBackIcon = onClickBackIcon, + ) } @Composable @Preview fun DoraLinkSaveRouterPreview() { - DoraLinkSaveRouter() + DoraLinkSaveRouter({}) } diff --git a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt index 323d624d..4fe1934f 100644 --- a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt +++ b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveScreen.kt @@ -1,5 +1,6 @@ package com.dorabangs.feature.save +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize @@ -7,44 +8,64 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.mashup.dorabangs.core.designsystem.component.buttons.DoraButtons import com.mashup.dorabangs.core.designsystem.component.textfield.DoraTextField +import com.mashup.dorabangs.core.designsystem.component.topbar.DoraTopBar +import com.mashup.dorabangs.core.designsystem.theme.LinkSaveColorTokens @Composable fun DoraLinkSaveScreen( + onClickBackIcon: () -> Unit, modifier: Modifier = Modifier, ) { Column( modifier = modifier .fillMaxSize() - .padding(horizontal = 20.dp), + .background(color = LinkSaveColorTokens.ContainerColor), ) { - DoraTextField( - text = "", - hintText = stringResource(id = R.string.link_save_hint_text), - labelText = stringResource(id = R.string.link_save_label_text), - helperText = stringResource(id = R.string.link_save_error_text), - helperEnabled = true, // 서버통신 이후에 알 수 있음 - counterEnabled = true, + DoraTopBar.BackNavigationTopBar( + modifier = Modifier, + title = stringResource(id = R.string.link_save_title_text), + titleAlignment = Alignment.Center, + onClickBackIcon = onClickBackIcon, ) - Spacer(modifier = Modifier.height(20.dp)) - DoraButtons.DoraBtnMaxFull( - modifier = Modifier - .fillMaxWidth(), - buttonText = stringResource(R.string.link_save_button_text), - enabled = true, - onClickButton = {}, - ) - Spacer(modifier = Modifier.height(20.dp)) + Spacer(modifier = Modifier.height(height = 24.dp)) + Column( + modifier = modifier + .fillMaxSize() + .padding(horizontal = 20.dp), + ) { + DoraTextField( + text = "", + hintText = stringResource(id = R.string.link_save_hint_text), + labelText = stringResource(id = R.string.link_save_label_text), + helperText = stringResource(id = R.string.link_save_error_text), + helperEnabled = true, // 서버통신 이후에 알 수 있음 + counterEnabled = true, + ) + Spacer(modifier = Modifier.height(20.dp)) + DoraButtons.DoraBtnMaxFull( + modifier = Modifier + .fillMaxWidth() + .padding(vertical = 20.dp), + buttonText = stringResource(R.string.link_save_button_text), + enabled = true, + onClickButton = { + // TODO: 버튼 연결 + }, + ) + Spacer(modifier = Modifier.height(20.dp)) + } } } @Composable @Preview fun DoraLinkSaveScreenPreview() { - DoraLinkSaveScreen() + DoraLinkSaveScreen({}) } From c53f41750f0e63f7c5dca34a945ff1bbda9178b3 Mon Sep 17 00:00:00 2001 From: Ahn-seokjoo Date: Sun, 30 Jun 2024 01:41:17 +0900 Subject: [PATCH 15/15] =?UTF-8?q?[#28=20refactoring]=20=EB=A6=AC=EB=B6=80?= =?UTF-8?q?=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../save/{DoraLinkSaveRouter.kt => DoraLinkSaveRoute.kt} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename feature/save/src/main/java/com/dorabangs/feature/save/{DoraLinkSaveRouter.kt => DoraLinkSaveRoute.kt} (89%) diff --git a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRoute.kt similarity index 89% rename from feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt rename to feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRoute.kt index 7b32d593..9895e0b2 100644 --- a/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRouter.kt +++ b/feature/save/src/main/java/com/dorabangs/feature/save/DoraLinkSaveRoute.kt @@ -5,7 +5,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview @Composable -fun DoraLinkSaveRouter( +fun DoraLinkSaveRoute( onClickBackIcon: () -> Unit, modifier: Modifier = Modifier, ) { @@ -18,5 +18,5 @@ fun DoraLinkSaveRouter( @Composable @Preview fun DoraLinkSaveRouterPreview() { - DoraLinkSaveRouter({}) + DoraLinkSaveRoute({}) }