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
This commit is contained in:
Winson Chung
2019-06-05 09:57:01 -07:00
parent f5671d390d
commit d882ce1971

View File

@@ -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();
};