/** * Set a special listener to be called when an action is performed * on the text view. This will be called when the enter key is pressed, * or when an action supplied to the IME is selected by the user. Setting * this means that the normal hard key event will not insert a newline * into the text view, even if it is multi-line; holding down the ALT * modifier will, however, allow the user to insert a newline character. */ public void setOnEditorActionListener (TextView.OnEditorActionListener l){ mInputView.setOnEditorActionListener(l); }
private void configureActionItem(Menu menu) { EditText add= menu.findItem(R.id.add).getActionView() .findViewById(R.id.title); add.setOnEditorActionListener(this); } }
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); binding.entry.setOnEditorActionListener((v, actionId, event) -> (send())); binding.entry.setEnabled(socket!=null); RecyclerView rv=view.findViewById(R.id.transcript); rv.setAdapter(adapter); }
@SuppressLint("InflateParams") public EditTextDialogBuilder(Context context, String text, String hint) { super(context); View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_edittext_builder, null); setView(view); mTextInputLayout = (TextInputLayout) view; mEditText = (EditText) view.findViewById(R.id.edit_text); mEditText.setText(text); mEditText.setSelection(mEditText.getText().length()); mEditText.setOnEditorActionListener(this); mTextInputLayout.setHint(hint); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); search=(EditText)findViewById(R.id.search); search.setOnEditorActionListener(this); }
private void unsetSearchListeners() { if (DEBUG) Log.d(TAG, "unsetSearchListeners() called"); searchClear.setOnClickListener(null); searchClear.setOnLongClickListener(null); searchEditText.setOnClickListener(null); searchEditText.setOnFocusChangeListener(null); searchEditText.setOnEditorActionListener(null); if (textWatcher != null) searchEditText.removeTextChangedListener(textWatcher); textWatcher = null; }
editText.setOnEditorActionListener(new OnEditorActionListener() {
searchCardView = (CardView) view.findViewById(R.id.place_search_cardview); searchEditText = (EditText) view.findViewById(R.id.place_search_edittext); searchEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
View viewTitle = switchItem.getActionView(); final EditText editQuary = (EditText) viewTitle.findViewById(R.id.editQuery); editQuary.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@NonNull @Override public Object instantiateItem(@NonNull ViewGroup collection, int position) { LayoutInflater inflater = LayoutInflater.from(TermuxActivity.this); View layout; if (position == 0) { layout = mExtraKeysView = (ExtraKeysView) inflater.inflate(R.layout.extra_keys_main, collection, false); mExtraKeysView.reload(mSettings.mExtraKeys, ExtraKeysView.defaultCharDisplay); } else { layout = inflater.inflate(R.layout.extra_keys_right, collection, false); final EditText editText = layout.findViewById(R.id.text_input); editText.setOnEditorActionListener((v, actionId, event) -> { TerminalSession session = getCurrentTermSession(); if (session != null) { if (session.isRunning()) { String textToSend = editText.getText().toString(); if (textToSend.length() == 0) textToSend = "\n"; session.write(textToSend); } else { removeFinishedSession(session); } editText.setText(""); } return true; }); } collection.addView(layout); return layout; }
mAnswerField.setOnEditorActionListener(new EditText.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
input.setOnEditorActionListener((v, actionId, event) -> { onPositive.onTextSet(input.getText().toString()); dialogHolder[0].dismiss();
@Override protected void startDemo() { EditText editText = (EditText) findViewById(R.id.input_text); editText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) { boolean handled = false; if (actionId == EditorInfo.IME_ACTION_GO) { submit(null); handled = true; } return handled; } }); mCheckboxLayout = (LinearLayout) findViewById(R.id.checkboxes); setUpMap(); }
mOk = ViewUtils.$$(view, R.id.ok); mIpbPassHash.setOnEditorActionListener(this);
searchEditText.setOnEditorActionListener( (TextView v, int actionId, KeyEvent event) -> { if (DEBUG) {
editTextUsername.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
mMsgEt.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
editTextUsername.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
mSkipSigningIn.setPaintFlags(mSignInViaCookies.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); mPassword.setOnEditorActionListener(this);
mInput.setOnEditorActionListener(new EditText.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {