use of chat.rocket.android.layouthelper.sidebar.dialog.SuggestUserAdapter in project Rocket.Chat.Android by RocketChat.
the class AddDirectMessageDialogFragment method setupView.
private void setupView(Optional<RocketChatAbsoluteUrl> rocketChatAbsoluteUrlOptional) {
compositeDisposable.clear();
if (!rocketChatAbsoluteUrlOptional.isPresent()) {
return;
}
AutoCompleteTextView autoCompleteTextView = (AutoCompleteTextView) getDialog().findViewById(R.id.editor_username);
RealmAutoCompleteAdapter<RealmUser> adapter = realmHelper.createAutoCompleteAdapter(getContext(), (realm, text) -> realm.where(RealmUser.class).contains(RealmUser.USERNAME, text, Case.INSENSITIVE).findAllSorted(RealmUser.USERNAME), context -> new SuggestUserAdapter(context, rocketChatAbsoluteUrlOptional.get()));
autoCompleteTextView.setAdapter(adapter);
}
Aggregations