You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have a problem with switching keyboard during typing. When I switch input type from InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS to InputType.TYPE_CLASS_NUMBER I am getting an error IndexOutOfBoundsException. I read the knowing issues https://github.com/RedMadRobot/input-mask-android#knownissues and try to specify android:digit but it does not help. Is there any other solution please ?
Expected behaviour
Switch keyboard from text to numeric without clearing edit text (IndexOutOfBoundsException)
Platform information
OS version: [e.g. Android 10]
Library version: [e.g. 6.1]
Code:
fun formatter(inputLayout: TextInputLayout) {
with(inputLayout.editText!!) {
val listener = MaskedTextChangedListener("[AA] [00]", this, object : MaskedTextChangedListener.ValueListener {
override fun onTextChanged(maskFilled: Boolean, extractedValue: String, formattedValue: String) {
inputType = if (formattedValue.length >= 2) {
InputType.TYPE_CLASS_NUMBER
} else {
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS or InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
}
}
})
addTextChangedListener(listener)
onFocusChangeListener = listener
}
}
Describe the bug
Hello, I have a problem with switching keyboard during typing. When I switch input type from InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS to InputType.TYPE_CLASS_NUMBER I am getting an error IndexOutOfBoundsException. I read the knowing issues https://github.com/RedMadRobot/input-mask-android#knownissues and try to specify android:digit but it does not help. Is there any other solution please ?
Expected behaviour
Switch keyboard from text to numeric without clearing edit text (IndexOutOfBoundsException)
Platform information
Code:
formatter(textInputLayout)
The text was updated successfully, but these errors were encountered: