INNER CODE UNIT · Kotlin
onTextChanged
Keyspace-cloud/android · app/src/main/kotlin/cloud/keyspace/android/AddCard.kt:337
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
if (toDate.text?.length == 2) {
try {
toDate.text!!.append("/")
if (toDate.text?.take(2).toString().toInt() !in 1..12) {
toDate.text!!.clear()
toDate.error = "Please enter a valid expiry month"
}
} catch (backspace: java.lang.NumberFormatException) {
toDate.text!!.clear()
}
}
}
})
securityCode = findViewById (R.id.CVVInput)
cardholderNameInput = findViewById (R.id.CardholderInput)
cardholderNameInput.imeOptions = EditorInfoCompat.IME_FLAG_NO_PERSONALIZED_LEARNING