Skip to content

Instantly share code, notes, and snippets.

View thenishchalraj's full-sized avatar
Time Travelling Ambidextrous Researcher

Nishchal Raj thenishchalraj

Time Travelling Ambidextrous Researcher
View GitHub Profile
@thenishchalraj
thenishchalraj / TextWatcherForInputBox.kt
Created August 15, 2022 10:24
Text watcher that will take care of input fields in CreateInputFieldsInInputBox.kt
private fun setTextWatcher(editText: EditText?) {
editText?.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
if (s.toString() != "") {
mTextMap[editText.id] = TextMapModel(s.toString(), editText)
val indexOfNext = mTextIdArray.indexOf(editText.id) + 1