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


Java InputType.TYPE_NULL属性代码示例

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


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

示例1: updateShiftKeyState

/**
 * 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);
    }
}
 
开发者ID:VladThodo,项目名称:behe-keyboard,代码行数:15,代码来源:PCKeyboard.java

示例2: getInputType

private int getInputType(String type) {
  int inputType;
  switch (type) {
    case Constants.Value.TEXT:
      inputType = InputType.TYPE_CLASS_TEXT;
      break;
    case Constants.Value.DATE:
      inputType = InputType.TYPE_NULL;
      getHostView().setFocusable(false);
      break;
    case Constants.Value.DATETIME:
      inputType = InputType.TYPE_CLASS_DATETIME;
      break;
    case Constants.Value.EMAIL:
      inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
      break;
    case Constants.Value.PASSWORD:
      inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;
      getHostView().setTransformationMethod(PasswordTransformationMethod.getInstance());
      break;
    case Constants.Value.TEL:
      inputType = InputType.TYPE_CLASS_PHONE;
      break;
    case Constants.Value.TIME:
      inputType = InputType.TYPE_NULL;
      getHostView().setFocusable(false);
      break;
    case Constants.Value.URL:
      inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI;
      break;
    case Constants.Value.NUMBER:
      inputType = InputType.TYPE_CLASS_NUMBER;
      break;
    default:
      inputType = InputType.TYPE_CLASS_TEXT;
  }
  return inputType;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:38,代码来源:AbstractEditComponent.java

示例3: updateShiftKeyState

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);
    }
}
 
开发者ID:YehtutHl,项目名称:myan,代码行数:10,代码来源:SmartMyan.java

示例4: getInputType

private int getInputType(String type) {
  int inputType;
  switch (type) {
    case Constants.Value.TEXT:
      inputType = InputType.TYPE_CLASS_TEXT;
      break;
    case Constants.Value.DATE:
      inputType = InputType.TYPE_NULL;
      getHostView().setFocusable(false);
      break;
    case Constants.Value.DATETIME:
      inputType = InputType.TYPE_CLASS_DATETIME;
      break;
    case Constants.Value.EMAIL:
      inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
      break;
    case Constants.Value.PASSWORD:
      inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;
      getHostView().setTransformationMethod(PasswordTransformationMethod.getInstance());
      break;
    case Constants.Value.TEL:
      inputType = InputType.TYPE_CLASS_PHONE;
      break;
    case Constants.Value.TIME:
      inputType = InputType.TYPE_NULL;
      getHostView().setFocusable(false);
      break;
    case Constants.Value.URL:
      inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI;
      break;
    default:
      inputType = InputType.TYPE_CLASS_TEXT;
  }
  return inputType;
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:35,代码来源:AbstractEditComponent.java

示例5: InputAttributes

public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode) {
    mTargetApplicationPackageName = null != editorInfo ? editorInfo.packageName : null;
    final int inputType = null != editorInfo ? editorInfo.inputType : 0;
    final int inputClass = inputType & InputType.TYPE_MASK_CLASS;
    mInputType = inputType;
    mIsPasswordField = InputTypeUtils.isPasswordInputType(inputType)
            || InputTypeUtils.isVisiblePasswordInputType(inputType);
    if (inputClass != InputType.TYPE_CLASS_TEXT) {
        // If we are not looking at a TYPE_CLASS_TEXT field, the following strange
        // cases may arise, so we do a couple sanity checks for them. If it's a
        // TYPE_CLASS_TEXT field, these special cases cannot happen, by construction
        // of the flags.
        if (null == editorInfo) {
            Log.w(TAG, "No editor info for this field. Bug?");
        } else if (InputType.TYPE_NULL == inputType) {
            // TODO: We should honor TYPE_NULL specification.
            Log.i(TAG, "InputType.TYPE_NULL is specified");
        } else if (inputClass == 0) {
            // TODO: is this check still necessary?
            Log.w(TAG, String.format("Unexpected input class: inputType=0x%08x"
                    + " imeOptions=0x%08x", inputType, editorInfo.imeOptions));
        }
        mShouldShowSuggestions = false;
        mInputTypeNoAutoCorrect = false;
        mApplicationSpecifiedCompletionOn = false;
        mShouldInsertSpacesAutomatically = false;
        return;
    }
    // inputClass == InputType.TYPE_CLASS_TEXT
    final int variation = inputType & InputType.TYPE_MASK_VARIATION;
    final boolean flagNoSuggestions =
            0 != (inputType & InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
    final boolean flagMultiLine =
            0 != (inputType & InputType.TYPE_TEXT_FLAG_MULTI_LINE);
    final boolean flagAutoCorrect =
            0 != (inputType & InputType.TYPE_TEXT_FLAG_AUTO_CORRECT);
    final boolean flagAutoComplete =
            0 != (inputType & InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);

    // TODO: Have a helper method in InputTypeUtils
    // Make sure that passwords are not displayed in {@link SuggestionStripView}.
    final boolean shouldSuppressSuggestions = mIsPasswordField
            || InputTypeUtils.isEmailVariation(variation)
            || InputType.TYPE_TEXT_VARIATION_URI == variation
            || InputType.TYPE_TEXT_VARIATION_FILTER == variation
            || flagNoSuggestions
            || flagAutoComplete;
    mShouldShowSuggestions = !shouldSuppressSuggestions;

    mShouldInsertSpacesAutomatically = InputTypeUtils.isAutoSpaceFriendlyType(inputType);

    // If it's a browser edit field and auto correct is not ON explicitly, then
    // disable auto correction, but keep suggestions on.
    // If NO_SUGGESTIONS is set, don't do prediction.
    // If it's not multiline and the autoCorrect flag is not set, then don't correct
    mInputTypeNoAutoCorrect =
            (variation == InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT && !flagAutoCorrect)
            || flagNoSuggestions
            || (!flagAutoCorrect && !flagMultiLine);

    mApplicationSpecifiedCompletionOn = flagAutoComplete && isFullscreenMode;
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:62,代码来源:InputAttributes.java

示例6: isTypeNull

public boolean isTypeNull() {
    return InputType.TYPE_NULL == mInputType;
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:3,代码来源:InputAttributes.java

示例7: onCreateInputConnection

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
	outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI;
	outAttrs.inputType = InputType.TYPE_NULL;
	return new IInputConnection();
}
 
开发者ID:chushi0,项目名称:CodeView,代码行数:6,代码来源:CodeView.java


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