Java 类android.view.inputmethod.EditorInfo 实例源码

项目:qmui    文件:QMUIDialog.java   
public EditTextDialogBuilder(Context context) {
    super(context);
    mEditText = new EditText(mContext);
    mEditText.setHintTextColor(QMUIResHelper.getAttrColor(mContext, R.attr.qmui_config_color_gray_3));
    mEditText.setTextColor(QMUIResHelper.getAttrColor(mContext, R.attr.qmui_config_color_black));
    mEditText.setTextSize(TypedValue.COMPLEX_UNIT_PX, QMUIResHelper.getAttrDimen(mContext, R.attr.qmui_dialog_content_message_text_size));
    mEditText.setFocusable(true);
    mEditText.setFocusableInTouchMode(true);
    mEditText.setImeOptions(EditorInfo.IME_ACTION_GO);
    mEditText.setGravity(Gravity.CENTER_VERTICAL);
    mEditText.setId(R.id.qmui_dialog_edit_input);

    mRightImageView = new ImageView(mContext);
    mRightImageView.setId(R.id.qmui_dialog_edit_right_icon);
    mRightImageView.setVisibility(View.GONE);
}
项目:Android_watch_magpie    文件:AddValueFragment.java   
private void removeFocus(TextInputLayout... textInputLayouts) {
    for (TextInputLayout textInputLayout : textInputLayouts) {
        textInputLayout.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
                if (actionId == EditorInfo.IME_ACTION_DONE) {
                    textView.clearFocus();
                    // Hide the keyboard
                    InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
                    imm.hideSoftInputFromWindow(textView.getWindowToken(), 0);
                }
                return false;
            }
        });
    }
}
项目:youkes_browser    文件:BrowserActivity.java   
@Override
public boolean onEditorAction(TextView arg0, int actionId, KeyEvent arg2) {
    // hide the keyboard and search the web when the enter key
    // button is pressed
    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
            || (arg2.getAction() == KeyEvent.KEYCODE_ENTER)) {
        InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(mSearch.getWindowToken(), 0);
        searchTheWeb(mSearch.getText().toString());
        LightningView v=getCurrentWebView();
        if (v != null) {
            v.requestFocus();
        }
        return true;
    }
    return false;
}
项目:TheNounProject    文件:BaseSearchFragment.java   
private void setupSearchView(MenuItem searchItem) {
    if (searchItem != null) {
        MenuItemCompat.setOnActionExpandListener(searchItem, this);
        SearchManager searchManager = (SearchManager) (getActivity()
                .getSystemService(Context.SEARCH_SERVICE));
        searchView = (SearchView) searchItem.getActionView();
        if (searchView != null) {
            searchView.setSearchableInfo(searchManager
                    .getSearchableInfo(getActivity().getComponentName()));
            searchView.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
            searchView.clearFocus();
            searchView.setOnQueryTextListener(this);
            setupSearchOptions(searchView);
        }
    }
}
项目:AOSP-Kayboard-7.1.2    文件:EditorInfoCompatUtils.java   
public static String imeActionName(final int imeOptions) {
    final int actionId = imeOptions & EditorInfo.IME_MASK_ACTION;
    switch (actionId) {
    case EditorInfo.IME_ACTION_UNSPECIFIED:
        return "actionUnspecified";
    case EditorInfo.IME_ACTION_NONE:
        return "actionNone";
    case EditorInfo.IME_ACTION_GO:
        return "actionGo";
    case EditorInfo.IME_ACTION_SEARCH:
        return "actionSearch";
    case EditorInfo.IME_ACTION_SEND:
        return "actionSend";
    case EditorInfo.IME_ACTION_NEXT:
        return "actionNext";
    case EditorInfo.IME_ACTION_DONE:
        return "actionDone";
    case EditorInfo.IME_ACTION_PREVIOUS:
        return "actionPrevious";
    default:
        return "actionUnknown(" + actionId + ")";
    }
}
项目:PeSanKita-android    文件:ComposeText.java   
public void setTransport(TransportOption transport) {
  final boolean useSystemEmoji = TextSecurePreferences.isSystemEmojiPreferred(getContext());

  int imeOptions = (getImeOptions() & ~EditorInfo.IME_MASK_ACTION) | EditorInfo.IME_ACTION_SEND;
  int inputType  = getInputType();

  if (isLandscape()) setImeActionLabel(transport.getComposeHint(), EditorInfo.IME_ACTION_SEND);
  else               setImeActionLabel(null, 0);

  if (useSystemEmoji) {
    inputType = (inputType & ~InputType.TYPE_MASK_VARIATION) | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
  }

  setInputType(inputType);
  setImeOptions(imeOptions);
  setHint(transport.getComposeHint(),
          transport.getSimName().isPresent()
              ? getContext().getString(R.string.conversation_activity__from_sim_name, transport.getSimName().get())
              : null);
}
项目:EosCommander    文件:TransferFragment.java   
@Override
protected void setUpView(View view) {

    //  from, to, amount edit text
    mEtFrom = view.findViewById(R.id.et_from);
    mEtTo = view.findViewById(R.id.et_to);
    mEtAmount = view.findViewById(R.id.et_amount);

    // click handler
    view.findViewById(R.id.btn_transfer).setOnClickListener(v -> onSend() );

    mEtAmount.setOnEditorActionListener((textView, actionId, keyEvent) -> {
        if (EditorInfo.IME_ACTION_SEND == actionId) {
            onSend();
            return true;
        }

        return false;
    });


    UiUtils.setupAccountHistory( mEtFrom, mEtTo );
}
项目:IdeaTrackerPlus    文件:MainActivity.java   
@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;
}
项目:NeoStream    文件:SearchFragment.java   
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_search, container, false);

    ((EditText)view.findViewById(R.id.searchEditText)).setOnEditorActionListener(
            new EditText.OnEditorActionListener() {
                @Override
                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                    if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || (event != null && (
                            event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER))) {

                            search();
                            return true;
                    }
                    return false;
                }
            });

    changeFilter(null, Filter.CHANNEL, view);

    return view;
}
项目:ROKOmoji.Emoji.Keyboard.App-Android    文件:KeyboardService.java   
private boolean isCommitContentSupported(@Nullable EditorInfo editorInfo, @NonNull String mimeType) {
    if (editorInfo == null) {
        return false;
    }

    final InputConnection ic = getCurrentInputConnection();
    if (ic == null) {
        return false;
    }

    if (!validatePackageName(editorInfo)) {
        return false;
    }

    final String[] supportedMimeTypes = EditorInfoCompat.getContentMimeTypes(editorInfo);
    for (String supportedMimeType : supportedMimeTypes) {
        if (ClipDescription.compareMimeTypes(mimeType, supportedMimeType)) {
            return true;
        }
    }
    return false;
}
项目:AOSP-Kayboard-7.1.2    文件:AccessibilityUtils.java   
/**
 * Returns whether the device should obscure typed password characters.
 * Typically this means speaking "dot" in place of non-control characters.
 *
 * @return {@code true} if the device should obscure password characters.
 */
