當前位置: 首頁>>代碼示例>>Java>>正文


Java EditorInfo.IME_ACTION_NONE屬性代碼示例

本文整理匯總了Java中android.view.inputmethod.EditorInfo.IME_ACTION_NONE屬性的典型用法代碼示例。如果您正苦於以下問題:Java EditorInfo.IME_ACTION_NONE屬性的具體用法?Java EditorInfo.IME_ACTION_NONE怎麽用?Java EditorInfo.IME_ACTION_NONE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.view.inputmethod.EditorInfo的用法示例。


在下文中一共展示了EditorInfo.IME_ACTION_NONE屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: imeActionName

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 + ")";
    }
}
 
開發者ID:rkkr,項目名稱:simple-keyboard,代碼行數:23,代碼來源:EditorInfoCompatUtils.java

示例2: 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

示例3: handleNonFunctionalEvent

/**
 * Handle an event that is not a functional event.
 *
 * These events are generally events that cause input, but in some cases they may do other
 * things like trigger an editor action.
 *
 * @param event The event to handle.
 * @param inputTransaction The transaction in progress.
 */
private void handleNonFunctionalEvent(final Event event,
        final InputTransaction inputTransaction) {
    switch (event.mCodePoint) {
        case Constants.CODE_ENTER:
            final EditorInfo editorInfo = getCurrentInputEditorInfo();
            final int imeOptionsActionId =
                    InputTypeUtils.getImeOptionsActionIdFromEditorInfo(editorInfo);
            if (InputTypeUtils.IME_ACTION_CUSTOM_LABEL == imeOptionsActionId) {
                // Either we have an actionLabel and we should performEditorAction with
                // actionId regardless of its value.
                performEditorAction(editorInfo.actionId);
            } else if (EditorInfo.IME_ACTION_NONE != imeOptionsActionId) {
                // We didn't have an actionLabel, but we had another action to execute.
                // EditorInfo.IME_ACTION_NONE explicitly means no action. In contrast,
                // EditorInfo.IME_ACTION_UNSPECIFIED is the default value for an action, so it
                // means there should be an action and the app didn't bother to set a specific
                // code for it - presumably it only handles one. It does not have to be treated
                // in any specific way: anything that is not IME_ACTION_NONE should be sent to
                // performEditorAction.
                performEditorAction(imeOptionsActionId);
            } else {
                // No action label, and the action from imeOptions is NONE: this is a regular
                // enter key that should input a carriage return.
                handleNonSpecialCharacterEvent(event, inputTransaction);
            }
            break;
        default:
            handleNonSpecialCharacterEvent(event, inputTransaction);
            break;
    }
}
 
開發者ID:rkkr,項目名稱:simple-keyboard,代碼行數:40,代碼來源:InputLogic.java

示例4: 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

示例5: updateImeOptions

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);
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:35,代碼來源:ReactEditText.java

示例6: handleNonFunctionalEvent

/**
 * Handle an event that is not a functional event.
 *
 * These events are generally events that cause input, but in some cases they may do other
 * things like trigger an editor action.
 *
 * @param event The event to handle.
 * @param inputTransaction The transaction in progress.
 */
private void handleNonFunctionalEvent(final Event event,
        final InputTransaction inputTransaction,
        final LatinIME.UIHandler handler) {
    inputTransaction.setDidAffectContents();
    switch (event.mCodePoint) {
        case Constants.CODE_ENTER:
            final EditorInfo editorInfo = getCurrentInputEditorInfo();
            final int imeOptionsActionId =
                    InputTypeUtils.getImeOptionsActionIdFromEditorInfo(editorInfo);
            if (InputTypeUtils.IME_ACTION_CUSTOM_LABEL == imeOptionsActionId) {
                // Either we have an actionLabel and we should performEditorAction with
                // actionId regardless of its value.
                performEditorAction(editorInfo.actionId);
            } else if (EditorInfo.IME_ACTION_NONE != imeOptionsActionId) {
                // We didn't have an actionLabel, but we had another action to execute.
                // EditorInfo.IME_ACTION_NONE explicitly means no action. In contrast,
                // EditorInfo.IME_ACTION_UNSPECIFIED is the default value for an action, so it
                // means there should be an action and the app didn't bother to set a specific
                // code for it - presumably it only handles one. It does not have to be treated
                // in any specific way: anything that is not IME_ACTION_NONE should be sent to
                // performEditorAction.
                performEditorAction(imeOptionsActionId);
            } else {
                // No action label, and the action from imeOptions is NONE: this is a regular
                // enter key that should input a carriage return.
                handleNonSpecialCharacterEvent(event, inputTransaction, handler);
            }
            break;
        default:
            handleNonSpecialCharacterEvent(event, inputTransaction, handler);
            break;
    }
}
 
開發者ID:sergeychilingaryan,項目名稱:AOSP-Kayboard-7.1.2,代碼行數:42,代碼來源:InputLogic.java


注:本文中的android.view.inputmethod.EditorInfo.IME_ACTION_NONE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。