splitwise / TokenAutoComplete

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

Add a function to removeAllObject #169

Closed jiawenzhang closed 5 years ago

mgod commented 9 years ago

Thanks @jiawenzhang. I'm not quite ready to move to AppCompat for the view, so I'll probably hold off on merging this until I'm ready to update the docs for that. I'm happy to add this feature, but it looks like it'll break if I call this while the field is collapsed and has the count or hidden objects visible. You probably also need to add some handling for hidden spans and handling the count span. You should take a look at removeObject, though I think this is the code from there that you should take into account in your method:

for (TokenImageSpan span : toRemove) {
    hiddenSpans.remove(span);
    // Remove it from the state and fire the callback
    spanWatcher.onSpanRemoved(text, span, 0, 0);
}

updateCountSpan();
jiawenzhang commented 9 years ago

Hi, Marshall

Thanks for the comments. I will keep the commits on my own fork then.

Jiawen

On Fri, Oct 16, 2015 at 8:13 AM, Marshall Weir notifications@github.com wrote:

Thanks @jiawenzhang https://github.com/jiawenzhang. I'm not quite ready to move to AppCompat for the view, so I'll probably hold off on merging this until I'm ready to update the docs for that. I'm happy to add this feature, but it looks like it'll break if I call this while the field is collapsed and has the count or hidden objects visible. You probably also need to add some handling for hidden spans and handling the count span. You should take a look at removeObject, though I think this is the code from there that you should take into account in your method:

for (TokenImageSpan span : toRemove) { hiddenSpans.remove(span); // Remove it from the state and fire the callback spanWatcher.onSpanRemoved(text, span, 0, 0); }

updateCountSpan();

— Reply to this email directly or view it on GitHub https://github.com/splitwise/TokenAutoComplete/pull/169#issuecomment-148701011 .

mgod commented 5 years ago

Version 3.0.0 now correctly uses the appcompat parent and has a clearAsync method to empty the view.