fix autocomplete of usernames (#1019)
This commit is contained in:
parent
a38319fad0
commit
6b7ca5d184
1 changed files with 5 additions and 1 deletions
|
@ -76,7 +76,7 @@ public class MentionTagAutoCompleteAdapter extends BaseAdapter
|
|||
@Override
|
||||
public CharSequence convertResultToString(Object resultValue) {
|
||||
if (resultValue instanceof AccountResult) {
|
||||
return ((AccountResult) resultValue).account.getUsername();
|
||||
return formatUsername(((AccountResult) resultValue));
|
||||
} else {
|
||||
return formatHashtag((HashtagResult) resultValue);
|
||||
}
|
||||
|
@ -166,6 +166,10 @@ public class MentionTagAutoCompleteAdapter extends BaseAdapter
|
|||
return view;
|
||||
}
|
||||
|
||||
private String formatUsername(AccountResult result) {
|
||||
return String.format("@%s", result.account.getUsername());
|
||||
}
|
||||
|
||||
private String formatHashtag(HashtagResult result) {
|
||||
return String.format("#%s", result.hashtag);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue