From 0833b1ad028fb278c5137745380596f32d44da41 Mon Sep 17 00:00:00 2001 From: newmskywalker <3849278+newmskywalker@users.noreply.github.com> Date: Sat, 20 Jul 2024 21:30:18 -0700 Subject: [PATCH] Make email and password text fields single line (#293) --- .../ui-utils/src/main/java/io/newm/core/ui/text/TextFields.kt | 4 +++- .../src/main/java/io/newm/feature/login/screen/email/Email.kt | 1 + .../java/io/newm/feature/login/screen/password/Password.kt | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/android/core/ui-utils/src/main/java/io/newm/core/ui/text/TextFields.kt b/android/core/ui-utils/src/main/java/io/newm/core/ui/text/TextFields.kt index 055f9e7b..a6b54f98 100644 --- a/android/core/ui-utils/src/main/java/io/newm/core/ui/text/TextFields.kt +++ b/android/core/ui-utils/src/main/java/io/newm/core/ui/text/TextFields.kt @@ -114,7 +114,8 @@ fun TextFieldWithLabel( keyboardOptions: KeyboardOptions = if (isPassword) TextFieldWithLabelDefaults.KeyboardOptions.PASSWORD else TextFieldWithLabelDefaults.KeyboardOptions.NON_UNDERLINED, keyboardActions: KeyboardActions = KeyboardActions.Default, helperText: String? = null, - textfieldBackgroundColor: Color = MaterialTheme.colors.surface + textfieldBackgroundColor: Color = MaterialTheme.colors.surface, + singleLine: Boolean = false, ) { val isInputMasked = remember { mutableStateOf(isPassword) } Column( @@ -169,6 +170,7 @@ fun TextFieldWithLabel( } else { null }, + singleLine = singleLine, ) Text( text = helperText.orEmpty(), diff --git a/android/features/login/src/main/java/io/newm/feature/login/screen/email/Email.kt b/android/features/login/src/main/java/io/newm/feature/login/screen/email/Email.kt index ae0ca32d..65eee747 100644 --- a/android/features/login/src/main/java/io/newm/feature/login/screen/email/Email.kt +++ b/android/features/login/src/main/java/io/newm/feature/login/screen/email/Email.kt @@ -35,5 +35,6 @@ fun Email( keyboardOptions = keyboardOptions, keyboardActions = keyboardActions, helperText = emailState.getError(), + singleLine = true, ) } diff --git a/android/features/login/src/main/java/io/newm/feature/login/screen/password/Password.kt b/android/features/login/src/main/java/io/newm/feature/login/screen/password/Password.kt index c4fc14db..864d673f 100644 --- a/android/features/login/src/main/java/io/newm/feature/login/screen/password/Password.kt +++ b/android/features/login/src/main/java/io/newm/feature/login/screen/password/Password.kt @@ -37,5 +37,6 @@ fun Password( keyboardOptions = keyboardOptions, keyboardActions = keyboardActions, helperText = passwordState.getError(), + singleLine = true, ) }