Java Code Examples for android.text.InputType#TYPE_TEXT_VARIATION_NORMAL

The following examples show how to use android.text.InputType#TYPE_TEXT_VARIATION_NORMAL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DigitsKeyListener.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the input type for the listener.
 */
public int getInputType() {
    int contentType;
    if (mNeedsAdvancedInput) {
        contentType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL;
    } else {
        contentType = InputType.TYPE_CLASS_NUMBER;
        if (mSign) {
            contentType |= InputType.TYPE_NUMBER_FLAG_SIGNED;
        }
        if (mDecimal) {
            contentType |= InputType.TYPE_NUMBER_FLAG_DECIMAL;
        }
    }
    return contentType;
}
 
Example 2
Source File: ActionTestsBase.java    From Indic-Keyboard with Apache License 2.0 6 votes vote down vote up
protected void doTestActionKey(final String tag, final InputMethodSubtype subtype,
        final EditorInfo editorInfo, final ExpectedActionKey expectedKey) {
    // Test text layouts.
    editorInfo.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL;
    final KeyboardLayoutSet layoutSet = createKeyboardLayoutSet(subtype, editorInfo);
    assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_ALPHABET, expectedKey);
    assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_SYMBOLS, expectedKey);
    assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_SYMBOLS_SHIFTED, expectedKey);
    // Test phone number layouts.
    assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_PHONE, expectedKey);
    assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_PHONE_SYMBOLS, expectedKey);
    // Test normal number layout.
    assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_NUMBER, expectedKey);
    // Test number password layout.
    editorInfo.inputType =
            InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD;
    final KeyboardLayoutSet passwordSet = createKeyboardLayoutSet(subtype, editorInfo);
    assertActionKey(tag, passwordSet, KeyboardId.ELEMENT_NUMBER, expectedKey);
}
 
Example 3
Source File: TimeKeyListener.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public int getInputType() {
    if (mNeedsAdvancedInput) {
        return InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL;
    } else {
        return InputType.TYPE_CLASS_DATETIME | InputType.TYPE_DATETIME_VARIATION_TIME;
    }
}
 
Example 4
Source File: DateKeyListener.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public int getInputType() {
    if (mNeedsAdvancedInput) {
        return InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL;
    } else {
        return InputType.TYPE_CLASS_DATETIME | InputType.TYPE_DATETIME_VARIATION_DATE;
    }
}
 
Example 5
Source File: DateTimeKeyListener.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public int getInputType() {
    if (mNeedsAdvancedInput) {
        return InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL;
    } else {
        return InputType.TYPE_CLASS_DATETIME | InputType.TYPE_DATETIME_VARIATION_NORMAL;
    }
}
 
Example 6
Source File: InputAttributes.java    From openboard with GNU General Public License v3.0 5 votes vote down vote up
private static String toTextVariationString(final int variation) {
    switch (variation) {
    case InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
        return " TYPE_TEXT_VARIATION_EMAIL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT:
        return "TYPE_TEXT_VARIATION_EMAIL_SUBJECT";
    case InputType.TYPE_TEXT_VARIATION_FILTER:
        return "TYPE_TEXT_VARIATION_FILTER";
    case InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE:
        return "TYPE_TEXT_VARIATION_LONG_MESSAGE";
    case InputType.TYPE_TEXT_VARIATION_NORMAL:
        return "TYPE_TEXT_VARIATION_NORMAL";
    case InputType.TYPE_TEXT_VARIATION_PASSWORD:
        return "TYPE_TEXT_VARIATION_PASSWORD";
    case InputType.TYPE_TEXT_VARIATION_PERSON_NAME:
        return "TYPE_TEXT_VARIATION_PERSON_NAME";
    case InputType.TYPE_TEXT_VARIATION_PHONETIC:
        return "TYPE_TEXT_VARIATION_PHONETIC";
    case InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS:
        return "TYPE_TEXT_VARIATION_POSTAL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE:
        return "TYPE_TEXT_VARIATION_SHORT_MESSAGE";
    case InputType.TYPE_TEXT_VARIATION_URI:
        return "TYPE_TEXT_VARIATION_URI";
    case InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD:
        return "TYPE_TEXT_VARIATION_VISIBLE_PASSWORD";
    case InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT:
        return "TYPE_TEXT_VARIATION_WEB_EDIT_TEXT";
    case InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
        return "TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD:
        return "TYPE_TEXT_VARIATION_WEB_PASSWORD";
    default:
        return String.format("unknownVariation<0x%08x>", variation);
    }
}
 
