Fix forwarding event only when sending view is visible

Bug: 15579941
Change-Id: I25c19068ae4ad26b1ff64ffccf36ef8dd58ed295
Tadashi G. Takaoka 2014-06-13 15:12:02 +09:00
parent c1cb930dde
commit 28593b5325
1 changed files with 6 additions and 1 deletions

View File

@ -202,7 +202,12 @@ public final class InputView extends LinearLayout {
@Override
protected boolean needsToForward(final int x, final int y) {
return isInKeyboardTopPadding(y);
// Forwarding an event only when {@link MainKeyboardView} is visible.
// Because the visibility of {@link MainKeyboardView} is controlled by its parent
// view in {@link KeyboardSwitcher#setMainKeyboardFrame()}, we should check the
// visibility of the parent view.
final View mainKeyboardFrame = (View)mSenderView.getParent();
return mainKeyboardFrame.getVisibility() == View.VISIBLE && isInKeyboardTopPadding(y);
}
@Override