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


Java InputMethodSubtype.equals方法代码示例

本文整理汇总了Java中android.view.inputmethod.InputMethodSubtype.equals方法的典型用法代码示例。如果您正苦于以下问题:Java InputMethodSubtype.equals方法的具体用法?Java InputMethodSubtype.equals怎么用?Java InputMethodSubtype.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.inputmethod.InputMethodSubtype的用法示例。


在下文中一共展示了InputMethodSubtype.equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: switchSubtype

import android.view.inputmethod.InputMethodSubtype; //导入方法依赖的package包/类
public void switchSubtype(final IBinder token, final RichInputMethodManager richImm) {
    final InputMethodSubtype currentSubtype = richImm.getInputMethodManager()
            .getCurrentInputMethodSubtype();
    final InputMethodSubtype lastActiveSubtype = mLastActiveSubtype;
    final boolean currentSubtypeHasBeenUsed = mCurrentSubtypeHasBeenUsed;
    if (currentSubtypeHasBeenUsed) {
        mLastActiveSubtype = currentSubtype;
        mCurrentSubtypeHasBeenUsed = false;
    }
    if (currentSubtypeHasBeenUsed
            && richImm.checkIfSubtypeBelongsToThisImeAndEnabled(lastActiveSubtype)
            && !currentSubtype.equals(lastActiveSubtype)) {
        richImm.setInputMethodAndSubtype(token, lastActiveSubtype);
        return;
    }
    richImm.switchToNextInputMethod(token, true /* onlyCurrentIme */);
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:18,代码来源:LatinIME.java

示例2: onStartInputInternal

import android.view.inputmethod.InputMethodSubtype; //导入方法依赖的package包/类
void onStartInputInternal(final EditorInfo editorInfo, final boolean restarting) {
    super.onStartInput(editorInfo, restarting);

    // If the primary hint language does not match the current subtype language, then try
    // to switch to the primary hint language.
    // TODO: Support all the locales in EditorInfo#hintLocales.
    final Locale primaryHintLocale = EditorInfoCompatUtils.getPrimaryHintLocale(editorInfo);
    if (primaryHintLocale == null) {
        return;
    }
    final InputMethodSubtype newSubtype = mRichImm.findSubtypeByLocale(primaryHintLocale);
    if (newSubtype == null || newSubtype.equals(mRichImm.getCurrentSubtype().getRawSubtype())) {
        return;
    }
    mHandler.postSwitchLanguage(newSubtype);
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:17,代码来源:LatinIME.java

示例3: getSubtypeIndexInList

import android.view.inputmethod.InputMethodSubtype; //导入方法依赖的package包/类
private static int getSubtypeIndexInList(final InputMethodSubtype subtype,
        final List<InputMethodSubtype> subtypes) {
    final int count = subtypes.size();
    for (int index = 0; index < count; index++) {
        final InputMethodSubtype ims = subtypes.get(index);
        if (ims.equals(subtype)) {
            return index;
        }
    }
    return INDEX_NOT_FOUND;
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:12,代码来源:RichInputMethodManager.java


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