I have registration form and I need to show keyboard when user is focused in EditText
. I had always problem with this and I used a lot of workarounds which are no longer working. Im surprised Android cant handle this basic thing like focusing between EditText
on its own.
What is happening here: When I move from email EditText to password one, it will hide keyboard and password field is focused with indicator blinking without visible keyboard.
Code:
emailEt.apply {
onFocusChange {
if (isFocused) app.showKeyboard(a) else app.hideKeyboard(this)
}
onEditorAction {
passwordEt.requestFocus()
}
afterTextChanged {
emailFieldValidation(true)
validateData()
}
}
passwordEt.apply {
onFocusChange {
if (isFocused) app.showKeyboard(a) else app.hideKeyboard(this)
}
onEditorAction {
this.clearFocus()
}
afterTextChanged {
passwordFieldValidation(true)
validateData()
}
}
resetData()
emailEt.requestFocus()