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

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

Merge "Cancel batch input when orientation has been changed"

parents 8fd5aa95 8e2b34cd
Loading
Loading
Loading
Loading
+15 −8
Original line number Diff line number Diff line
@@ -777,6 +777,15 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
        mDrawingProxy.showGesturePreviewTrail(this, isOldestTrackerInQueue(this));
    }

    private void cancelBatchInput() {
        sPointerTrackerQueue.cancelAllPointerTracker();
        sInGesture = false;
        if (DEBUG_LISTENER) {
            Log.d(TAG, String.format("[%d] onCancelBatchInput", mPointerId));
        }
        mListener.onCancelBatchInput();
    }

    public void processMotionEvent(final int action, final int x, final int y, final long eventTime,
            final KeyEventHandler handler) {
        switch (action) {
@@ -892,12 +901,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
            final boolean onValidArea = mGestureStrokeWithPreviewPoints.addPointOnKeyboard(
                    x, y, gestureTime, isMajorEvent);
            if (!onValidArea) {
                sPointerTrackerQueue.cancelAllPointerTracker();
                if (DEBUG_LISTENER) {
                    Log.d(TAG, String.format("[%d] onCancelBatchInput: batchPoints=%d",
                            mPointerId, sAggregratedPointers.getPointerSize()));
                }
                mListener.onCancelBatchInput();
                cancelBatchInput();
                return;
            }
            mayStartBatchInput(key);
@@ -1162,8 +1166,11 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
            printTouchEvent("onCancelEvt:", x, y, eventTime);
        }

        sPointerTrackerQueue.releaseAllPointersExcept(this, eventTime);
        sPointerTrackerQueue.remove(this);
        if (sInGesture) {
            cancelBatchInput();
        }
        sPointerTrackerQueue.cancelAllPointerTracker();
        sPointerTrackerQueue.releaseAllPointers(eventTime);
        onCancelEventInternal();
    }

+5 −4
Original line number Diff line number Diff line
@@ -1553,13 +1553,14 @@ public final class LatinIME extends InputMethodService implements KeyboardAction

    private void showGesturePreviewAndSuggestionStrip(final SuggestedWords suggestedWords,
            final boolean dismissGestureFloatingPreviewText) {
        final String batchInputText = suggestedWords.isEmpty()
                ? null : suggestedWords.getWord(0);
        final KeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
        mainKeyboardView.showGestureFloatingPreviewText(batchInputText);
        showSuggestionStrip(suggestedWords, null);
        final KeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
        if (dismissGestureFloatingPreviewText) {
            mainKeyboardView.dismissGestureFloatingPreviewText();
        } else {
            final String batchInputText = suggestedWords.isEmpty()
                    ? null : suggestedWords.getWord(0);
            mainKeyboardView.showGestureFloatingPreviewText(batchInputText);
        }
    }