当前位置: 首页>>代码示例>>Java>>正文


Java EditorInfo.IME_FLAG_NO_ENTER_ACTION属性代码示例

本文整理汇总了Java中android.view.inputmethod.EditorInfo.IME_FLAG_NO_ENTER_ACTION属性的典型用法代码示例。如果您正苦于以下问题:Java EditorInfo.IME_FLAG_NO_ENTER_ACTION属性的具体用法?Java EditorInfo.IME_FLAG_NO_ENTER_ACTION怎么用?Java EditorInfo.IME_FLAG_NO_ENTER_ACTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.view.inputmethod.EditorInfo的用法示例。


在下文中一共展示了EditorInfo.IME_FLAG_NO_ENTER_ACTION属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateInputConnection

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
	outAttrs.imeOptions |=
		EditorInfo.IME_FLAG_NO_EXTRACT_UI |
		EditorInfo.IME_FLAG_NO_ENTER_ACTION |
		EditorInfo.IME_ACTION_NONE;
	outAttrs.inputType = EditorInfo.TYPE_NULL;
	return new BaseInputConnection(this, false) {
		@Override
		public boolean deleteSurroundingText (int leftLength, int rightLength) {
			if (rightLength == 0 && leftLength == 0) {
				return this.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL));
			}
			for (int i = 0; i < leftLength; i++) {
				this.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL));
			}
			// TODO: forward delete
			return true;
		}
	};
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:TerminalView.java

示例2: imeOptionsName

