diff options
author | satok <satok@google.com> | 2010-12-14 13:58:49 +0900 |
---|---|---|
committer | satok <satok@google.com> | 2010-12-14 14:32:57 +0900 |
commit | a84b8d94fbe20a2d51902da29ff00a57e1851dbe (patch) | |
tree | 237bf9cf0766f8356dfdc5be0dce115481ac7a4c /packages | |
parent | 4e47e716d681b56f6ed2a262ddfd40e0c7a296f5 (diff) | |
download | frameworks_base-a84b8d94fbe20a2d51902da29ff00a57e1851dbe.zip frameworks_base-a84b8d94fbe20a2d51902da29ff00a57e1851dbe.tar.gz frameworks_base-a84b8d94fbe20a2d51902da29ff00a57e1851dbe.tar.bz2 |
Hide ime switch icon when there are only one IME and no enabled subtypes
Change-Id: I4684d852cc61db125538e1255fd99fa55d60d593
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java index 66ed727..aa431bc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java @@ -157,6 +157,17 @@ public class InputMethodButton extends ImageView { return null; } + // Display IME switcher icon only when all of the followings are true: + // * There is only one enabled IME on the device. (Note that the IME should be the system IME) + // * There are no explicitly enabled (by the user) subtypes of the IME, or the IME doesn't have + // its subtypes at all + private boolean needsToShowIMEButton() { + List<InputMethodInfo> imis = mImm.getInputMethodList(); + final int size = imis.size(); + return size > 1 + || (size == 1 && mImm.getEnabledInputMethodSubtypeList(imis.get(0)).size() > 1); + } + private void refreshStatusIcon(boolean keyboardShown) { if (!keyboardShown) { setVisibility(View.INVISIBLE); @@ -187,7 +198,7 @@ public class InputMethodButton extends ImageView { public void setIMEButtonVisible(IBinder token, boolean visible) { mToken = token; - mKeyboardShown = visible; + mKeyboardShown = visible ? needsToShowIMEButton() : false; refreshStatusIcon(mKeyboardShown); } } |