SearchableSpinner icon indicating copy to clipboard operation
SearchableSpinner copied to clipboard

Library doesn't support Custom Filter for ArrayAdapter

Open jmejia32 opened this issue 8 years ago • 4 comments

Hello, first for all, sorry for my bad English.

Ok, straight to the point. The type of my adapter for the spinner is a project class (e.g. ArrayAdapter<Item>), witch contains two attributes, id (int) and name (String). So I implemented a subclass of ArrayAdapter for a custom filter, because the default filter isn't useful for me, since in my native language (Spanish), there are words with special characters and the filter only works when the text to search matches the beginning of the word.

I've been researched your source code and I realized that ListAdapter for inner ListView of search dialog is built with a generic ArrayAdapter created from the List of items of Dialog class. This causes the filter of my custom Adapter not recognized and the adapter tooks the default instead.

I wish that ListAdapter of inner ListView is created from the custom Adapter in the method setAdapter of class SearchableSpinner

I wait for your early reply. I'd be really useful for me. Thanks.

jmejia32 avatar Jan 03 '17 01:01 jmejia32

I have the same problem as I wanted the filter to be more like contains() instead of startsWith().

azabost avatar Jan 11 '17 13:01 azabost

@azabost can you solved this?

cheloreyes avatar Feb 15 '17 20:02 cheloreyes

@miteshpithadiya please fix this

Guang-B avatar Jan 30 '19 02:01 Guang-B

maybe this will help https://stackoverflow.com/questions/42507097/issue-in-searchable-spinner-adapter-android

mkamaalr avatar Apr 01 '21 03:04 mkamaalr