當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。