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

Commit 4323e112 authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "[CB19] Some refactoring"

parents 750a3557 0f913ff5
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -173,9 +173,7 @@ public final class WordComposer {
        final int keyX = event.mX;
        final int keyY = event.mY;
        final int newIndex = size();
        mCombinerChain.processEvent(mEvents, event);
        mEvents.add(event);
        refreshTypedWordCache();
        processEvent(event);
        mCursorPositionWithinWord = mCodePointSize;
        if (newIndex < MAX_WORD_LENGTH) {
            mPrimaryKeyCodes[newIndex] = primaryCode >= Constants.CODE_SPACE
@@ -200,13 +198,17 @@ public final class WordComposer {
        mAutoCorrection = null;
    }

    private void processEvent(final Event event) {
        mCombinerChain.processEvent(mEvents, event);
        mEvents.add(event);
        refreshTypedWordCache();
    }

    /**
     * Delete the last composing unit as a result of hitting backspace.
     */
    public void deleteLast(final Event event) {
        mCombinerChain.processEvent(mEvents, event);
        mEvents.add(event);
        refreshTypedWordCache();
        processEvent(event);
        // We may have deleted the last one.
        if (0 == size()) {
            mIsFirstCharCapitalized = false;