Merge "Fix a bug in the logic to show 3 dots of the ime switcher"
This commit is contained in:
commit
4da8e8e4d3
2 changed files with 16 additions and 5 deletions
|
@ -46,8 +46,8 @@ public class SubtypeSwitcher {
|
||||||
private static boolean DBG = LatinImeLogger.sDBG;
|
private static boolean DBG = LatinImeLogger.sDBG;
|
||||||
private static final String TAG = SubtypeSwitcher.class.getSimpleName();
|
private static final String TAG = SubtypeSwitcher.class.getSimpleName();
|
||||||
|
|
||||||
|
public static final String KEYBOARD_MODE = "keyboard";
|
||||||
private static final char LOCALE_SEPARATER = '_';
|
private static final char LOCALE_SEPARATER = '_';
|
||||||
private static final String KEYBOARD_MODE = "keyboard";
|
|
||||||
private static final String VOICE_MODE = "voice";
|
private static final String VOICE_MODE = "voice";
|
||||||
private static final String SUBTYPE_EXTRAVALUE_REQUIRE_NETWORK_CONNECTIVITY =
|
private static final String SUBTYPE_EXTRAVALUE_REQUIRE_NETWORK_CONNECTIVITY =
|
||||||
"requireNetworkConnectivity";
|
"requireNetworkConnectivity";
|
||||||
|
|
|
@ -154,10 +154,21 @@ public class Utils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return filteredImisCount > 1
|
if (filteredImisCount > 1) {
|
||||||
// imm.getEnabledInputMethodSubtypeList(null, false) will return the current IME's enabled
|
return true;
|
||||||
// input method subtype (The current IME should be LatinIME.)
|
}
|
||||||
|| imm.getEnabledInputMethodSubtypeList(null, false).size() > 1;
|
final List<InputMethodSubtypeCompatWrapper> subtypes =
|
||||||
|
imm.getEnabledInputMethodSubtypeList(null, true);
|
||||||
|
int keyboardCount = 0;
|
||||||
|
// imm.getEnabledInputMethodSubtypeList(null, true) will return the current IME's
|
||||||
|
// both explicitly and implicitly enabled input method subtype.
|
||||||
|
// (The current IME should be LatinIME.)
|
||||||
|
for (InputMethodSubtypeCompatWrapper subtype : subtypes) {
|
||||||
|
if (SubtypeSwitcher.KEYBOARD_MODE.equals(subtype.getMode())) {
|
||||||
|
++keyboardCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return keyboardCount > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getInputMethodId(InputMethodManagerCompatWrapper imm, String packageName) {
|
public static String getInputMethodId(InputMethodManagerCompatWrapper imm, String packageName) {
|
||||||
|
|
Loading…
Reference in a new issue