Skip to content

Commit

Permalink
Update datacapture/src/main/java/com/google/android/fhir/datacapture/…
Browse files Browse the repository at this point in the history
…views/factories/DropDownViewHolderFactory.kt

Co-authored-by: santosh-pingle <[email protected]>
  • Loading branch information
qaziabubakar-vd and santosh-pingle authored Feb 26, 2024
1 parent a6959c6 commit dd3ead3
Showing 1 changed file with 13 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,37 +133,19 @@ internal object DropDownViewHolderFactory :
}
}

autoCompleteTextView.addTextChangedListener(
object : TextWatcher {
override fun beforeTextChanged(
charSequence: CharSequence?,
start: Int,
count: Int,
after: Int,
) {}

override fun onTextChanged(
charSequence: CharSequence?,
start: Int,
before: Int,
count: Int,
) {}

override fun afterTextChanged(editable: Editable?) {
if (editable.isNullOrBlank()) {
Handler(Looper.getMainLooper())
.postDelayed(
{
if (autoCompleteTextView.isPopupShowing.not()) {
autoCompleteTextView.showDropDown()
}
},
100,
)
}
}
},
)
autoCompleteTextView.doAfterTextChanged {
if (it.isNullOrBlank()) {
Handler(Looper.getMainLooper())
.postDelayed(
{
if (autoCompleteTextView.isPopupShowing.not()) {
autoCompleteTextView.showDropDown()
}
},
100,
)
}
}

displayValidationResult(questionnaireViewItem.validationResult)
}
Expand Down

0 comments on commit dd3ead3

Please sign in to comment.