Java Code Examples for android.view.inputmethod.EditorInfo#IME_NULL

The following examples show how to use android.view.inputmethod.EditorInfo#IME_NULL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainActivity.java    From IdeaTrackerPlus with MIT License 6 votes vote down vote up
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

    if (actionId == EditorInfo.IME_ACTION_GO
            || actionId == EditorInfo.IME_ACTION_DONE
            || actionId == EditorInfo.IME_ACTION_NEXT
            || actionId == EditorInfo.IME_ACTION_SEND
            || actionId == EditorInfo.IME_ACTION_SEARCH
            || actionId == EditorInfo.IME_NULL) {

        switch ((int) v.getTag()) {
            case 1:
                mNoteField.requestFocus();
                break;

            case 2:
                sendIdeaFromDialog();
                break;

            default:
                break;
        }
        return true;
    }
    return false;
}
 
Example 2
Source File: PassphrasePromptActivity.java    From Silence with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean onEditorAction(TextView exampleView, int actionId, KeyEvent keyEvent) {
  if ((keyEvent == null && actionId == EditorInfo.IME_ACTION_DONE) ||
      (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_DOWN &&
          (actionId == EditorInfo.IME_NULL)))
  {
    handlePassphrase();
    return true;
  } else if (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_UP &&
             actionId == EditorInfo.IME_NULL)
  {
    return true;
  }

  return false;
}
 
Example 3
Source File: ActionEx.java    From document-viewer with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onEditorAction(final TextView textView, final int actionId, final KeyEvent keyEvent) {
    if ((actionId == EditorInfo.IME_NULL || actionId == EditorInfo.IME_ACTION_DONE)) {
        if ((keyEvent == null || keyEvent.getAction() == KeyEvent.ACTION_UP)) {
            this.putValue(IActionController.VIEW_PROPERTY, textView);
            run();
        }
        return true;
    }
    return false;
}
 
Example 4
Source File: LocalIMEKeyboard.java    From WaniKani-for-Android with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Handler of editor actions. It intercepts the "enter" key and moves to the
 * next question, by calling {@link #next()}.
 */
@Override
public boolean onEditorAction (TextView tv, int actionId, KeyEvent event)
{
    if (actionId == EditorInfo.IME_ACTION_DONE
            || (actionId == EditorInfo.IME_NULL && event != null &&
                event.getKeyCode() == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_DOWN)) {
        next ();
        return true;
    }

    return false;
}
 
Example 5
Source File: SearchBar.java    From EhViewer with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (v == mEditText) {
        if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_NULL) {
            applySearch();
            return true;
        }
    }
    return false;
}
 
Example 6
Source File: SignInScene.java    From EhViewer with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (v == mPassword) {
        if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
            signIn();
            return true;
        }
    }

    return false;
}
 
Example 7
Source File: StatusListFragment.java    From gilgamesh with GNU General Public License v3.0 5 votes vote down vote up
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    // If the action is a key-up event on the return key, send the message
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
        String message = view.getText().toString();
        updateStatus(message);
    }
    if(D) Log.i(TAG, "END onEditorAction");
    return true;
}
 
Example 8
Source File: BluetoothChatFragment.java    From android-BluetoothChat with Apache License 2.0 5 votes vote down vote up
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    // If the action is a key-up event on the return key, send the message
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
        String message = view.getText().toString();
        sendMessage(message);
    }
    return true;
}
 
Example 9
Source File: ExampleFragment.java    From BTChat with GNU General Public License v3.0 5 votes vote down vote up
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    // If the action is a key-up event on the return key, send the message
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
        String message = view.getText().toString();
        if(message != null && message.length() > 0)
        	sendMessage(message);
    }
    return true;
}
 
Example 10
Source File: ExampleFragment.java    From BLEChat with GNU General Public License v3.0 5 votes vote down vote up
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    // If the action is a key-up event on the return key, send the message
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
        String message = view.getText().toString();
        if(message != null && message.length() > 0)
        	sendMessage(message);
    }
    return true;
}
 
Example 11
Source File: LoginUrlFragment.java    From quill with MIT License 5 votes vote down vote up
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == getResources().getInteger(R.integer.ime_action_id_next)
            || actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
        onNextClicked();
        // don't consume the event, so the keyboard can also be hidden
        // http://stackoverflow.com/questions/2342620/how-to-hide-keyboard-after-typing-in-edittext-in-android#comment20849208_10184099
        return false;
    }
    return false;
}
 
Example 12
Source File: BluetoothChatFragment.java    From connectivity-samples with Apache License 2.0 5 votes vote down vote up
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    // If the action is a key-up event on the return key, send the message
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
        String message = view.getText().toString();
        sendMessage(message);
    }
    return true;
}
 
Example 13
Source File: MainActivity.java    From Car_remote_control with GNU General Public License v3.0 5 votes vote down vote up
public boolean onEditorAction(TextView view, int actionId, KeyEvent event)
{
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP)
    {
        String message = view.getText().toString();
        sendMessage(message);
    }
    return true;
}
 
Example 14
Source File: RecyclerOnClickListener.java    From IdeaTrackerPlus with MIT License 5 votes vote down vote up
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_GO
            || actionId == EditorInfo.IME_ACTION_DONE
            || actionId == EditorInfo.IME_ACTION_NEXT
            || actionId == EditorInfo.IME_ACTION_SEND
            || actionId == EditorInfo.IME_ACTION_SEARCH
            || actionId == EditorInfo.IME_NULL) {
        sendEditIdea();
    }
    return true;
}
 
Example 15
Source File: RecyclerOnClickListener.java    From IdeaTrackerPlus with MIT License 5 votes vote down vote up
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_GO
            || actionId == EditorInfo.IME_ACTION_DONE
            || actionId == EditorInfo.IME_ACTION_NEXT
            || actionId == EditorInfo.IME_ACTION_SEND
            || actionId == EditorInfo.IME_ACTION_SEARCH
            || actionId == EditorInfo.IME_NULL) {
        mNoteField.requestFocus();
    }
    return true;
}
 
Example 16
Source File: LoginActivity.java    From WanAndroid with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if ((actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL)
            && ((isLogIn && v == binding.password) || (!isLogIn && v == binding.againPassword))
            ) { // 点击了键盘上的回车,如果是登录并且是密码框,则登录。如果是注册,并且是再次输入密码框,则注册
        onClickOk(null);
        return true;
    }

    return false;
}
 
Example 17
Source File: SearchBar.java    From MHViewer with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (v == mEditText) {
        if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_NULL) {
            applySearch();
            return true;
        }
    }
    return false;
}
 
Example 18
Source File: SignInScene.java    From MHViewer with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (v == mPassword) {
        if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
            signIn();
            return true;
        }
    }

    return false;
}
 
Example 19
Source File: PassphrasePromptActivity.java    From mollyim-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onEditorAction(TextView exampleView, int actionId, KeyEvent keyEvent) {
  if ((keyEvent == null && actionId == EditorInfo.IME_ACTION_DONE) ||
      (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_DOWN &&
       (actionId == EditorInfo.IME_NULL))) {
    if (okButton.isClickable()) {
      okButton.performClick();
    }
    return true;
  }
  return keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_UP
          && actionId == EditorInfo.IME_NULL;
}
 
Example 20
Source File: MongolEditText.java    From mongol-library with MIT License 4 votes vote down vote up
public int getImeOptions() {
    return mInputContentType != null
            ? mInputContentType.imeOptions : EditorInfo.IME_NULL;
}