diff options
author | 2013-04-26 15:50:12 +0900 | |
---|---|---|
committer | 2013-04-26 16:14:18 +0900 | |
commit | 5141f04ef3b213fbe4816168d1c42f30449fc446 (patch) | |
tree | b72a696e02fb49ae1474b87ed02cdd90cd085363 /java/src | |
parent | 9fc82bdb169f20fd0e42297dbb54e66ac87486bd (diff) | |
download | latinime-5141f04ef3b213fbe4816168d1c42f30449fc446.tar.gz latinime-5141f04ef3b213fbe4816168d1c42f30449fc446.tar.xz latinime-5141f04ef3b213fbe4816168d1c42f30449fc446.zip |
Fix graying animation of alt-code keys when space/enter is typed
Change-Id: Iac508f37afa916ca52c62c2369cb7ff91bde0a64
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/MainKeyboardView.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 8d4beeced..a0ac47535 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -370,7 +370,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack // When user hits the space or the enter key, just cancel the while-typing timer. final int typedCode = typedKey.mCode; if (typedCode == Constants.CODE_SPACE || typedCode == Constants.CODE_ENTER) { - startWhileTypingFadeinAnimation(keyboardView); + if (isTyping) { + startWhileTypingFadeinAnimation(keyboardView); + } return; } @@ -614,8 +616,18 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack @ExternallyReferenced public void setAltCodeKeyWhileTypingAnimAlpha(final int alpha) { + if (mAltCodeKeyWhileTypingAnimAlpha == alpha) { + return; + } + // Update the visual of alt-code-key-while-typing. mAltCodeKeyWhileTypingAnimAlpha = alpha; - updateAltCodeKeyWhileTyping(); + final Keyboard keyboard = getKeyboard(); + if (keyboard == null) { + return; + } + for (final Key key : keyboard.mAltCodeKeysWhileTyping) { + invalidateKey(key); + } } public void setKeyboardActionListener(final KeyboardActionListener listener) { @@ -1282,16 +1294,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack invalidateKey(shortcutKey); } - private void updateAltCodeKeyWhileTyping() { - final Keyboard keyboard = getKeyboard(); - if (keyboard == null) { - return; - } - for (final Key key : keyboard.mAltCodeKeysWhileTyping) { - invalidateKey(key); - } - } - public void startDisplayLanguageOnSpacebar(final boolean subtypeChanged, final boolean needsToDisplayLanguage, final boolean hasMultipleEnabledIMEsOrSubtypes) { mNeedsToDisplayLanguage = needsToDisplayLanguage; |