android.text.InputType#TYPE_NULL源码实例Demo

下面列出了android.text.InputType#TYPE_NULL 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: android_9.0.0_r45   文件: InputMethodService.java
/**
 * Called when the fullscreen-mode extracting editor info has changed,
 * to determine whether the extracting (extract text and candidates) portion
 * of the UI should be shown.  The standard implementation hides or shows
 * the extract area depending on whether it makes sense for the
 * current editor.  In particular, a {@link InputType#TYPE_NULL}
 * input type or {@link EditorInfo#IME_FLAG_NO_EXTRACT_UI} flag will
 * turn off the extract area since there is no text to be shown.
 */
public void onUpdateExtractingVisibility(EditorInfo ei) {
    if (ei.inputType == InputType.TYPE_NULL ||
            (ei.imeOptions&EditorInfo.IME_FLAG_NO_EXTRACT_UI) != 0) {
        // No reason to show extract UI!
        setExtractViewShown(false);
        return;
    }
    
    setExtractViewShown(true);
}
 
源代码2 项目: CreditCardEntry   文件: CreditEntryFieldBase.java
@Override
public InputConnection onCreateInputConnection(@NonNull EditorInfo outAttrs) {
	outAttrs.actionLabel = null;
	outAttrs.inputType = InputType.TYPE_NULL;
	outAttrs.imeOptions = EditorInfo.IME_ACTION_NONE;
	return new BackInputConnection(super.onCreateInputConnection(outAttrs));
}
 
源代码3 项目: FirefoxReality   文件: SingleEditSetting.java
private void initialize(Context aContext) {
    inflate(aContext, R.layout.setting_edit, this);

    mAudio = AudioEngine.fromContext(aContext);

    mDescriptionView = findViewById(R.id.setting_description);
    mDescriptionView.setText(mDescription);

    mText1 = findViewById(R.id.textValue1);
    mText1.setOnClickListener(mText1ClickListener);

    mEdit1 = findViewById(R.id.editValue1);
    mEdit1.setHighlightedTextColor(mHighlightedTextColor);
    mEdit1.setOnEditorActionListener(mInternalEditorActionListener);

    if (mMaxLength != 0) {
        mEdit1.setFilters(new InputFilter[]{
                new InputFilter.LengthFilter(mMaxLength)
        });
    }
    if (mInputType != InputType.TYPE_NULL) {
        mEdit1.setInputType(mInputType);
    }
    if (mWidth > 0) {
        mEdit1.setWidth((int)mWidth);
    }

    mButton = findViewById(R.id.settingButton);
    mButton.setOnClickListener(mInternalClickListener);
}
 
源代码4 项目: Game   文件: RSCBitmapSurfaceView.java
@Override
public InputConnection onCreateInputConnection(EditorInfo editorinfo) {
	BaseInputConnection bic = new BaseInputConnection(this, false);
	editorinfo.actionLabel = null;
	editorinfo.inputType = InputType.TYPE_NULL;
	editorinfo.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN;
	bic.finishComposingText();
	return bic;
}
 
源代码5 项目: ucar-weex-core   文件: AbstractEditComponent.java
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;
}
 
源代码6 项目: AndroidKeyboard   文件: SoftKeyboard.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);

        // Change Shift key icon - 2
        updateShiftIcon();
    }
}
 
源代码7 项目: weex-uikit   文件: AbstractEditComponent.java
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;
}
 
源代码8 项目: Indic-Keyboard   文件: InputAttributes.java
public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode,
        final String packageNameForPrivateImeOptions) {
    mEditorInfo = editorInfo;
    mPackageNameForPrivateImeOptions = packageNameForPrivateImeOptions;
    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;
        mShouldShowVoiceInputKey = false;
        mDisableGestureFloatingPreviewText = false;
        mIsGeneralTextInput = false;
        mNoLearning = 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);

    final boolean noMicrophone = mIsPasswordField
            || InputTypeUtils.isEmailVariation(variation)
            || InputType.TYPE_TEXT_VARIATION_URI == variation
            || hasNoMicrophoneKeyOption();
    mShouldShowVoiceInputKey = !noMicrophone;

    mDisableGestureFloatingPreviewText = InputAttributes.inPrivateImeOptions(
            mPackageNameForPrivateImeOptions, NO_FLOATING_GESTURE_PREVIEW, editorInfo);

    // 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;

    // If we come here, inputClass is always TYPE_CLASS_TEXT
    mIsGeneralTextInput = InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS != variation
            && InputType.TYPE_TEXT_VARIATION_PASSWORD != variation
            && InputType.TYPE_TEXT_VARIATION_PHONETIC != variation
            && InputType.TYPE_TEXT_VARIATION_URI != variation
            && InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD != variation
            && InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS != variation
            && InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD != variation;

    mNoLearning = (editorInfo.imeOptions & EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING) != 0;
}
 
