splitwise / TokenAutoComplete

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

getLineVisibleEnd not returning values correctly #347

Closed danieltigse closed 6 years ago

danieltigse commented 6 years ago

My main problem is that my TokenCompleteTextView is not collapsing. I am debugging and inside the function performCollapse this condition if (count > 0 && countSpans.length == 0) never is fulfilled because of the variable count.

int lastPosition = lastLayout.getLineVisibleEnd(0);
TokenImageSpan[] tokens = text.getSpans(0, lastPosition, TokenImageSpan.class);
int count = objects.size() - tokens.length;

I realized that getLineVisibleEnd is always returning the length of the text look:

screen shot 2018-04-05 at 5 09 34 pm
danieltigse commented 6 years ago

I am sorry. I was missing this line: android:inputType="text|textNoSuggestions|textMultiLine"