本文整理汇总了Java中android.view.inputmethod.InputMethodSubtype.getExtraValue方法的典型用法代码示例。如果您正苦于以下问题:Java InputMethodSubtype.getExtraValue方法的具体用法?Java InputMethodSubtype.getExtraValue怎么用?Java InputMethodSubtype.getExtraValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.inputmethod.InputMethodSubtype
的用法示例。
在下文中一共展示了InputMethodSubtype.getExtraValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKeyboardLayoutSetName
import android.view.inputmethod.InputMethodSubtype; //导入方法依赖的package包/类
@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;
}
示例2: getKeyboardLayoutSetName
import android.view.inputmethod.InputMethodSubtype; //导入方法依赖的package包/类
@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;
}