diff options
author | 2014-06-13 15:12:02 +0900 | |
---|---|---|
committer | 2014-06-13 15:12:02 +0900 | |
commit | 28593b5325e0be2029cd7c27761494a3560148b6 (patch) | |
tree | a2b1abf17409ae5c1fe51ca6264f0e520370f8dd /java/src/com/android/inputmethod/latin/InputView.java | |
parent | c1cb930dde27414a0d8b15ae345650d41ba56add (diff) | |
download | latinime-28593b5325e0be2029cd7c27761494a3560148b6.tar.gz latinime-28593b5325e0be2029cd7c27761494a3560148b6.tar.xz latinime-28593b5325e0be2029cd7c27761494a3560148b6.zip |
Fix forwarding event only when sending view is visible
Bug: 15579941
Change-Id: I25c19068ae4ad26b1ff64ffccf36ef8dd58ed295
Diffstat (limited to 'java/src/com/android/inputmethod/latin/InputView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/InputView.java | 7 |
1 files changed, 6 insertions, 1 deletions
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 |