From f1678ba8024606349bc184cfeaead2be059f7b5b Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 12 Apr 2012 15:33:48 +0900 Subject: [PATCH] Don't cancel key typing timer when new keyboard is set This change also fixes some typos. Bug: 6312143 Change-Id: I5d752c05b128a47ed022a4a804b02559eeee6915 --- java/proguard.flags | 2 +- .../com/android/inputmethod/keyboard/KeyboardView.java | 8 ++++---- .../android/inputmethod/keyboard/LatinKeyboardView.java | 7 +------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/java/proguard.flags b/java/proguard.flags index 6cc3342dc..fd73e1242 100644 --- a/java/proguard.flags +++ b/java/proguard.flags @@ -28,7 +28,7 @@ # Keep getter/setter methods for ObjectAnimator int getLanguageOnSpacebarAnimAlpha(); void setLanguageOnSpacebarAnimAlpha(int); - int getAltCodeKeyWhileTypingAnimAlhpa(); + int getAltCodeKeyWhileTypingAnimAlpha(); void setAltCodeKeyWhileTypingAnimAlpha(int); } diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index b51dbb906..804ccf658 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -260,7 +260,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { mKeyHintLabelSize = (int)(keyHeight * mKeyHintLabelRatio); } - public void brendAlpha(Paint paint) { + public void blendAlpha(Paint paint) { final int color = paint.getColor(); paint.setARGB((paint.getAlpha() * mAnimAlpha) / ALPHA_OPAQUE, Color.red(color), Color.green(color), Color.blue(color)); @@ -600,7 +600,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { // Make label invisible paint.setColor(Color.TRANSPARENT); } - params.brendAlpha(paint); + params.blendAlpha(paint); canvas.drawText(label, 0, label.length(), positionX, baseline, paint); // Turn off drop shadow and reset x-scale. paint.setShadowLayer(0, 0, 0, 0); @@ -645,7 +645,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { hintSize = params.mKeyHintLetterSize; } paint.setColor(hintColor); - params.brendAlpha(paint); + params.blendAlpha(paint); paint.setTextSize(hintSize); final float hintX, hintY; if (key.hasHintLabel()) { @@ -715,7 +715,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { paint.setTextSize(params.mKeyHintLetterSize); paint.setColor(params.mKeyHintLabelColor); - params.brendAlpha(paint); + params.blendAlpha(paint); paint.setTextAlign(Align.CENTER); final float hintX = keyWidth - params.mKeyHintLetterPadding - getCharWidth(KEY_LABEL_REFERENCE_CHAR, paint) / 2; diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java index 5ebf92cf7..a08c0743a 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java @@ -239,14 +239,10 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke } } - private void cancelTypingStateTimer() { - removeMessages(MSG_TYPING_STATE_EXPIRED); - } - @Override public void startTypingStateTimer() { final boolean isTyping = isTypingState(); - cancelTypingStateTimer(); + removeMessages(MSG_TYPING_STATE_EXPIRED); sendMessageDelayed( obtainMessage(MSG_TYPING_STATE_EXPIRED), mParams.mIgnoreAltCodeKeyTimeout); if (isTyping) { @@ -286,7 +282,6 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke public void cancelAllMessages() { cancelKeyTimers(); - cancelTypingStateTimer(); } }