Search in sources :

Example 1 with SuggestUserAdapter

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);
}
Also used : RealmUser(chat.rocket.persistence.realm.models.ddp.RealmUser) SuggestUserAdapter(chat.rocket.android.layouthelper.sidebar.dialog.SuggestUserAdapter) AutoCompleteTextView(android.widget.AutoCompleteTextView)

Aggregations

AutoCompleteTextView (android.widget.AutoCompleteTextView)1 SuggestUserAdapter (chat.rocket.android.layouthelper.sidebar.dialog.SuggestUserAdapter)1 RealmUser (chat.rocket.persistence.realm.models.ddp.RealmUser)1