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