1
0
mirror of https://github.com/accelforce/Yuito synced 2024-12-22 21:28:08 +01:00

fix autocomplete of usernames (#1019)

This commit is contained in:
Konrad Pozniak 2019-01-30 22:10:05 +01:00 committed by GitHub
parent a38319fad0
commit 6b7ca5d184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}