use of android.widget.AutoCompleteTextView 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);
}
use of android.widget.AutoCompleteTextView in project RxBinding by JakeWharton.
the class RxAutoCompleteTextViewTestActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout layout = new LinearLayout(this);
setContentView(layout);
autoCompleteTextView = new AutoCompleteTextView(this);
autoCompleteTextView.setLayoutParams(new LayoutParams(MATCH_PARENT, WRAP_CONTENT));
autoCompleteTextView.setId(R.id.auto_complete);
layout.addView(autoCompleteTextView);
}
use of android.widget.AutoCompleteTextView in project android_frameworks_base by DirtyUnicorns.
the class AutoCompleteTextViewActivityLandscape method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.auto_complete_list);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, COUNTRIES);
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit);
textView.setAdapter(adapter);
}
use of android.widget.AutoCompleteTextView in project android_frameworks_base by DirtyUnicorns.
the class AutoCompleteTextViewActivityPortrait method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.auto_complete_list);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, COUNTRIES);
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit);
textView.setAdapter(adapter);
}
use of android.widget.AutoCompleteTextView in project Lightning-Browser by anthonycr.
the class LightningDialogBuilder method showEditBookmarkDialog.
private void showEditBookmarkDialog(@NonNull final Activity activity, @NonNull final UIController uiController, @NonNull final HistoryItem item) {
final AlertDialog.Builder editBookmarkDialog = new AlertDialog.Builder(activity);
editBookmarkDialog.setTitle(R.string.title_edit_bookmark);
final View dialogLayout = View.inflate(activity, R.layout.dialog_edit_bookmark, null);
final EditText getTitle = (EditText) dialogLayout.findViewById(R.id.bookmark_title);
getTitle.setText(item.getTitle());
final EditText getUrl = (EditText) dialogLayout.findViewById(R.id.bookmark_url);
getUrl.setText(item.getUrl());
final AutoCompleteTextView getFolder = (AutoCompleteTextView) dialogLayout.findViewById(R.id.bookmark_folder);
getFolder.setHint(R.string.folder);
getFolder.setText(item.getFolder());
mBookmarkManager.getFolderNames().subscribeOn(Schedulers.io()).observeOn(Schedulers.main()).subscribe(new SingleOnSubscribe<List<String>>() {
@Override
public void onItem(@Nullable List<String> folders) {
Preconditions.checkNonNull(folders);
final ArrayAdapter<String> suggestionsAdapter = new ArrayAdapter<>(activity, android.R.layout.simple_dropdown_item_1line, folders);
getFolder.setThreshold(1);
getFolder.setAdapter(suggestionsAdapter);
editBookmarkDialog.setView(dialogLayout);
editBookmarkDialog.setPositiveButton(activity.getString(R.string.action_ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
HistoryItem editedItem = new HistoryItem();
editedItem.setTitle(getTitle.getText().toString());
editedItem.setUrl(getUrl.getText().toString());
editedItem.setUrl(getUrl.getText().toString());
editedItem.setFolder(getFolder.getText().toString());
mBookmarkManager.editBookmark(item, editedItem).subscribeOn(Schedulers.io()).observeOn(Schedulers.main()).subscribe(new CompletableOnSubscribe() {
@Override
public void onComplete() {
uiController.handleBookmarksChange();
}
});
}
});
Dialog dialog = editBookmarkDialog.show();
BrowserDialog.setDialogSize(activity, dialog);
}
});
}
Aggregations