@SuppressWarnings("deprecation")
public boolean shouldObscureInput(final EditorInfo editorInfo) {
    if (editorInfo == null) return false;

    // The user can optionally force speaking passwords.
    if (SettingsSecureCompatUtils.ACCESSIBILITY_SPEAK_PASSWORD != null) {
        final boolean speakPassword = Settings.Secure.getInt(mContext.getContentResolver(),
                SettingsSecureCompatUtils.ACCESSIBILITY_SPEAK_PASSWORD, 0) != 0;
        if (speakPassword) return false;
    }

    // Always speak if the user is listening through headphones.
    if (mAudioManager.isWiredHeadsetOn() || mAudioManager.isBluetoothA2dpOn()) {
        return false;
    }

    // Don't speak if the IME is connected to a password field.
    return InputTypeUtils.isPasswordInputType(editorInfo.inputType);
}
项目:BittrexApi    文件:AuthenticationActivity.java   
@Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
    final int id = textView.getId();
    switch (id) {
        case R.id.key_edittext:
            if (actionId == EditorInfo.IME_ACTION_NEXT) {
                _secretEditText.requestFocus();
            }

            return true;
        case R.id.secret_edittext:
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                updateAuthenticationSettings();
            }

            return true;
    }

    return false;
}
项目:microbit    文件:ProjectAdapter.java   
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    logi("onEditorAction() :: currentEditableRow=" + currentEditableRow);

    int pos = (int) v.getTag(R.id.positionId);
    Project project = mProjects.get(pos);
    project.inEditMode = false;
    currentEditableRow = -1;

    if(actionId == EditorInfo.IME_ACTION_DONE) {
        dismissKeyBoard(v, true, true);
    } else if(actionId == -1) {
        dismissKeyBoard(v, true, false);
    }

    return true;
}
项目:chat-sdk-android-push-firebase    文件:DialogUtils.java   
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (EditorInfo.IME_ACTION_DONE == actionId) {
        if (mEditText.getText().toString().isEmpty())
        {
            SuperToast toast = chatSDKUiHelper.getAlertToast();
            toast.setGravity(Gravity.TOP, 0, 0);
            toast.setText("Please enter chat name");
            toast.show();
            return true;
        }

        InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(
                Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(mEditText.getWindowToken(), 0);

        // Return input text to activity
        listener.onFinished(mEditText.getText().toString());
        this.dismiss();
        return true;
    }
    return false;
}
项目:simple-keyboard    文件:EditorInfoCompatUtils.java   
public static String imeActionName(final int imeOptions) {
    final int actionId = imeOptions & EditorInfo.IME_MASK_ACTION;
    switch (actionId) {
    case EditorInfo.IME_ACTION_UNSPECIFIED:
        return "actionUnspecified";
    case EditorInfo.IME_ACTION_NONE:
        return "actionNone";
    case EditorInfo.IME_ACTION_GO:
        return "actionGo";
    case EditorInfo.IME_ACTION_SEARCH:
        return "actionSearch";
    case EditorInfo.IME_ACTION_SEND:
        return "actionSend";
    case EditorInfo.IME_ACTION_NEXT:
        return "actionNext";
    case EditorInfo.IME_ACTION_DONE:
        return "actionDone";
    case EditorInfo.IME_ACTION_PREVIOUS:
        return "actionPrevious";
    default:
        return "actionUnknown(" + actionId + ")";
    }
}
项目:SimpleDialogFragments    文件:TextInputAutoCompleteTextView.java   
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    final InputConnection ic = super.onCreateInputConnection(outAttrs);
    if (ic != null && outAttrs.hintText == null) {
        // If we don't have a hint and our parent is a TextInputLayout, use it's hint for the
        // EditorInfo. This allows us to display a hint in 'extract mode'.
        ViewParent parent = getParent();
        while (parent instanceof View) {
            if (parent instanceof TextInputLayout) {
                outAttrs.hintText = ((TextInputLayout) parent).getHint();
                break;
            }
            parent = parent.getParent();
        }
    }
    return ic;
}
项目:AOSP-Kayboard-7.1.2    文件:LatinIME.java   
public void onStartInputView(final EditorInfo editorInfo, final boolean restarting) {
    if (hasMessages(MSG_PENDING_IMS_CALLBACK)
            && KeyboardId.equivalentEditorInfoForKeyboard(editorInfo, mAppliedEditorInfo)) {
        // Typically this is the second onStartInputView after orientation changed.
        resetPendingImsCallback();
    } else {
        if (mPendingSuccessiveImsCallback) {
            // This is the first onStartInputView after orientation changed.
            mPendingSuccessiveImsCallback = false;
            resetPendingImsCallback();
            sendMessageDelayed(obtainMessage(MSG_PENDING_IMS_CALLBACK),
                    PENDING_IMS_CALLBACK_DURATION_MILLIS);
        }
        final LatinIME latinIme = getOwnerInstance();
        if (latinIme != null) {
            executePendingImsCallback(latinIme, editorInfo, restarting);
            latinIme.onStartInputViewInternal(editorInfo, restarting);
            mAppliedEditorInfo = editorInfo;
        }
        cancelDeallocateMemory();
    }
}
项目:Android-Scrapper    文件:GridSettingFragment.java   
@OnClick(R.id.editName)
protected void editName() {
    animationAtStart();
    InputMethodManager inputMethodManager =
            (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.toggleSoftInputFromWindow(
            mGridName.getApplicationWindowToken(),
            InputMethodManager.SHOW_FORCED, 0);
    mGridName.requestFocus();
    mGridName.moveCursorToVisibleOffset();
    mGridName.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                mGridSettingPresenter.setGridName(mGridName.getText().toString());
                changeListener.nameChanged(String.valueOf(mGrid.getId()), mGridName.getText().toString());
                animationAtEnd();
                return true;
            }
            return false;
        }

    });
}
项目:SWDemo    文件:ChatActivity.java   
private void showMessageEditContainer() {
    findViewById(R.id.bottom_action_container).setVisibility(View.GONE);
    findViewById(R.id.bottom_action_end_call).setVisibility(View.GONE);
    findViewById(R.id.msg_input_container).setVisibility(View.VISIBLE);

    EditText edit = (EditText) findViewById(R.id.msg_content);

    edit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_SEND
                    || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
                String msgStr = v.getText().toString();
                if (TextUtils.isEmpty(msgStr)) {
                    return false;
                }
                sendChannelMsg(msgStr);

                v.setText("");

                Message msg = new Message(Message.MSG_TYPE_TEXT,
                        new User(config().mUid, String.valueOf(config().mUid)), msgStr);
                notifyMessageChanged(msg);

                return true;
            }
            return false;
        }
    });

    openIME(edit);
}
项目:Anagram    文件:AnagramsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_anagrams);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    AssetManager assetManager = getAssets();
    try {
        InputStream inputStream = assetManager.open("words.txt");
        dictionary = new AnagramDictionary(new InputStreamReader(inputStream));
    } catch (IOException e) {
        Toast toast = Toast.makeText(this, "Could not load dictionary", Toast.LENGTH_LONG);
        toast.show();
    }
    // Set up the EditText box to process the content of the box when the user hits 'enter'
    final EditText editText = (EditText) findViewById(R.id.editText);
    editText.setRawInputType(InputType.TYPE_CLASS_TEXT);
    editText.setImeOptions(EditorInfo.IME_ACTION_GO);
    editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            boolean handled = false;
            if (actionId == EditorInfo.IME_ACTION_GO) {
                processWord(editText);
                handled = true;
            }
            return handled;
        }
    });
}
项目:Auto.js    文件:CodeMirrorEditor.java   
private void setupWebView() {
    mWebView = new WebView(getContext()) {
        @Override
        public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
            InputConnection connection = super.onCreateInputConnection(outAttrs);
            return connection == null ? null : new MyInputConnection(connection);
        }
    };
    setupWebSettings();
    mWebView.addJavascriptInterface(mJavaScriptBridge, "__bridge__");
    addView(mWebView);
}
项目:FanChat    文件:AddFriendActivity.java   
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_SEARCH) {
        searchFriend();
        return true;
    }
    return false;
}
项目:GitHub    文件:PoiAroundSearchActivity.java   
private void setup() {
    mSearchText = (AutoCompleteTextView) findViewById(R.id.etInput);
    mSearchText.addTextChangedListener(this);
    mSearchText.setHint(getString(R.string.search_map));
    findViewById(R.id.search_back).setOnClickListener(view -> {
        finish();
    });
    mSearchText.setOnEditorActionListener((textView, i, keyEvent) -> {
        if (i == EditorInfo.IME_ACTION_SEARCH) {
            doSearch();
        }
        return false;
    });
}
项目:AOSP-Kayboard-7.1.2    文件:EditorInfoCompatUtils.java   
public static Locale getPrimaryHintLocale(final EditorInfo editorInfo) {
    if (editorInfo == null) {
        return null;
    }
    final Object localeList = CompatUtils.getFieldValue(editorInfo, null, FIELD_HINT_LOCALES);
    if (localeList == null) {
        return null;
    }
    if (LocaleListCompatUtils.isEmpty(localeList)) {
        return null;
    }
    return LocaleListCompatUtils.get(localeList, 0);
}
项目:behe-keyboard    文件:PCKeyboard.java   
/**
 * Helper to update the shift state of our keyboard based on the initial
 * editor state.
 */
