splitwise / TokenAutoComplete

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

How do we get the selected token #216

Closed jyothish6190 closed 8 years ago

mgod commented 8 years ago

You can make the token a custom view and listen to the onSelected callback to keep track of it there. What do you need the selected token for?

jyothish6190 commented 8 years ago

I got some 100 tokens and need to scroll to view the top items. I enabled delete when a token is touched. while scrolling if we accidentally touch the token it gets deleted. So i thought disable that delete while click and if a token selected, remove that one.

mgod commented 8 years ago

I think the easiest way to do this would be to override isTokenRemovable in your completion view to return false while you're scrolling. The other way to do this is to use a custom token class (see docs) and keep track of which token is selected from there.