From 28593b5325e0be2029cd7c27761494a3560148b6 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 13 Jun 2014 15:12:02 +0900 Subject: [PATCH] Fix forwarding event only when sending view is visible Bug: 15579941 Change-Id: I25c19068ae4ad26b1ff64ffccf36ef8dd58ed295 --- java/src/com/android/inputmethod/latin/InputView.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/InputView.java b/java/src/com/android/inputmethod/latin/InputView.java index 0801cfa88..e9e12f09f 100644 --- a/java/src/com/android/inputmethod/latin/InputView.java +++ b/java/src/com/android/inputmethod/latin/InputView.java @@ -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