Browse Source

Set KeyboardOptions imeActions to default on notes forms so that it can go to next line on new item forms screens

Khubaib 4 months ago
parent
commit
a51c2435b3

+ 1 - 1
app/src/main/java/com/fastest/pass/home/presentation/ui/components/AddBankAccountFormScreen.kt

@@ -471,7 +471,7 @@ fun ColumnScope.NotesTextFieldABAFS(
         ),
         keyboardOptions = KeyboardOptions(
             keyboardType = KeyboardType.Text,
-            imeAction = ImeAction.Done
+            imeAction = ImeAction.Default
         ),
         keyboardActions = KeyboardActions(
             onDone = {

+ 76 - 0
app/src/main/java/com/fastest/pass/home/presentation/ui/components/AddContactInfoScreen.kt

@@ -175,6 +175,12 @@ fun AddContactInfoScreen() {
             NumberTextFieldACIFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.mobile, placeholder = R.string.mobile, ImeAction.Next)
             Spacer(modifier = Modifier.height(20.dp))
             NumberTextFieldACIFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.fax, placeholder = R.string.fax, ImeAction.Done)
+
+            Spacer(modifier = Modifier.height(20.dp))
+            NameTextFieldACIFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.username)
+
+            Spacer(modifier = Modifier.height(20.dp))
+            NotesTextFieldACIFS(keyboardController = keyboardController, focusManager = focusManager)
         }
     }
 }
@@ -1376,4 +1382,74 @@ fun BoxScope.SaveButtonACIFS(buttonText: Int) {
             textAlign = TextAlign.Center
         )
     }
+}
+
+@Composable
+fun ColumnScope.NotesTextFieldACIFS(
+    keyboardController: SoftwareKeyboardController?,
+    focusManager: FocusManager
+) {
+    var notesText by remember { mutableStateOf("") }
+
+    TextField(
+        value = notesText,
+        onValueChange = {
+            notesText = it
+        },
+        textStyle = MaterialTheme.typography.displayMedium,
+        modifier = Modifier
+            .align(Alignment.Start)
+            .fillMaxWidth()
+            .defaultMinSize(minHeight = 60.dp)
+            .wrapContentHeight()
+            .border(
+                1.dp,
+                color = colorResource(id = R.color.gray_border_textfield),
+                shape = RoundedCornerShape(16.dp)
+            )
+            .background(color = colorResource(id = R.color.transparent))
+        ,
+        shape = RoundedCornerShape(16.dp),
+//        placeholder = {
+//            Text(
+//                text = stringResource(id = R.string.enter_email_address),
+//                color = colorResource(id = R.color.gray_splash),
+//                style = MaterialTheme.typography.displayMedium
+//            )
+//        },
+        label = {
+            Text(text = stringResource(R.string.notes),
+                style = MaterialTheme.typography.titleSmall.copy(
+                    color = colorResource(id = R.color.gray_text)
+                )
+            )
+        },
+//        leadingIcon = {
+//            Image(
+//                painter = painterResource(id = R.drawable.profile_circle),
+//                contentDescription = "Title Logo",
+//                modifier = Modifier
+//                    .size(24.dp, 24.dp)
+//            )
+//        },
+        colors = TextFieldDefaults.colors(
+            focusedLabelColor = colorResource(id = R.color.gray_splash),
+            unfocusedContainerColor = colorResource(id = R.color.transparent),
+            focusedContainerColor = colorResource(id = R.color.transparent),
+            focusedIndicatorColor = colorResource(id = R.color.transparent),
+            disabledIndicatorColor = colorResource(id = R.color.transparent),
+            unfocusedIndicatorColor = colorResource(id = R.color.transparent),
+            cursorColor = colorResource(id = R.color.gray_splash),
+        ),
+        keyboardOptions = KeyboardOptions(
+            keyboardType = KeyboardType.Text,
+            imeAction = ImeAction.Default
+        ),
+        keyboardActions = KeyboardActions(
+            onDone = {
+                focusManager.clearFocus()
+                keyboardController?.hide()
+            }
+        ),
+    )
 }

+ 1 - 1
app/src/main/java/com/fastest/pass/home/presentation/ui/components/AddDriverLicenseFormScreen.kt

@@ -461,7 +461,7 @@ fun ColumnScope.NotesTextFieldADLFS(
         ),
         keyboardOptions = KeyboardOptions(
             keyboardType = KeyboardType.Text,
-            imeAction = ImeAction.Done
+            imeAction = ImeAction.Default
         ),
         keyboardActions = KeyboardActions(
             onDone = {

+ 1 - 1
app/src/main/java/com/fastest/pass/home/presentation/ui/components/AddPassportFormScreen.kt

@@ -461,7 +461,7 @@ fun ColumnScope.NotesTextFieldAPFS(
         ),
         keyboardOptions = KeyboardOptions(
             keyboardType = KeyboardType.Text,
-            imeAction = ImeAction.Done
+            imeAction = ImeAction.Default
         ),
         keyboardActions = KeyboardActions(
             onDone = {

+ 1 - 1
app/src/main/java/com/fastest/pass/home/presentation/ui/components/AddPasswordFormScreen.kt

@@ -481,7 +481,7 @@ fun ColumnScope.NotesTextFieldAPS(
         ),
         keyboardOptions = KeyboardOptions(
             keyboardType = KeyboardType.Text,
-            imeAction = ImeAction.Done
+            imeAction = ImeAction.Default
         ),
         keyboardActions = KeyboardActions(
             onDone = {

+ 1 - 1
app/src/main/java/com/fastest/pass/home/presentation/ui/components/AddPaymentCardFormScreen.kt

@@ -295,7 +295,7 @@ fun ColumnScope.NotesTextFieldAPCFS(
         ),
         keyboardOptions = KeyboardOptions(
             keyboardType = KeyboardType.Text,
-            imeAction = ImeAction.Done
+            imeAction = ImeAction.Default
         ),
         keyboardActions = KeyboardActions(
             onDone = {

+ 1 - 1
app/src/main/java/com/fastest/pass/home/presentation/ui/components/AddSecureNoteFormScreen.kt

@@ -196,7 +196,7 @@ fun ColumnScope.NotesTextFieldASNFS(
         ),
         keyboardOptions = KeyboardOptions(
             keyboardType = KeyboardType.Text,
-            imeAction = ImeAction.Done
+            imeAction = ImeAction.Default
         ),
         keyboardActions = KeyboardActions(
             onDone = {

+ 1 - 1
app/src/main/java/com/fastest/pass/home/presentation/ui/components/AddWifiPasswordFormScreen.kt

@@ -231,7 +231,7 @@ fun ColumnScope.NotesTextFieldAWFFS(
         ),
         keyboardOptions = KeyboardOptions(
             keyboardType = KeyboardType.Text,
-            imeAction = ImeAction.Done
+            imeAction = ImeAction.Default
         ),
         keyboardActions = KeyboardActions(
             onDone = {

+ 2 - 2
app/src/main/java/com/fastest/pass/welcome/presentation/ui/component/WelcomeScreen.kt

@@ -101,8 +101,8 @@ fun WelcomeTutorial(onClick: (ClickType) -> Unit) {
                 modifier = Modifier
                     .align(Alignment.BottomCenter)
                     .padding(vertical = 25.dp),
-                activeColor = Color.White,
-                inactiveColor = Gray_Splash
+                activeColor = Gray_Splash,
+                inactiveColor = colorResource(id = R.color.gray_text)
             )
         }
     }