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

Commit a8b1563d authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Fix stale key drawing" into jb-dev

parents 71b047e3 b7a5a682
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -197,6 +197,20 @@ public class Keyboard {
        return null;
    }

    public boolean hasKey(Key aKey) {
        if (mKeyCache.containsKey(aKey)) {
            return true;
        }

        for (final Key key : mKeys) {
            if (key == aKey) {
                mKeyCache.put(key.mCode, key);
                return true;
            }
        }
        return false;
    }

    public static boolean isLetterCode(int code) {
        return code >= MINIMUM_LETTER_CODE;
    }
+3 −0
Original line number Diff line number Diff line
@@ -487,6 +487,9 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
        } else {
            // Draw invalidated keys.
            for (final Key key : mInvalidatedKeys) {
                if (!mKeyboard.hasKey(key)) {
                    continue;
                }
                final int x = key.mX + getPaddingLeft();
                final int y = key.mY + getPaddingTop();
                mInvalidatedKeysRect.set(x, y, x + key.mWidth, y + key.mHeight);