Skip to content

Instantly share code, notes, and snippets.

@kasem-sm
Created February 13, 2022 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasem-sm/acaa85fc2a40be07a6c16716012b6169 to your computer and use it in GitHub Desktop.
Save kasem-sm/acaa85fc2a40be07a6c16716012b6169 to your computer and use it in GitHub Desktop.
@Composable
fun MyScreen() {
val focusManager = LocalFocusManager.current
Column {
// Username Field
MyTextField(
text = "Enter your username",
onTextChange = { /** Update state **/ },
keyboardOptions = KeyboardOptions(
imeAction = ImeAction.Next
),
keyboardActions = KeyboardActions(
onNext = {
// Pressing Ime button would move the text indicator's focus to the bottom
// field, if it exists!
focusManager.moveFocus(FocusDirection.Down)
}
)
)
// Password Field
MyTextField(
text = "Enter your Password",
onTextChange = { /** Update state **/ },
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment