use of android.view.inputmethod.InputMethodSubtype in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class LxxActionNextTests method testActionNext.
public void testActionNext() {
final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(KeyboardIconsSet.NAME_NEXT_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "next " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_NEXT, expectedKey);
}
}
use of android.view.inputmethod.InputMethodSubtype in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class LxxActionSendTests method testActionSend.
public void testActionSend() {
final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(KeyboardIconsSet.NAME_SEND_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "send " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_SEND, expectedKey);
}
}
use of android.view.inputmethod.InputMethodSubtype in project android_packages_inputmethods_LatinIME by CyanogenMod.
the class LxxActionUnspecifiedTests method testActionUnspecified.
public void testActionUnspecified() {
final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(KeyboardIconsSet.NAME_ENTER_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "unspecifiled " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_UNSPECIFIED, expectedKey);
}
}
use of android.view.inputmethod.InputMethodSubtype in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class CryptKeeper method hasMultipleEnabledIMEsOrSubtypes.
/**
* Method adapted from com.android.inputmethod.latin.Utils
*
* @param imm The input method manager
* @param shouldIncludeAuxiliarySubtypes
* @return true if we have multiple IMEs to choose from
*/
private boolean hasMultipleEnabledIMEsOrSubtypes(InputMethodManager imm, final boolean shouldIncludeAuxiliarySubtypes) {
final List<InputMethodInfo> enabledImis = imm.getEnabledInputMethodList();
// Number of the filtered IMEs
int filteredImisCount = 0;
for (InputMethodInfo imi : enabledImis) {
// We can return true immediately after we find two or more filtered IMEs.
if (filteredImisCount > 1)
return true;
final List<InputMethodSubtype> subtypes = imm.getEnabledInputMethodSubtypeList(imi, true);
// IMEs that have no subtypes should be counted.
if (subtypes.isEmpty()) {
++filteredImisCount;
continue;
}
int auxCount = 0;
for (InputMethodSubtype subtype : subtypes) {
if (subtype.isAuxiliary()) {
++auxCount;
}
}
final int nonAuxCount = subtypes.size() - auxCount;
// subtypes should be counted as well.
if (nonAuxCount > 0 || (shouldIncludeAuxiliarySubtypes && auxCount > 1)) {
++filteredImisCount;
continue;
}
}
return filteredImisCount > 1 || // input method subtype (The current IME should be LatinIME.)
imm.getEnabledInputMethodSubtypeList(null, false).size() > 1;
}
use of android.view.inputmethod.InputMethodSubtype in project robolectric by robolectric.
the class ShadowInputMethodManagerTest method setCurrentInputMethodSubtype_isReturned.
/**
* The builder is only available for 19+.
*/
@Config(minSdk = KITKAT)
@Test
public void setCurrentInputMethodSubtype_isReturned() {
InputMethodSubtype inputMethodSubtype = new InputMethodSubtypeBuilder().build();
shadow.setCurrentInputMethodSubtype(inputMethodSubtype);
assertThat(manager.getCurrentInputMethodSubtype()).isEqualTo(inputMethodSubtype);
}
Aggregations