splitwise / TokenAutoComplete

Gmail style MultiAutoCompleteTextView for Android
Apache License 2.0
1.3k stars 383 forks source link

Show all objects when empty string #229

Closed thibauddavid closed 8 years ago

thibauddavid commented 8 years ago

Hi,

I'd like to know whether it is possible to display all content of adapter when textField has focus, but user didn't begin to type anything (or tags already present, but didn't start a new one) ?

I've tried to use .setThreshold(0); but that doesn't help.

Thanks for your work btw, that's a great lib

mgod commented 8 years ago

tokenCompleteTextView.showDropDown() should do it, though you need to make sure that the adapter for providing suggestions has entries (make sure you default to "show all items" if the search text is blank) and this method is a bit fussy about timing. You'll probably find you need to make sure it gets called on the main thread and after the rest of the activity is set up.

setThreshold(0) is ignored (1 is the smallest valid threshold)