|
|
@ -1663,24 +1663,25 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm |
|
|
|
return ((Account) resultValue).username; |
|
|
|
return ((Account) resultValue).username; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// This method is invoked in a worker thread.
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected FilterResults performFiltering(CharSequence constraint) { |
|
|
|
protected FilterResults performFiltering(CharSequence constraint) { |
|
|
|
FilterResults filterResults = new FilterResults(); |
|
|
|
FilterResults filterResults = new FilterResults(); |
|
|
|
if (constraint != null) { |
|
|
|
if (constraint != null) { |
|
|
|
ArrayList<Account> accounts = autocompleteMention(constraint.toString()); |
|
|
|
ArrayList<Account> accounts = autocompleteMention(constraint.toString()); |
|
|
|
synchronized (this) { |
|
|
|
|
|
|
|
resultList.clear(); |
|
|
|
|
|
|
|
resultList.addAll(accounts); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
filterResults.values = accounts; |
|
|
|
filterResults.values = accounts; |
|
|
|
filterResults.count = accounts.size(); |
|
|
|
filterResults.count = accounts.size(); |
|
|
|
} |
|
|
|
} |
|
|
|
return filterResults; |
|
|
|
return filterResults; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void publishResults(CharSequence constraint, FilterResults results) { |
|
|
|
protected void publishResults(CharSequence constraint, FilterResults results) { |
|
|
|
if (results != null && results.count > 0) { |
|
|
|
if (results != null && results.count > 0) { |
|
|
|
|
|
|
|
resultList.clear(); |
|
|
|
|
|
|
|
ArrayList<Account> newResults = (ArrayList<Account>) results.values; |
|
|
|
|
|
|
|
resultList.addAll(newResults); |
|
|
|
notifyDataSetChanged(); |
|
|
|
notifyDataSetChanged(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
notifyDataSetInvalidated(); |
|
|
|
notifyDataSetInvalidated(); |
|
|
|