本文整理汇总了Java中android.view.inputmethod.InputMethodInfo.getSubtypeAt方法的典型用法代码示例。如果您正苦于以下问题:Java InputMethodInfo.getSubtypeAt方法的具体用法?Java InputMethodInfo.getSubtypeAt怎么用?Java InputMethodInfo.getSubtypeAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.inputmethod.InputMethodInfo
的用法示例。
在下文中一共展示了InputMethodInfo.getSubtypeAt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SubtypeLocaleAdapter
import android.view.inputmethod.InputMethodInfo; //导入方法依赖的package包/类
public SubtypeLocaleAdapter(final Context context) {
super(context, android.R.layout.simple_spinner_item);
setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
final TreeSet<SubtypeLocaleItem> items = new TreeSet<>();
final InputMethodInfo imi = RichInputMethodManager.getInstance()
.getInputMethodInfoOfThisIme();
final int count = imi.getSubtypeCount();
for (int i = 0; i < count; i++) {
final InputMethodSubtype subtype = imi.getSubtypeAt(i);
if (DEBUG_SUBTYPE_ID) {
Log.d(TAG_SUBTYPE, String.format("%-6s 0x%08x %11d %s",
subtype.getLocale(), subtype.hashCode(), subtype.hashCode(),
SubtypeLocaleUtils.getSubtypeDisplayNameInSystemLocale(subtype)));
}
if (InputMethodSubtypeCompatUtils.isAsciiCapable(subtype)) {
items.add(new SubtypeLocaleItem(subtype));
}
}
// TODO: Should filter out already existing combinations of locale and layout.
addAll(items);
}
示例2: SubtypeLocaleAdapter
import android.view.inputmethod.InputMethodInfo; //导入方法依赖的package包/类
public SubtypeLocaleAdapter(final Context context) {
super(context, android.R.layout.simple_spinner_item);
setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
final TreeSet<SubtypeLocaleItem> items = CollectionUtils.newTreeSet();
final InputMethodInfo imi = RichInputMethodManager.getInstance()
.getInputMethodInfoOfThisIme();
final int count = imi.getSubtypeCount();
for (int i = 0; i < count; i++) {
final InputMethodSubtype subtype = imi.getSubtypeAt(i);
if (DEBUG_SUBTYPE_ID) {
android.util.Log.d(TAG, String.format("%-6s 0x%08x %11d %s",
subtype.getLocale(), subtype.hashCode(), subtype.hashCode(),
SubtypeLocale.getSubtypeDisplayNameInSystemLocale(subtype)));
}
if (subtype.containsExtraValueKey(ASCII_CAPABLE)) {
items.add(createItem(context, subtype.getLocale()));
}
}
// TODO: Should filter out already existing combinations of locale and layout.
addAll(items);
}
示例3: isAuxiliaryIme
import android.view.inputmethod.InputMethodInfo; //导入方法依赖的package包/类
private static boolean isAuxiliaryIme(final InputMethodInfo imi) {
final int count = imi.getSubtypeCount();
if (count == 0) {
return false;
}
for (int index = 0; index < count; index++) {
final InputMethodSubtype subtype = imi.getSubtypeAt(index);
if (!subtype.isAuxiliary()) {
return false;
}
}
return true;
}
示例4: findSubtypeByLocaleAndKeyboardLayoutSet
import android.view.inputmethod.InputMethodInfo; //导入方法依赖的package包/类
public InputMethodSubtype findSubtypeByLocaleAndKeyboardLayoutSet(final String localeString,
final String keyboardLayoutSetName) {
final InputMethodInfo myImi = getInputMethodInfoOfThisIme();
final int count = myImi.getSubtypeCount();
for (int i = 0; i < count; i++) {
final InputMethodSubtype subtype = myImi.getSubtypeAt(i);
final String layoutName = SubtypeLocaleUtils.getKeyboardLayoutSetName(subtype);
if (localeString.equals(subtype.getLocale())
&& keyboardLayoutSetName.equals(layoutName)) {
return subtype;
}
}
return null;
}
示例5: getVoiceImeInputMethodInfo
import android.view.inputmethod.InputMethodInfo; //导入方法依赖的package包/类
private static InputMethodInfo getVoiceImeInputMethodInfo(InputMethodManager inputMethodManager)
throws SecurityException, IllegalArgumentException {
for (InputMethodInfo inputMethodInfo : inputMethodManager.getEnabledInputMethodList()) {
for (int i = 0; i < inputMethodInfo.getSubtypeCount(); i++) {
InputMethodSubtype subtype = inputMethodInfo.getSubtypeAt(i);
if (VOICE_IME_SUBTYPE_MODE.equals(subtype.getMode())) {
if (inputMethodInfo.getComponent().getPackageName()
.startsWith(VOICE_IME_PACKAGE_PREFIX)) {
return inputMethodInfo;
}
}
}
}
return null;
}
示例6: getSubtypeIndexInIme
import android.view.inputmethod.InputMethodInfo; //导入方法依赖的package包/类
private static int getSubtypeIndexInIme(final InputMethodSubtype subtype,
final InputMethodInfo imi) {
final int count = imi.getSubtypeCount();
for (int index = 0; index < count; index++) {
final InputMethodSubtype ims = imi.getSubtypeAt(index);
if (ims.equals(subtype)) {
return index;
}
}
return INDEX_NOT_FOUND;
}
示例7: findSubtypeByLocaleAndKeyboardLayoutSet
import android.view.inputmethod.InputMethodInfo; //导入方法依赖的package包/类
public InputMethodSubtype findSubtypeByLocaleAndKeyboardLayoutSet(final String localeString,
final String keyboardLayoutSetName) {
final InputMethodInfo myImi = mInputMethodInfoOfThisIme;
final int count = myImi.getSubtypeCount();
for (int i = 0; i < count; i++) {
final InputMethodSubtype subtype = myImi.getSubtypeAt(i);
final String layoutName = SubtypeLocale.getKeyboardLayoutSetName(subtype);
if (localeString.equals(subtype.getLocale())
&& keyboardLayoutSetName.equals(layoutName)) {
return subtype;
}
}
return null;
}