本文整理汇总了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 */);
}
示例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);
}
示例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;
}