public static String imeOptionsName(final int imeOptions) {
    final String action = imeActionName(imeOptions);
    final StringBuilder flags = new StringBuilder();
    if ((imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) {
        flags.append("flagNoEnterAction|");
    }
    if ((imeOptions & EditorInfo.IME_FLAG_NAVIGATE_NEXT) != 0) {
        flags.append("flagNavigateNext|");
    }
    if ((imeOptions & EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS) != 0) {
        flags.append("flagNavigatePrevious|");
    }
    if (hasFlagForceAscii(imeOptions)) {
        flags.append("flagForceAscii|");
    }
    return (action != null) ? flags + action : flags.toString();
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:17,代码来源:EditorInfoCompatUtils.java

示例3: commitKp2aString

private void commitKp2aString(String value, EditorInfo editorInfo) {
	//getCurrentInputConnection().commitText(value, 0);
	onText(value);

	if ((editorInfo.imeOptions&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) == EditorInfo.IME_ACTION_NEXT)
	{
		Log.d("KP2AK", "action is NEXT ");
		getCurrentInputConnection().performEditorAction(EditorInfo.IME_ACTION_NEXT);
	}
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:10,代码来源:KP2AKeyboard.java

示例4: onCreateInputConnection

@Override
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
  InputConnection inputConnection = super.onCreateInputConnection(editorInfo);

  if(TextSecurePreferences.isEnterSendsEnabled(getContext())) {
    editorInfo.imeOptions &= ~EditorInfo.IME_FLAG_NO_ENTER_ACTION;
  }

  if (Build.VERSION.SDK_INT < 21) return inputConnection;
  if (mediaListener == null)      return inputConnection;
  if (inputConnection == null)    return null;

  EditorInfoCompat.setContentMimeTypes(editorInfo, new String[] {"image/jpeg", "image/png", "image/gif"});
  return InputConnectionCompat.createWrapper(inputConnection, editorInfo, new CommitContentListener(mediaListener));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:15,代码来源:ComposeText.java

示例5: getImeOptionsActionIdFromEditorInfo

public static int getImeOptionsActionIdFromEditorInfo(final EditorInfo editorInfo) {
    if ((editorInfo.imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) {
        return EditorInfo.IME_ACTION_NONE;
    } else if (editorInfo.actionLabel != null) {
        return IME_ACTION_CUSTOM_LABEL;
    } else {
        // Note: this is different from editorInfo.actionId, hence "ImeOptionsActionId"
        return editorInfo.imeOptions & EditorInfo.IME_MASK_ACTION;
    }
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:10,代码来源:InputTypeUtils.java

示例6: setImeOptions

/**
 * This looks at the ime options given by the current editor, to set the
 * appropriate label on the keyboard's enter key (if it has one).
 */
void setImeOptions(Resources res, int options) {
    if (mEnterKey == null) {
        return;
    }

    switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
        case EditorInfo.IME_ACTION_GO:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = "ENT";
            break;
        case EditorInfo.IME_ACTION_NEXT:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = "N";
            break;
        case EditorInfo.IME_ACTION_SEARCH:
          //  mEnterKey.icon = "K";
            mEnterKey.label = null;
            break;
        case EditorInfo.IME_ACTION_SEND:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = "HH";
            break;
        default:
         //   mEnterKey.icon = "U";
            mEnterKey.label = null;
            break;
    }
}
 
开发者ID:VladThodo,项目名称:behe-keyboard,代码行数:35,代码来源:LatinKeyboard.java

示例7: setImeOptions

/**
 * This looks at the ime options given by the current editor, to set the
 * appropriate label on the keyboard's enter key (if it has one).
 */
void setImeOptions(Resources res, int options) {
    if (mEnterKey == null) {
        return;
    }

    int valnorm = KeyEvent.KEYCODE_ENTER;

    switch (options & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
        case EditorInfo.IME_ACTION_GO:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.codes = NORMAL_ENTER;
            mEnterKey.label = res.getText(R.string.label_go_key);
            break;
        case EditorInfo.IME_ACTION_NEXT:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.codes = NORMAL_ENTER;
            mEnterKey.label = res.getText(R.string.label_next_key);
            break;
        case EditorInfo.IME_ACTION_SEARCH:
            mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_search);
            mEnterKey.codes = NORMAL_ENTER;
            mEnterKey.label = null;
            break;
        case EditorInfo.IME_ACTION_SEND:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.codes = NORMAL_ENTER;
            mEnterKey.label = res.getText(R.string.label_send_key);
            break;
        default:
            mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_return);
            mEnterKey.label = null;
            mEnterKey.codes = TERMINAL_ENTER;
            break;
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:42,代码来源:LatinKeyboard.java

示例8: setImeOptions

/**
 * This looks at the ime options given by the current editor, to set the
 * appropriate label on the keyboard's enter key (if it has one).
 */
void setImeOptions(Context context, int options) {
    if (mEnterKey == null) {
        return;
    }

    switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
        case EditorInfo.IME_ACTION_GO:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = context.getResources().getText(R.string.label_go_key);
            break;
        case EditorInfo.IME_ACTION_NEXT:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = context.getResources().getText(R.string.label_next_key);
            break;
        case EditorInfo.IME_ACTION_SEARCH:
            mEnterKey.icon = ContextCompat.getDrawable(context, R.drawable.sym_keyboard_search);
            mEnterKey.label = null;
            break;
        case EditorInfo.IME_ACTION_SEND:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = context.getResources().getText(R.string.label_send_key);
            break;
        default:
            mEnterKey.icon = ContextCompat.getDrawable(context, R.drawable.sym_keyboard_return);
            mEnterKey.label = null;
            break;
    }
}
 
开发者ID:cdjalel,项目名称:QuranKeyboard,代码行数:35,代码来源:ArabicKeyboard.java

示例9: setImeOptions

void setImeOptions(Resources res, int options) {
    if (mEnterKey == null) {
        return;
    }

    switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
        case EditorInfo.IME_ACTION_GO:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = res.getText(R.string.label_go_key);
            break;
        case EditorInfo.IME_ACTION_NEXT:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = res.getText(R.string.label_next_key);
            break;
        case EditorInfo.IME_ACTION_SEARCH:
            mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_search);
            mEnterKey.label = null;
            break;
        case EditorInfo.IME_ACTION_SEND:
            mEnterKey.iconPreview = null;
            mEnterKey.icon = null;
            mEnterKey.label = res.getText(R.string.label_send_key);
            break;
        default:
            mEnterKey.icon = res.getDrawable(R.drawable.sym_keyboard_return);
            mEnterKey.label = null;
            break;
    }
}
 
开发者ID:YehtutHl,项目名称:myan,代码行数:31,代码来源:smKeyboard.java

示例10: onStartInputView

@Override
public void onStartInputView(EditorInfo attribute, boolean restarting) {
    LatinKeyboardView inputView = mKeyboardSwitcher.getInputView();
    // In landscape mode, this method gets called without the input view being created.
    if (inputView == null) {
        return;
    }
    
    loadSettings();

    if (mRefreshKeyboardRequired) {
        mRefreshKeyboardRequired = false;
        toggleLanguage(true, true);
    }

    mKeyboardSwitcher.makeKeyboards(false);

    TextEntryState.newSession(this);
    
    updateKeyboardMode(attribute);
    inputView.closing();
    mComposing.setLength(0);
    mPredicting = false;
    mDeleteCount = 0;
    mJustAddedAutoSpace = false;
    mIsSendGoDone = ((attribute.imeOptions&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) == EditorInfo.IME_ACTION_GO)
    		|| ((attribute.imeOptions&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) == EditorInfo.IME_ACTION_DONE)
    		|| ((attribute.imeOptions&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) == EditorInfo.IME_ACTION_SEND);

    updateShiftKeyState(attribute);

    setCandidatesViewShownInternal(isCandidateStripVisible() || mCompletionOn,
            false /* needsInputViewShown */ );
    updateSuggestions();

    // If the dictionary is not big enough, don't auto correct
    mHasDictionary = mSuggest.hasMainDictionary();
    Log.d("KP2AK", "has main dict: " + mHasDictionary);

    updateCorrectionMode();

    inputView.setPreviewEnabled(mPopupOn);
    inputView.setProximityCorrectionEnabled(true);
    mPredictionOn = mPredictionOn && (mCorrectionMode > 0 || mShowSuggestions);
    // If we just entered a text field, maybe it has some old text that requires correction
    checkReCorrectionOnStart();
    
    tryKp2aAutoFill(attribute);
    
    if (TRACE) Debug.startMethodTracing("/data/trace/latinime");
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:51,代码来源:KP2AKeyboard.java

示例11: setImeOptions

void setImeOptions(Resources res, int mode, int options) {
    mMode = mode;
    // TODO should clean up this method
    if (mEnterKey != null) {
        // Reset some of the rarely used attributes.
        mEnterKey.popupCharacters = null;
        mEnterKey.popupResId = 0;
        mEnterKey.text = null;
        switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
            case EditorInfo.IME_ACTION_GO:
                mEnterKey.iconPreview = null;
                mEnterKey.icon = null;
                mEnterKey.label = res.getText(R.string.label_go_key);
                break;
            case EditorInfo.IME_ACTION_NEXT:
                mEnterKey.iconPreview = null;
                mEnterKey.icon = null;
                mEnterKey.label = res.getText(R.string.label_next_key);
                break;
            case EditorInfo.IME_ACTION_DONE:
                mEnterKey.iconPreview = null;
                mEnterKey.icon = null;
                mEnterKey.label = res.getText(R.string.label_done_key);
                break;
            case EditorInfo.IME_ACTION_SEARCH:
                mEnterKey.iconPreview = res.getDrawable(
                        R.drawable.sym_keyboard_feedback_search);
                mEnterKey.icon = res.getDrawable(mIsBlackSym ?
                        R.drawable.sym_bkeyboard_search : R.drawable.sym_keyboard_search);
                mEnterKey.label = null;
                break;
            case EditorInfo.IME_ACTION_SEND:
                mEnterKey.iconPreview = null;
                mEnterKey.icon = null;
                mEnterKey.label = res.getText(R.string.label_send_key);
                break;
            default:
                if (mode == KeyboardSwitcher.MODE_IM) {
                    mEnterKey.icon = mHintIcon;
                    mEnterKey.iconPreview = null;
                    mEnterKey.label = ":-)";
                    mEnterKey.text = ":-) ";
                    mEnterKey.popupResId = R.xml.popup_smileys;
                } else {
                    mEnterKey.iconPreview = res.getDrawable(
                            R.drawable.sym_keyboard_feedback_return);
                    mEnterKey.icon = res.getDrawable(mIsBlackSym ?
                            R.drawable.sym_bkeyboard_return : R.drawable.sym_keyboard_return);
                    mEnterKey.label = null;
                }
                break;
        }
        // Set the initial size of the preview icon
        if (mEnterKey.iconPreview != null) {
            setDefaultBounds(mEnterKey.iconPreview);
        }
    }
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:58,代码来源:LatinKeyboard.java


注:本文中的android.view.inputmethod.EditorInfo.IME_FLAG_NO_ENTER_ACTION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。