android.view.inputmethod.InputMethodSubtype#equals ( )源码实例Demo

下面列出了android.view.inputmethod.InputMethodSubtype#equals ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openboard   文件: LatinIME.java
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 项目: openboard   文件: LatinIME.java
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 项目: Android-Keyboard   文件: LatinIME.java
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 */);
}
 
源代码4 项目: Android-Keyboard   文件: LatinIME.java
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);
}
 
源代码5 项目: LokiBoard-Android-Keylogger   文件: LatinIME.java
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 */);
}
 
源代码6 项目: LokiBoard-Android-Keylogger   文件: LatinIME.java
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);
}
 
源代码7 项目: simple-keyboard   文件: LatinIME.java
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 */);
}
 
源代码8 项目: simple-keyboard   文件: LatinIME.java
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);
}
 
源代码9 项目: AOSP-Kayboard-7.1.2   文件: LatinIME.java
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 */);
}
 
源代码10 项目: AOSP-Kayboard-7.1.2   文件: LatinIME.java
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);
}
 
源代码11 项目: Indic-Keyboard   文件: LatinIME.java
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 */);
}
 
源代码12 项目: Indic-Keyboard   文件: LatinIME.java
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);
}
 
源代码13 项目: Indic-Keyboard   文件: SubtypeLocaleUtilsTests.java
public void testIsRtlLanguage() {
    // Known Right-to-Left language subtypes.
    final InputMethodSubtype ARABIC = mRichImm
            .findSubtypeByLocaleAndKeyboardLayoutSet("ar", "arabic");
    assertNotNull("Arabic", ARABIC);
    final InputMethodSubtype FARSI = mRichImm
            .findSubtypeByLocaleAndKeyboardLayoutSet("fa", "farsi");
    assertNotNull("Farsi", FARSI);
    final InputMethodSubtype HEBREW = mRichImm
            .findSubtypeByLocaleAndKeyboardLayoutSet("iw", "hebrew");
    assertNotNull("Hebrew", HEBREW);

    for (final RichInputMethodSubtype subtype : mSubtypesList) {
        final InputMethodSubtype rawSubtype = subtype.getRawSubtype();
        final String subtypeName = SubtypeLocaleUtils
                .getSubtypeDisplayNameInSystemLocale(rawSubtype);
        if (rawSubtype.equals(ARABIC) || rawSubtype.equals(FARSI)
                || rawSubtype.equals(HEBREW)) {
            assertTrue(subtypeName, subtype.isRtlSubtype());
        } else {
            assertFalse(subtypeName, subtype.isRtlSubtype());
        }
    }
}
 
源代码14 项目: openboard   文件: RichInputMethodManager.java
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;
}
 
源代码16 项目: simple-keyboard   文件: RichInputMethodManager.java
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;
}
 
源代码18 项目: Indic-Keyboard   文件: RichInputMethodManager.java
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;
}