INNER CODE UNIT · Kotlin
onTextChanged
Keyspace-cloud/android · app/src/main/kotlin/cloud/keyspace/android/AddCard.kt:522
override fun onTextChanged(data: CharSequence, start: Int, before: Int, count: Int) {
addCustomFieldButton.isEnabled = data.isNotEmpty()
customFieldsData[customFieldView.adapterPosition].name = data.toString()
}
})
customFieldView.fieldValue.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable) { }
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { }
override fun onTextChanged(data: CharSequence, start: Int, before: Int, count: Int) {
addCustomFieldButton.isEnabled = data.isNotEmpty()
customFieldsData[customFieldView.adapterPosition].value = data.toString()
}
})
customFieldView.deleteIcon.setOnClickListener { view ->
addCustomFieldButton.isEnabled = true
Toast.makeText(applicationContext, "Deleted \"${customFieldView.fieldName.text}\"", Toast.LENGTH_SHORT).show()