Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1678ba8 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Don't cancel key typing timer when new keyboard is set

This change also fixes some typos.

Bug: 6312143
Change-Id: I5d752c05b128a47ed022a4a804b02559eeee6915
parent 4c9b2504
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
  # Keep getter/setter methods for ObjectAnimator
  int getLanguageOnSpacebarAnimAlpha();
  void setLanguageOnSpacebarAnimAlpha(int);
  int getAltCodeKeyWhileTypingAnimAlhpa();
  int getAltCodeKeyWhileTypingAnimAlpha();
  void setAltCodeKeyWhileTypingAnimAlpha(int);
}

+4 −4
Original line number Diff line number Diff line
@@ -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;
+1 −6
Original line number Diff line number Diff line
@@ -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();
        }
    }