android.view.inputmethod.InputMethodSubtype#getExtraValueOf ( )源码实例Demo

下面列出了android.view.inputmethod.InputMethodSubtype#getExtraValueOf ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openboard   文件: SubtypeLocaleUtils.java
@Nonnull
public static String getKeyboardLayoutSetName(final InputMethodSubtype subtype) {
    String keyboardLayoutSet = subtype.getExtraValueOf(KEYBOARD_LAYOUT_SET);
    if (keyboardLayoutSet == null) {
        // This subtype doesn't have a keyboardLayoutSet extra value, so lookup its keyboard
        // layout set in sLocaleAndExtraValueToKeyboardLayoutSetMap to keep it compatible with
        // pre-JellyBean.
        final String key = subtype.getLocale() + ":" + subtype.getExtraValue();
        keyboardLayoutSet = sLocaleAndExtraValueToKeyboardLayoutSetMap.get(key);
    }
    // TODO: Remove this null check when InputMethodManager.getCurrentInputMethodSubtype is
    // fixed.
    if (keyboardLayoutSet == null) {
        android.util.Log.w(TAG, "KeyboardLayoutSet not found, use QWERTY: " +
                "locale=" + subtype.getLocale() + " extraValue=" + subtype.getExtraValue());
        return QWERTY;
    }
    return keyboardLayoutSet;
}
 
public static String getKeyboardLayoutSetName(final InputMethodSubtype subtype) {
    String keyboardLayoutSet = subtype.getExtraValueOf(KEYBOARD_LAYOUT_SET);
    if (keyboardLayoutSet == null) {
        // This subtype doesn't have a keyboardLayoutSet extra value, so lookup its keyboard
        // layout set in sLocaleAndExtraValueToKeyboardLayoutSetMap to keep it compatible with
        // pre-JellyBean.
        final String key = subtype.getLocale() + ":" + subtype.getExtraValue();
        keyboardLayoutSet = sLocaleAndExtraValueToKeyboardLayoutSetMap.get(key);
    }
    // TODO: Remove this null check when InputMethodManager.getCurrentInputMethodSubtype is
    // fixed.
    if (keyboardLayoutSet == null) {
        android.util.Log.w(TAG, "KeyboardLayoutSet not found, use QWERTY: " +
                "locale=" + subtype.getLocale() + " extraValue=" + subtype.getExtraValue());
        return QWERTY;
    }
    return keyboardLayoutSet;
}
 
源代码3 项目: simple-keyboard   文件: SubtypeLocaleUtils.java
public static String getKeyboardLayoutSetName(final InputMethodSubtype subtype) {
    String keyboardLayoutSet = subtype.getExtraValueOf(KEYBOARD_LAYOUT_SET);
    if (keyboardLayoutSet == null) {
        // This subtype doesn't have a keyboardLayoutSet extra value, so lookup its keyboard
        // layout set in sLocaleAndExtraValueToKeyboardLayoutSetMap to keep it compatible with
        // pre-JellyBean.
        keyboardLayoutSet = sLocaleAndExtraValueToKeyboardLayoutSetMap.get(subtype.getLocale());
    }
    // TODO: Remove this null check when InputMethodManager.getCurrentInputMethodSubtype is
    // fixed.
    if (keyboardLayoutSet == null) {
        android.util.Log.w(TAG, "KeyboardLayoutSet not found, use QWERTY: " +
                "locale=" + subtype.getLocale() + " extraValue=" + subtype.getExtraValue());
        return QWERTY;
    }
    return keyboardLayoutSet;
}
 
源代码4 项目: AOSP-Kayboard-7.1.2   文件: SubtypeLocaleUtils.java
@Nonnull
public static String getKeyboardLayoutSetName(final InputMethodSubtype subtype) {
    String keyboardLayoutSet = subtype.getExtraValueOf(KEYBOARD_LAYOUT_SET);
    if (keyboardLayoutSet == null) {
        // This subtype doesn't have a keyboardLayoutSet extra value, so lookup its keyboard
        // layout set in sLocaleAndExtraValueToKeyboardLayoutSetMap to keep it compatible with
        // pre-JellyBean.
        final String key = subtype.getLocale() + ":" + subtype.getExtraValue();
        keyboardLayoutSet = sLocaleAndExtraValueToKeyboardLayoutSetMap.get(key);
    }
    // TODO: Remove this null check when InputMethodManager.getCurrentInputMethodSubtype is
    // fixed.
    if (keyboardLayoutSet == null) {
        Log.w(TAG, "KeyboardLayoutSet not found, use QWERTY: " +
                "locale=" + subtype.getLocale() + " extraValue=" + subtype.getExtraValue());
        return QWERTY;
    }
    return keyboardLayoutSet;
}
 
