Created
February 27, 2022 21:21
-
-
Save hkawii/8a32d47f09ef25ad012180488904ed64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun AppTextField( | |
modifier: Modifier = Modifier, | |
text: String, | |
placeholder: String, | |
leadingIcon: @Composable (() -> Unit)? = null, | |
onChange: (String) -> Unit = {}, | |
imeAction: ImeAction = ImeAction.Next, | |
keyboardType: KeyboardType = KeyboardType.Text, | |
keyBoardActions: KeyboardActions = KeyboardActions(), | |
isEnabled: Boolean = true | |
) { | |
OutlinedTextField( | |
modifier = modifier.fillMaxWidth(), | |
value = text, | |
onValueChange = onChange, | |
leadingIcon = leadingIcon, | |
textStyle = TextStyle(fontSize = 18.sp), | |
keyboardOptions = KeyboardOptions(imeAction = imeAction, keyboardType = keyboardType), | |
keyboardActions = keyBoardActions, | |
enabled = isEnabled, | |
colors = TextFieldDefaults.outlinedTextFieldColors( | |
focusedBorderColor = Color.Black, | |
unfocusedBorderColor = Color.Gray, | |
disabledBorderColor = Color.Gray, | |
disabledTextColor = Color.Black | |
), | |
placeholder = { | |
Text(text = placeholder, style = TextStyle(fontSize = 18.sp, color = Color.LightGray)) | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment