public boolean hasBeenModified() { return mSubtype != null && !mSubtype.equals(mPreviousSubtype); }
@Override public boolean equals(final Object o) { if (!(o instanceof RichInputMethodSubtype)) { return false; } final RichInputMethodSubtype other = (RichInputMethodSubtype)o; return mSubtype.equals(other.mSubtype) && mLocale.equals(other.mLocale); }
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; }
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; }
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; }
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 */); } }
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 */); } }
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); }
private boolean equals(final KeyboardId other) { if (other == this) return true; return other.mElementId == mElementId && other.mMode == mMode && other.mWidth == mWidth && other.mHeight == mHeight && other.passwordInput() == passwordInput() && other.mClobberSettingsKey == mClobberSettingsKey && other.mHasShortcutKey == mHasShortcutKey && other.mLanguageSwitchKeyEnabled == mLanguageSwitchKeyEnabled && other.isMultiLine() == isMultiLine() && other.imeAction() == imeAction() && TextUtils.equals(other.mCustomActionLabel, mCustomActionLabel) && other.navigateNext() == navigateNext() && other.navigatePrevious() == navigatePrevious() && other.mSubtype.equals(mSubtype); }
if (lastKeyboard == null || !keyboard.mId.mSubtype.equals(lastKeyboard.mId.mSubtype)) { announceKeyboardLanguage(keyboard); return;