Don't cancel key typing timer when new keyboard is set
This change also fixes some typos. Bug: 6312143 Change-Id: I5d752c05b128a47ed022a4a804b02559eeee6915main
parent
4c9b2504e2
commit
f1678ba802
|
@ -28,7 +28,7 @@
|
||||||
# Keep getter/setter methods for ObjectAnimator
|
# Keep getter/setter methods for ObjectAnimator
|
||||||
int getLanguageOnSpacebarAnimAlpha();
|
int getLanguageOnSpacebarAnimAlpha();
|
||||||
void setLanguageOnSpacebarAnimAlpha(int);
|
void setLanguageOnSpacebarAnimAlpha(int);
|
||||||
int getAltCodeKeyWhileTypingAnimAlhpa();
|
int getAltCodeKeyWhileTypingAnimAlpha();
|
||||||
void setAltCodeKeyWhileTypingAnimAlpha(int);
|
void setAltCodeKeyWhileTypingAnimAlpha(int);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -260,7 +260,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
|
||||||
mKeyHintLabelSize = (int)(keyHeight * mKeyHintLabelRatio);
|
mKeyHintLabelSize = (int)(keyHeight * mKeyHintLabelRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void brendAlpha(Paint paint) {
|
public void blendAlpha(Paint paint) {
|
||||||
final int color = paint.getColor();
|
final int color = paint.getColor();
|
||||||
paint.setARGB((paint.getAlpha() * mAnimAlpha) / ALPHA_OPAQUE,
|
paint.setARGB((paint.getAlpha() * mAnimAlpha) / ALPHA_OPAQUE,
|
||||||
Color.red(color), Color.green(color), Color.blue(color));
|
Color.red(color), Color.green(color), Color.blue(color));
|
||||||
|
@ -600,7 +600,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
|
||||||
// Make label invisible
|
// Make label invisible
|
||||||
paint.setColor(Color.TRANSPARENT);
|
paint.setColor(Color.TRANSPARENT);
|
||||||
}
|
}
|
||||||
params.brendAlpha(paint);
|
params.blendAlpha(paint);
|
||||||
canvas.drawText(label, 0, label.length(), positionX, baseline, paint);
|
canvas.drawText(label, 0, label.length(), positionX, baseline, paint);
|
||||||
// Turn off drop shadow and reset x-scale.
|
// Turn off drop shadow and reset x-scale.
|
||||||
paint.setShadowLayer(0, 0, 0, 0);
|
paint.setShadowLayer(0, 0, 0, 0);
|
||||||
|
@ -645,7 +645,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
|
||||||
hintSize = params.mKeyHintLetterSize;
|
hintSize = params.mKeyHintLetterSize;
|
||||||
}
|
}
|
||||||
paint.setColor(hintColor);
|
paint.setColor(hintColor);
|
||||||
params.brendAlpha(paint);
|
params.blendAlpha(paint);
|
||||||
paint.setTextSize(hintSize);
|
paint.setTextSize(hintSize);
|
||||||
final float hintX, hintY;
|
final float hintX, hintY;
|
||||||
if (key.hasHintLabel()) {
|
if (key.hasHintLabel()) {
|
||||||
|
@ -715,7 +715,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
|
||||||
|
|
||||||
paint.setTextSize(params.mKeyHintLetterSize);
|
paint.setTextSize(params.mKeyHintLetterSize);
|
||||||
paint.setColor(params.mKeyHintLabelColor);
|
paint.setColor(params.mKeyHintLabelColor);
|
||||||
params.brendAlpha(paint);
|
params.blendAlpha(paint);
|
||||||
paint.setTextAlign(Align.CENTER);
|
paint.setTextAlign(Align.CENTER);
|
||||||
final float hintX = keyWidth - params.mKeyHintLetterPadding
|
final float hintX = keyWidth - params.mKeyHintLetterPadding
|
||||||
- getCharWidth(KEY_LABEL_REFERENCE_CHAR, paint) / 2;
|
- getCharWidth(KEY_LABEL_REFERENCE_CHAR, paint) / 2;
|
||||||
|
|
|
@ -239,14 +239,10 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cancelTypingStateTimer() {
|
|
||||||
removeMessages(MSG_TYPING_STATE_EXPIRED);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startTypingStateTimer() {
|
public void startTypingStateTimer() {
|
||||||
final boolean isTyping = isTypingState();
|
final boolean isTyping = isTypingState();
|
||||||
cancelTypingStateTimer();
|
removeMessages(MSG_TYPING_STATE_EXPIRED);
|
||||||
sendMessageDelayed(
|
sendMessageDelayed(
|
||||||
obtainMessage(MSG_TYPING_STATE_EXPIRED), mParams.mIgnoreAltCodeKeyTimeout);
|
obtainMessage(MSG_TYPING_STATE_EXPIRED), mParams.mIgnoreAltCodeKeyTimeout);
|
||||||
if (isTyping) {
|
if (isTyping) {
|
||||||
|
@ -286,7 +282,6 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
|
||||||
|
|
||||||
public void cancelAllMessages() {
|
public void cancelAllMessages() {
|
||||||
cancelKeyTimers();
|
cancelKeyTimers();
|
||||||
cancelTypingStateTimer();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue