当前位置: 首页>>代码示例>>Java>>正文


Java InputMethodInfo.getSubtypeAt方法代码示例

本文整理汇总了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);
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:23,代码来源:CustomInputStylePreference.java

示例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);
}
 
开发者ID:slightfoot,项目名称:android-kioskime,代码行数:23,代码来源:AdditionalSubtypeSettings.java

示例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;
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:14,代码来源:RichInputMethodManager.java

示例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;
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:15,代码来源:RichInputMethodManager.java

示例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;
}
 
开发者ID:MohammadAlBanna,项目名称:Swift-Braille-Soft-keyboard,代码行数:16,代码来源:ImeTrigger.java

示例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;
}
 
开发者ID:slightfoot,项目名称:android-kioskime,代码行数:12,代码来源:RichInputMethodManager.java

示例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;
}
 
开发者ID:slightfoot,项目名称:android-kioskime,代码行数:15,代码来源:RichInputMethodManager.java


注:本文中的android.view.inputmethod.InputMethodInfo.getSubtypeAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。