Example 7
Source File: InputAttributes.java    From AOSP-Kayboard-7.1.2 with Apache License 2.0 5 votes vote down vote up
private static String toTextVariationString(final int variation) {
    switch (variation) {
    case InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
        return " TYPE_TEXT_VARIATION_EMAIL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT:
        return "TYPE_TEXT_VARIATION_EMAIL_SUBJECT";
    case InputType.TYPE_TEXT_VARIATION_FILTER:
        return "TYPE_TEXT_VARIATION_FILTER";
    case InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE:
        return "TYPE_TEXT_VARIATION_LONG_MESSAGE";
    case InputType.TYPE_TEXT_VARIATION_NORMAL:
        return "TYPE_TEXT_VARIATION_NORMAL";
    case InputType.TYPE_TEXT_VARIATION_PASSWORD:
        return "TYPE_TEXT_VARIATION_PASSWORD";
    case InputType.TYPE_TEXT_VARIATION_PERSON_NAME:
        return "TYPE_TEXT_VARIATION_PERSON_NAME";
    case InputType.TYPE_TEXT_VARIATION_PHONETIC:
        return "TYPE_TEXT_VARIATION_PHONETIC";
    case InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS:
        return "TYPE_TEXT_VARIATION_POSTAL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE:
        return "TYPE_TEXT_VARIATION_SHORT_MESSAGE";
    case InputType.TYPE_TEXT_VARIATION_URI:
        return "TYPE_TEXT_VARIATION_URI";
    case InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD:
        return "TYPE_TEXT_VARIATION_VISIBLE_PASSWORD";
    case InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT:
        return "TYPE_TEXT_VARIATION_WEB_EDIT_TEXT";
    case InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
        return "TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD:
        return "TYPE_TEXT_VARIATION_WEB_PASSWORD";
    default:
        return String.format("unknownVariation<0x%08x>", variation);
    }
}
 
Example 8
Source File: InputAttributes.java    From Indic-Keyboard with Apache License 2.0 5 votes vote down vote up
private static String toTextVariationString(final int variation) {
    switch (variation) {
    case InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
        return " TYPE_TEXT_VARIATION_EMAIL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT:
        return "TYPE_TEXT_VARIATION_EMAIL_SUBJECT";
    case InputType.TYPE_TEXT_VARIATION_FILTER:
        return "TYPE_TEXT_VARIATION_FILTER";
    case InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE:
        return "TYPE_TEXT_VARIATION_LONG_MESSAGE";
    case InputType.TYPE_TEXT_VARIATION_NORMAL:
        return "TYPE_TEXT_VARIATION_NORMAL";
    case InputType.TYPE_TEXT_VARIATION_PASSWORD:
        return "TYPE_TEXT_VARIATION_PASSWORD";
    case InputType.TYPE_TEXT_VARIATION_PERSON_NAME:
        return "TYPE_TEXT_VARIATION_PERSON_NAME";
    case InputType.TYPE_TEXT_VARIATION_PHONETIC:
        return "TYPE_TEXT_VARIATION_PHONETIC";
    case InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS:
        return "TYPE_TEXT_VARIATION_POSTAL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE:
        return "TYPE_TEXT_VARIATION_SHORT_MESSAGE";
    case InputType.TYPE_TEXT_VARIATION_URI:
        return "TYPE_TEXT_VARIATION_URI";
    case InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD:
        return "TYPE_TEXT_VARIATION_VISIBLE_PASSWORD";
    case InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT:
        return "TYPE_TEXT_VARIATION_WEB_EDIT_TEXT";
    case InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
        return "TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS";
    case InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD:
        return "TYPE_TEXT_VARIATION_WEB_PASSWORD";
    default:
        return String.format("unknownVariation<0x%08x>", variation);
    }
}