private void updateShiftKeyState(EditorInfo attr) {
    if (attr != null
            && mInputView != null && mQwertyKeyboard == mInputView.getKeyboard()) {
        int caps = 0;
        EditorInfo ei = getCurrentInputEditorInfo();
        if (ei != null && ei.inputType != InputType.TYPE_NULL) {
            caps = getCurrentInputConnection().getCursorCapsMode(attr.inputType);
        }
        mInputView.setShifted(mCapsLock || caps != 0);
    }
}
项目:EditCodeView    文件:EditCodeView.java   
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {

    outAttrs.inputType = InputType.TYPE_CLASS_NUMBER;
    outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
    outAttrs.initialSelStart = 0;

    return editCodeInputConnection;
}
项目:RNLearn_Project1    文件:ReactEditText.java   
private void updateImeOptions() {
  // Default to IME_ACTION_DONE
  int returnKeyFlag = EditorInfo.IME_ACTION_DONE;
  if (mReturnKeyType != null) {
    switch (mReturnKeyType) {
      case "go":
        returnKeyFlag = EditorInfo.IME_ACTION_GO;
        break;
      case "next":
        returnKeyFlag = EditorInfo.IME_ACTION_NEXT;
        break;
      case "none":
        returnKeyFlag = EditorInfo.IME_ACTION_NONE;
        break;
      case "previous":
        returnKeyFlag = EditorInfo.IME_ACTION_PREVIOUS;
        break;
      case "search":
        returnKeyFlag = EditorInfo.IME_ACTION_SEARCH;
        break;
      case "send":
        returnKeyFlag = EditorInfo.IME_ACTION_SEND;
        break;
      case "done":
        returnKeyFlag = EditorInfo.IME_ACTION_DONE;
        break;
    }
  }

  if (mDisableFullscreen) {
    setImeOptions(returnKeyFlag | EditorInfo.IME_FLAG_NO_FULLSCREEN);
  } else {
    setImeOptions(returnKeyFlag);
  }
}
项目:DateTimePicker    文件:NumberPicker.java   
@Override
public void onEditorAction(int actionCode) {
    super.onEditorAction(actionCode);
    if (actionCode == EditorInfo.IME_ACTION_DONE) {
        clearFocus();
    }
}
项目:microMathematics    文件:CustomEditText.java   
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs)
{
    try
    {
        return new TermInputConnection(super.onCreateInputConnection(outAttrs), true);
    }
    catch (StackOverflowError ex)
    {
        // the StackOverflowError in this procedure was observed on Alcatel OT (android version 10)
        return null;
    }
}
项目:myan    文件:SmartMyan.java   
@Override
public void onStartInputView(EditorInfo attribute, boolean restarting) {
    super.onStartInputView(attribute, restarting);
    //applying the selected keyboard to the input view
    setSmKeyboard(mCurKeyboard);
    mInputView.closing();
    final InputMethodSubtype subtype = mInputMethodManager.getCurrentInputMethodSubtype();
    mCurKeyboard.setSubtypeOnSpaceKey(getString(subtype.getNameResId()), getResources().getDrawable(R.drawable.sym_keyboard_space));
}
项目:TPlayer    文件:MethodProxies.java   
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    int editorInfoIndex = ArrayUtils.indexOfFirst(args, EditorInfo.class);
    if (editorInfoIndex != -1) {
        EditorInfo attribute = (EditorInfo) args[editorInfoIndex];
        attribute.packageName = getHostPkg();
    }
    return method.invoke(who, args);
}
项目:TodoRealm    文件:EditActionViewHolder.java   
@OnEditorAction(R.id.edit_text_view)
boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_DONE) {
        menuItem.collapseActionView();
        KeyboardUtils.hideKeyboard(view.getContext(), view);
        return true;
    }
    return false;
}
项目:chips-input-layout    文件:ChipEditText.java   
/**
 * Used to detect IME option press on any type of input method.
 */