源代码5 项目: Indic-Keyboard   文件: LatinIME.java
private boolean checkForTransliteration() {
    Locale locale = mRichImm.getCurrentSubtypeLocale();

    if (!locale.getLanguage().equals("en")) {
        mInputLogic.setIndic(true);
    } else {
        mInputLogic.setIndic(false);
    }

    InputMethodSubtype currentSubtype = mRichImm.getCurrentSubtype().getRawSubtype();
    if(currentSubtype.containsExtraValueKey(TRANSLITERATION_METHOD)) {
        try {
            String transliterationName = currentSubtype.getExtraValueOf(TRANSLITERATION_METHOD);
            mInputLogic.enableTransliteration(transliterationName, getApplicationContext());
            Log.d("IndicKeyboard", "-------------transliteration enabled-----------");
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }
    mInputLogic.disableTransliteration();
    Log.d("IndicKeyboard", "-------------transliteration disabled----------------");
    return false;
}
 
源代码6 项目: Indic-Keyboard   文件: SubtypeLocaleUtils.java
@Nonnull
public static String getKeyboardLayoutSetName(final InputMethodSubtype subtype) {
    String keyboardLayoutSet = subtype.getExtraValueOf(KEYBOARD_LAYOUT_SET);
    if (keyboardLayoutSet == null) {
        // This subtype doesn't have a keyboardLayoutSet extra value, so lookup its keyboard
        // layout set in sLocaleAndExtraValueToKeyboardLayoutSetMap to keep it compatible with
        // pre-JellyBean.
        final String key = subtype.getLocale() + ":" + subtype.getExtraValue();
        keyboardLayoutSet = sLocaleAndExtraValueToKeyboardLayoutSetMap.get(key);
    }
    // TODO: Remove this null check when InputMethodManager.getCurrentInputMethodSubtype is
    // fixed.
    if (keyboardLayoutSet == null) {
        android.util.Log.w(TAG, "KeyboardLayoutSet not found, use QWERTY: " +
                "locale=" + subtype.getLocale() + " extraValue=" + subtype.getExtraValue());
        return QWERTY;
    }
    return keyboardLayoutSet;
}
 
源代码7 项目: openboard   文件: SubtypeLocaleUtils.java
@Nonnull
private static String getReplacementString(@Nonnull final InputMethodSubtype subtype,
        @Nonnull final Locale displayLocale) {
    if (subtype.containsExtraValueKey(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME)) {
        return subtype.getExtraValueOf(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME);
    }
    return getSubtypeLocaleDisplayNameInternal(subtype.getLocale(), displayLocale);
}
 
private static String getReplacementString(final InputMethodSubtype subtype,
        final Locale displayLocale) {
    if (subtype.containsExtraValueKey(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME)) {
        return subtype.getExtraValueOf(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME);
    }
    return getSubtypeLocaleDisplayNameInternal(subtype.getLocale(), displayLocale);
}
 
源代码9 项目: simple-keyboard   文件: SubtypeLocaleUtils.java
private static String getReplacementString(final InputMethodSubtype subtype,
        final Locale displayLocale) {
    if (subtype.containsExtraValueKey(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME)) {
        return subtype.getExtraValueOf(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME);
    }
    return getSubtypeLocaleDisplayNameInternal(subtype.getLocale(), displayLocale);
}
 
源代码10 项目: AOSP-Kayboard-7.1.2   文件: SubtypeLocaleUtils.java
@Nonnull
private static String getReplacementString(@Nonnull final InputMethodSubtype subtype,
        @Nonnull final Locale displayLocale) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN
            && subtype.containsExtraValueKey(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME)) {
        return subtype.getExtraValueOf(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME);
    }
    return getSubtypeLocaleDisplayNameInternal(subtype.getLocale(), displayLocale);
}
 
源代码11 项目: Indic-Keyboard   文件: SubtypeLocaleUtils.java
@Nonnull
private static String getReplacementString(@Nonnull final InputMethodSubtype subtype,
        @Nonnull final Locale displayLocale) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN
            && subtype.containsExtraValueKey(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME)) {
        return subtype.getExtraValueOf(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME);
    }
    return getSubtypeLocaleDisplayNameInternal(subtype.getLocale(), displayLocale);
}
 
源代码12 项目: openboard   文件: SubtypeLocaleUtils.java
public static String getCombiningRulesExtraValue(final InputMethodSubtype subtype) {
    return subtype.getExtraValueOf(COMBINING_RULES);
}
 
源代码13 项目: AOSP-Kayboard-7.1.2   文件: SubtypeLocaleUtils.java
public static String getCombiningRulesExtraValue(final InputMethodSubtype subtype) {
    return subtype.getExtraValueOf(COMBINING_RULES);
}
 
源代码14 项目: Indic-Keyboard   文件: SubtypeLocaleUtils.java
public static String getCombiningRulesExtraValue(final InputMethodSubtype subtype) {
    return subtype.getExtraValueOf(COMBINING_RULES);
}