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

Commit eafd4b4e authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android Git Automerger
Browse files

am 96b444d4: Merge "Remove processMotionEvent from MoreKeysKeyboardView"

* commit '96b444d4':
  Remove processMotionEvent from MoreKeysKeyboardView
parents 6b48c8ba 96b444d4
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -974,9 +974,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
        // {@link KeyboardView#showKeyPreview(PointerTracker)}.
        final int pointY = key.mY + mKeyPreviewDrawParams.mPreviewVisibleOffset;
        moreKeysPanel.showMoreKeysPanel(this, this, pointX, pointY, mKeyboardActionListener);
        final int translatedX = moreKeysPanel.translateX(CoordinateUtils.x(lastCoords));
        final int translatedY = moreKeysPanel.translateY(CoordinateUtils.y(lastCoords));
        tracker.onShowMoreKeysPanel(translatedX, translatedY, moreKeysPanel);
        tracker.onShowMoreKeysPanel(moreKeysPanel);
    }

    public boolean isInSlidingKeyInput() {
+1 −6
Original line number Diff line number Diff line
@@ -198,12 +198,6 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel
        final int x = (int)me.getX(index);
        final int y = (int)me.getY(index);
        final int pointerId = me.getPointerId(index);
        processMotionEvent(action, x, y, pointerId, eventTime);
        return true;
    }

    public void processMotionEvent(final int action, final int x, final int y,
            final int pointerId, final long eventTime) {
        switch (action) {
        case MotionEvent.ACTION_DOWN:
        case MotionEvent.ACTION_POINTER_DOWN:
@@ -217,6 +211,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel
            onMoveEvent(x, y, pointerId, eventTime);
            break;
        }
        return true;
    }

    @Override
+4 −4
Original line number Diff line number Diff line
@@ -1282,12 +1282,12 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
        }
    }

    public void onShowMoreKeysPanel(final int translatedX, final int translatedY,
                final MoreKeysPanel panel) {
    public void onShowMoreKeysPanel(final MoreKeysPanel panel) {
        setReleasedKeyGraphics(mCurrentKey);
        final long eventTime = SystemClock.uptimeMillis();
        final int translatedX = panel.translateX(mLastX);
        final int translatedY = panel.translateY(mLastY);
        panel.onDownEvent(translatedX, translatedY, mPointerId, SystemClock.uptimeMillis());
        mMoreKeysPanel = panel;
        mMoreKeysPanel.onDownEvent(translatedX, translatedY, mPointerId, eventTime);
    }

    @Override
+2 −6
Original line number Diff line number Diff line
@@ -270,15 +270,10 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
            return super.dispatchTouchEvent(me);
        }

        final MoreKeysPanel moreKeysPanel = mMoreSuggestionsView;
        final int action = me.getAction();
        final long eventTime = me.getEventTime();
        final int index = me.getActionIndex();
        final int id = me.getPointerId(index);
        final int x = (int)me.getX(index);
        final int y = (int)me.getY(index);
        final int translatedX = moreKeysPanel.translateX(x);
        final int translatedY = moreKeysPanel.translateY(y);

        if (mMoreSuggestionsMode == MORE_SUGGESTIONS_CHECKING_MODAL_OR_SLIDING) {
            if (Math.abs(x - mOriginX) >= mMoreSuggestionsModalTolerance
@@ -295,7 +290,8 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
        }

        // MORE_SUGGESTIONS_IN_SLIDING_MODE
        mMoreSuggestionsView.processMotionEvent(action, translatedX, translatedY, id, eventTime);
        me.setLocation(mMoreSuggestionsView.translateX(x), mMoreSuggestionsView.translateY(y));
        mMoreSuggestionsView.onTouchEvent(me);
        return true;
    }