源代码9 项目: android_9.0.0_r45   文件: TextKeyListener.java
public int getInputType() {
    return InputType.TYPE_NULL;
}
 
源代码10 项目: openboard   文件: InputAttributes.java
public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode,
        final String packageNameForPrivateImeOptions) {
    mEditorInfo = editorInfo;
    mPackageNameForPrivateImeOptions = packageNameForPrivateImeOptions;
    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;
        mShouldShowVoiceInputKey = false;
        mDisableGestureFloatingPreviewText = false;
        mIsGeneralTextInput = false;
        mNoLearning = 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);

    final boolean noMicrophone = mIsPasswordField
            || InputTypeUtils.isEmailVariation(variation)
            || InputType.TYPE_TEXT_VARIATION_URI == variation
            || hasNoMicrophoneKeyOption();
    mShouldShowVoiceInputKey = !noMicrophone;

    mDisableGestureFloatingPreviewText = InputAttributes.inPrivateImeOptions(
            mPackageNameForPrivateImeOptions, NO_FLOATING_GESTURE_PREVIEW, editorInfo);

    // 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;

    // If we come here, inputClass is always TYPE_CLASS_TEXT
    mIsGeneralTextInput = InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS != variation
            && InputType.TYPE_TEXT_VARIATION_PASSWORD != variation
            && InputType.TYPE_TEXT_VARIATION_PHONETIC != variation
            && InputType.TYPE_TEXT_VARIATION_URI != variation
            && InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD != variation
            && InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS != variation
            && InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD != variation;

    mNoLearning = (editorInfo.imeOptions & EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING) != 0;
}
 
源代码11 项目: openboard   文件: InputAttributes.java
public boolean isTypeNull() {
    return InputType.TYPE_NULL == mInputType;
}
 
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;
}
 
public boolean isTypeNull() {
    return InputType.TYPE_NULL == mInputType;
}
 
源代码14 项目: Indic-Keyboard   文件: InputAttributes.java
public boolean isTypeNull() {
    return InputType.TYPE_NULL == mInputType;
}
 
源代码15 项目: Jockey   文件: RuleViewModel.java
@Bindable
public int getValueTextVisibility() {
    return (mEnumeratedRule.getInputType() != InputType.TYPE_NULL) ? View.VISIBLE : View.GONE;
}
 
源代码16 项目: simple-keyboard   文件: InputAttributes.java
public boolean isTypeNull() {
    return InputType.TYPE_NULL == mInputType;
}
 
源代码17 项目: AOSP-Kayboard-7.1.2   文件: InputAttributes.java
public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode,
        final String packageNameForPrivateImeOptions) {
    mEditorInfo = editorInfo;
    mPackageNameForPrivateImeOptions = packageNameForPrivateImeOptions;
    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;
        mShouldShowVoiceInputKey = false;
        mDisableGestureFloatingPreviewText = false;
        mIsGeneralTextInput = 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);

    final boolean noMicrophone = mIsPasswordField
            || InputTypeUtils.isEmailVariation(variation)
            || InputType.TYPE_TEXT_VARIATION_URI == variation
            || hasNoMicrophoneKeyOption();
    mShouldShowVoiceInputKey = !noMicrophone;

    mDisableGestureFloatingPreviewText = InputAttributes.inPrivateImeOptions(
            mPackageNameForPrivateImeOptions, NO_FLOATING_GESTURE_PREVIEW, editorInfo);

    // 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;

    // If we come here, inputClass is always TYPE_CLASS_TEXT
    mIsGeneralTextInput = InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS != variation
            && InputType.TYPE_TEXT_VARIATION_PASSWORD != variation
            && InputType.TYPE_TEXT_VARIATION_PHONETIC != variation
            && InputType.TYPE_TEXT_VARIATION_URI != variation
            && InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD != variation
            && InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS != variation
            && InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD != variation;
}
 
