diff options
author | 2010-09-22 00:10:16 -0700 | |
---|---|---|
committer | 2010-09-22 00:10:16 -0700 | |
commit | db6b89711823fc2d5282286a8efaa3d94bae32cb (patch) | |
tree | e6e35227d5ee9252b7c8e19d233e8341b4a8c85d /java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java | |
parent | 60f6e5d461156c386e632a29e418e04e6d146d51 (diff) | |
parent | 7c120ce4872398ea4f61a67aba1d069e45f1c012 (diff) | |
download | latinime-db6b89711823fc2d5282286a8efaa3d94bae32cb.tar.gz latinime-db6b89711823fc2d5282286a8efaa3d94bae32cb.tar.xz latinime-db6b89711823fc2d5282286a8efaa3d94bae32cb.zip |
am 7c120ce4: am 3a2896c8: Fix issue space key preview remains on screen and would not dismiss
Merge commit '7c120ce4872398ea4f61a67aba1d069e45f1c012'
* commit '7c120ce4872398ea4f61a67aba1d069e45f1c012':
Fix issue space key preview remains on screen and would not dismiss
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java index 26b3c0581..fd25d7521 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java @@ -881,8 +881,17 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx public void showPreview(int keyIndex, PointerTracker tracker) { int oldKeyIndex = mOldPreviewKeyIndex; mOldPreviewKeyIndex = keyIndex; - // If key changed and preview is on ... - if (oldKeyIndex != keyIndex && mShowPreview) { + final boolean isLanguageSwitchEnabled = (mKeyboard instanceof LatinKeyboard) + && ((LatinKeyboard)mKeyboard).isLanguageSwitchEnabled(); + // We should re-draw popup preview when 1) we need to hide the preview, 2) we will show + // the space key preview and 3) pointer moves off the space key to other letter key, we + // should hide the preview of the previous key. + final boolean hidePreviewOrShowSpaceKeyPreview = (tracker == null) + || tracker.isSpaceKey(keyIndex) || tracker.isSpaceKey(oldKeyIndex); + // If key changed and preview is on or the key is space (language switch is enabled) + if (oldKeyIndex != keyIndex + && (mShowPreview + || (hidePreviewOrShowSpaceKeyPreview && isLanguageSwitchEnabled))) { if (keyIndex == NOT_A_KEY) { mHandler.cancelPopupPreview(); mHandler.dismissPreview(DELAY_AFTER_PREVIEW); |