summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2019-06-05 09:57:01 -0700
committer Winson Chung <winsonc@google.com> 2019-06-05 10:00:42 -0700
commitd882ce1971110b517f5072b43ff4caab837193db (patch)
tree6bebaf5cb0368f53c346ef6258ff2d57f5b5fb65
parentf5671d390d0dfebec37f62bfff7228cd23cd1b59 (diff)
Ensure that the IME switcher button is always touchable
Bug: 134521910 Test: Manual, plug in external keyboard and ensure the IME switcher is tappable Change-Id: Ic76fc3f85f2862a628810888b651ecaa284a4a5f
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 3ec16090ea87..4bc003647e4f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -238,7 +238,19 @@ public class NavigationBarView extends FrameLayout implements
info.setTouchableInsets(InternalInsetsInfo.TOUCHABLE_INSETS_FRAME);
return;
}
+
info.setTouchableInsets(InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
+ ButtonDispatcher imeSwitchButton = getImeSwitchButton();
+ if (imeSwitchButton.getVisibility() == VISIBLE) {
+ // If the IME is not up, but the ime switch button is visible, then make sure that
+ // button is touchable
+ int[] loc = new int[2];
+ View buttonView = imeSwitchButton.getCurrentView();
+ buttonView.getLocationInWindow(loc);
+ info.touchableRegion.set(loc[0], loc[1], loc[0] + buttonView.getWidth(),
+ loc[1] + buttonView.getHeight());
+ return;
+ }
info.touchableRegion.setEmpty();
};