You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Duplicate tokens after collapse and re-expand #218
After entering enough tokens for the TokenAutoComplete to collapse, take focus away from it, then focus on it again so it expands. There are now duplicate tokens.
allowDuplicates set to false, and no duplicates entered initially.
My own code following the example quite closely. I am also doing my own filtering of a listview so that i can display the list in the main part of the fragment instead of the dropdown. Do I need to set my adapter to the TokenAutoComplete for the list collapse to function properly? If so, how would I prevent the suggestion pop-up from displaying?
This is how I am setting up my extended TokenAutoComplete:
(composeRecipientView is my TokenAutoComplete)
composeRecipientView.allowDuplicates(false);
composeRecipientView.setTokenClickStyle(TokenCompleteTextView.TokenClickStyle.Select);
composeRecipientView.setDeletionStyle(TokenCompleteTextView.TokenDeleteStyle.Clear);
composeRecipientView.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
searchString = s.toString().replaceAll(",","").replaceAll("\\s","");
if(friendListAdapter != null) {
friendListAdapter.getFilter().filter(searchString);
}
}
@Override
public void afterTextChanged(Editable s) { }
});
I'm wondering if there's some specific configuration change you're making in your code that I'm not duplicating and that's why I can reproduce the issue. If you can reproduce the problem with a tweaked version of the example project, I should be able to recreate the issue.
You might try setting the adapter on the token view and set android:dropDownHeight="0px" in your token view XML, but I don't expect that to solve the issue. You'll probably also find currentCompletionText in the token view to be more useful than the string work you're doing to get your search term, though it is protected.
This was completely re-written for version 3.0.0 and I would expect this issue to be resolved. Please let me know if you're still having trouble after the update.
Activity
mgod commentedon May 12, 2016
I'm not able to reproduce this. In your example, are you using the example from this library or your own code?
sperls commentedon May 12, 2016
My own code following the example quite closely. I am also doing my own filtering of a listview so that i can display the list in the main part of the fragment instead of the dropdown. Do I need to set my adapter to the TokenAutoComplete for the list collapse to function properly? If so, how would I prevent the suggestion pop-up from displaying?
This is how I am setting up my extended TokenAutoComplete:
(composeRecipientView is my TokenAutoComplete)
mgod commentedon May 12, 2016
I'm wondering if there's some specific configuration change you're making in your code that I'm not duplicating and that's why I can reproduce the issue. If you can reproduce the problem with a tweaked version of the example project, I should be able to recreate the issue.
You might try setting the adapter on the token view and set
android:dropDownHeight="0px"in your token view XML, but I don't expect that to solve the issue. You'll probably also findcurrentCompletionTextin the token view to be more useful than the string work you're doing to get your search term, though it is protected.mgod commentedon Mar 9, 2019
This was completely re-written for version
3.0.0and I would expect this issue to be resolved. Please let me know if you're still having trouble after the update.