源代码18 项目: AOSP-Kayboard-7.1.2   文件: InputAttributes.java
public boolean isTypeNull() {
    return InputType.TYPE_NULL == mInputType;
}
 
源代码19 项目: J2ME-Loader   文件: TextFieldImpl.java
void setConstraints(int constraints) {
	this.constraints = constraints;

	if (textview != null) {
		int inputtype;

		switch (constraints & TextField.CONSTRAINT_MASK) {
			default:
			case TextField.ANY:
				inputtype = InputType.TYPE_CLASS_TEXT;
				break;

			case TextField.EMAILADDR:
				inputtype = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
				break;

			case TextField.NUMERIC:
				inputtype = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED;
				break;

			case TextField.PHONENUMBER:
				inputtype = InputType.TYPE_CLASS_PHONE;
				break;

			case TextField.URL:
				inputtype = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI;
				break;

			case TextField.DECIMAL:
				inputtype = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED | InputType.TYPE_NUMBER_FLAG_DECIMAL;
				break;
		}

		if ((constraints & TextField.PASSWORD) != 0 ||
				(constraints & TextField.SENSITIVE) != 0) {
			inputtype = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;
		}

		if ((constraints & TextField.UNEDITABLE) != 0) {
			inputtype = InputType.TYPE_NULL;
		}

		if ((constraints & TextField.NON_PREDICTIVE) != 0) {
			inputtype |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
		}

		if ((constraints & TextField.INITIAL_CAPS_WORD) != 0) {
			inputtype |= InputType.TYPE_TEXT_FLAG_CAP_WORDS;
		}

		if ((constraints & TextField.INITIAL_CAPS_SENTENCE) != 0) {
			inputtype |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
		}

		textview.setInputType(inputtype);
		if ((constraints & TextField.CONSTRAINT_MASK) == TextField.ANY) {
			textview.setSingleLine(false);
		}
	}
}
 
public MaterialAutoCompleteTextView(
    @NonNull Context context, @Nullable AttributeSet attributeSet, int defStyleAttr) {
  super(wrap(context, attributeSet, defStyleAttr, 0), attributeSet, defStyleAttr);
  // Ensure we are using the correctly themed context rather than the context that was passed in.
  context = getContext();

  TypedArray attributes =
      ThemeEnforcement.obtainStyledAttributes(
          context,
          attributeSet,
          R.styleable.MaterialAutoCompleteTextView,
          defStyleAttr,
          R.style.Widget_AppCompat_AutoCompleteTextView);

  // Due to a framework bug, setting android:inputType="none" on xml has no effect. Therefore,
  // we check it here in case the autoCompleteTextView should be non-editable.
  if (attributes.hasValue(R.styleable.MaterialAutoCompleteTextView_android_inputType)) {
    int inputType =
        attributes.getInt(
            R.styleable.MaterialAutoCompleteTextView_android_inputType, InputType.TYPE_NULL);
    if (inputType == InputType.TYPE_NULL) {
      setKeyListener(null);
    }
  }

  accessibilityManager =
      (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);

  modalListPopup = new ListPopupWindow(context);
  modalListPopup.setModal(true);
  modalListPopup.setAnchorView(this);
  modalListPopup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NOT_NEEDED);
  modalListPopup.setAdapter(getAdapter());
  modalListPopup.setOnItemClickListener(
      new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View selectedView, int position, long id) {
          Object selectedItem =
              position < 0 ? modalListPopup.getSelectedItem() : getAdapter().getItem(position);

          updateText(selectedItem);

          OnItemClickListener userOnitemClickListener = getOnItemClickListener();
          if (userOnitemClickListener != null) {
            if (selectedView == null || position < 0) {
              selectedView = modalListPopup.getSelectedView();
              position = modalListPopup.getSelectedItemPosition();
              id = modalListPopup.getSelectedItemId();
            }
            userOnitemClickListener.onItemClick(
                modalListPopup.getListView(), selectedView, position, id);
          }

          modalListPopup.dismiss();
        }
      });

  attributes.recycle();
}