Archived
Text Basic 2.0.0: quick fix on the dropdown menu, implemented a custom DropdownAdapter.kt because a bug on the dropdown menus from years ago still has not been fixed... I encountered this bug in a project back in 2019. How is this still a thing?
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.denizd.textbasic.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.Filter
|
||||
import com.denizd.textbasic.R
|
||||
|
||||
class DropdownAdapter(context: Context, items: List<String>)
|
||||
: ArrayAdapter<String>(context, R.layout.item_dropdown, items) {
|
||||
|
||||
private val noOpFilter = object : Filter() {
|
||||
private val noOpResult = FilterResults()
|
||||
override fun performFiltering(constraint: CharSequence?) = noOpResult
|
||||
override fun publishResults(constraint: CharSequence?, results: FilterResults?) {}
|
||||
}
|
||||
|
||||
override fun getFilter() = noOpFilter
|
||||
}
|
||||
Reference in New Issue
Block a user