@Override
public void onEditorAction(int actionCode) {
    if (keyboardListener != null && actionCode == EditorInfo.IME_ACTION_DONE) {
        this.keyboardListener.onKeyboardActionDone(getText().toString());
    }
    super.onEditorAction(actionCode);
}
项目:LaunchEnr    文件:Folder.java   
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_DONE) {
        mFolderName.dispatchBackKey();
        return true;
    }
    return false;
}
项目:EosCommander    文件:PushFragment.java   
@Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
    if (EditorInfo.IME_ACTION_SEND == actionId) {
        onPushAction();
        return true;
    }
    else
    if ( (EditorInfo.IME_ACTION_SEARCH == actionId ) && ( textView.getId() == R.id.et_contract_account) ){
        onContractEntered( mEtContract.getText().toString());
    }

    return false;
}
项目:RNLearn_Project1    文件:ReactEditText.java   
private void updateImeOptions() {
  // Default to IME_ACTION_DONE
  int returnKeyFlag = EditorInfo.IME_ACTION_DONE;
  if (mReturnKeyType != null) {
    switch (mReturnKeyType) {
      case "go":
        returnKeyFlag = EditorInfo.IME_ACTION_GO;
        break;
      case "next":
        returnKeyFlag = EditorInfo.IME_ACTION_NEXT;
        break;
      case "none":
        returnKeyFlag = EditorInfo.IME_ACTION_NONE;
        break;
      case "previous":
        returnKeyFlag = EditorInfo.IME_ACTION_PREVIOUS;
        break;
      case "search":
        returnKeyFlag = EditorInfo.IME_ACTION_SEARCH;
        break;
      case "send":
        returnKeyFlag = EditorInfo.IME_ACTION_SEND;
        break;
      case "done":
        returnKeyFlag = EditorInfo.IME_ACTION_DONE;
        break;
    }
  }

  if (mDisableFullscreen) {
    setImeOptions(returnKeyFlag | EditorInfo.IME_FLAG_NO_FULLSCREEN);
  } else {
    setImeOptions(returnKeyFlag);
  }
}
项目:Goalie_Android    文件:LoginFragment.java   
private EditText.OnEditorActionListener handleEditorAction() {
    return new EditText.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent keyEvent) {
            if (actionId == EditorInfo.IME_ACTION_DONE && getView() != null) {
                mServerMsg.setVisibility(View.GONE);
                mPresenter.register(getActivity(), mUsername.getText().toString());
                return true;
            }
            return false;
        }
    };
}
项目:AndroidGithubIssues    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mViewModel = ViewModelProviders.of(this).get(ListIssuesViewModel.class);
    setupView();

    mSearchEditText.setOnEditorActionListener((TextView v, int actionId, KeyEvent event) -> {
        if (actionId == EditorInfo.IME_ACTION_SEARCH) {
            String repo = mSearchEditText.getText().toString();
            if (repo.length() > 0) {
                String[] query = repo.split("/");
                if (query.length == 2) {
                    hideSoftKeyboard(MainActivity.this, v);
                    setProgress(true);
                    mViewModel.loadIssues(query[0], query[1]);
                } else {
                    handleError(new Exception(
                            "Error wrong format of input. Required format owner/repository_name")
                    );
                }
            } else {
                handleError(new Exception(
                        "Repository name empty. Required format owner/repository_name")
                );
            }
            return true;
        }
        return false;
    });

    // Handle changes emitted by LiveData
    mViewModel.getApiResponse().observe(this, apiResponse -> {
        if (apiResponse.getError() != null) {
            handleError(apiResponse.getError());
        } else {
            handleResponse(apiResponse.getIssues());
        }
    });
}
项目:myan    文件:SmartMyan.java   
private void updateShiftKeyState(EditorInfo attr) {
    if (attr != null && mInputView != null && enKeyboard == mInputView.getKeyboard()) {
        int caps = 0;
        EditorInfo ei = getCurrentInputEditorInfo();
        if (ei != null && ei.inputType != InputType.TYPE_NULL) {
            caps = getCurrentInputConnection().getCursorCapsMode(attr.inputType);
        }
        mInputView.setShifted(mCapsLock || caps != 0);
    }
}
项目:keepass2android    文件:KP2AKeyboard.java   
private boolean commitTextForKey(final EditorInfo attribute, String key) {
    List<StringForTyping> availableFields = keepass2android.kbbridge.KeyboardData.availableFields;
    for (StringForTyping str: availableFields)
    {
        if (str.key.equals(key))
        {
            Log.d("KP2AK", "Typing!");
            commitKp2aString(str.value, attribute);
            return true;
        }
    }
    return false;
}