We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to know which better spinner is selected or clicked when there are two or more beeterspinner widgets and they use a same onItemClickListener
The text was updated successfully, but these errors were encountered:
You can try this:
// code in Kotlin MaterialBetterSpinner spinner = findViewById(R.id.material_better_spinner) // add a listener to each spinner spinner.addTextChangedListener(object : TextWatcher { override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { val optionSelected = s.toString().toLowerCase() showToast("Ok. Option selected was $optionSelected") } override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, aft: Int) {} override fun afterTextChanged(s: Editable) {} })
Sorry, something went wrong.
You can use this extension function:
fun EditText.afterTextChanged(afterTextChanged: (String) -> Unit) { this.addTextChangedListener(object : TextWatcher { override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { } override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { } override fun afterTextChanged(editable: Editable?) { afterTextChanged.invoke(editable.toString()) } }) }
then: spinner.afterTextChanged { toast(it) }
spinner.afterTextChanged { toast(it) }
No branches or pull requests
how to know which better spinner is selected or clicked
when there are two or more beeterspinner widgets and they use a same onItemClickListener
The text was updated successfully, but these errors were encountered: