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

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

Fix KeyboardView's verticalCorrection handling

Do not correct the touch point if it is within the range of
verticalCorrection from the top of KeyboardView, so that the touch
point will not have negative y-axis value.

Bug: 2659128

Change-Id: I91a3e65fc5dee1383dbbfb45690e307fc0adc1d1
parent 42272759
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1128,7 +1128,9 @@ public class KeyboardView extends View implements View.OnClickListener {

    private boolean onModifiedTouchEvent(MotionEvent me, boolean possiblePoly) {
        int touchX = (int) me.getX() - mPaddingLeft;
        int touchY = (int) me.getY() + mVerticalCorrection - mPaddingTop;
        int touchY = (int) me.getY() - mPaddingTop;
        if (touchY >= -mVerticalCorrection)
            touchY += mVerticalCorrection;
        final int action = me.getAction();
        final long eventTime = me.getEventTime();
        mOldEventTime = eventTime;
+17 −10
Original line number Diff line number Diff line
@@ -24,26 +24,33 @@
    android:keyHeight="@dimen/password_keyboard_key_height"
    >

    <Row>
        <Key android:codes="49" android:keyIcon="@drawable/sym_keyboard_num1" android:keyEdgeFlags="left"/>
    <Row android:rowEdgeFlags="top">
        <Key android:codes="49" android:keyIcon="@drawable/sym_keyboard_num1"
             android:keyEdgeFlags="left"/>
        <Key android:codes="50" android:keyIcon="@drawable/sym_keyboard_num2"/>
        <Key android:codes="51" android:keyIcon="@drawable/sym_keyboard_num3"/>
        <Key android:codes="51" android:keyIcon="@drawable/sym_keyboard_num3"
             android:keyEdgeFlags="right"/>
    </Row>

    <Row>
        <Key android:codes="52" android:keyIcon="@drawable/sym_keyboard_num4" android:keyEdgeFlags="left"/>
        <Key android:codes="52" android:keyIcon="@drawable/sym_keyboard_num4"
             android:keyEdgeFlags="left"/>
        <Key android:codes="53" android:keyIcon="@drawable/sym_keyboard_num5"/>
        <Key android:codes="54" android:keyIcon="@drawable/sym_keyboard_num6"/>
        <Key android:codes="54" android:keyIcon="@drawable/sym_keyboard_num6"
             android:keyEdgeFlags="right"/>
    </Row>

    <Row>
        <Key android:codes="55" android:keyIcon="@drawable/sym_keyboard_num7" android:keyEdgeFlags="left"/>
        <Key android:codes="55" android:keyIcon="@drawable/sym_keyboard_num7"
             android:keyEdgeFlags="left"/>
        <Key android:codes="56" android:keyIcon="@drawable/sym_keyboard_num8"/>
        <Key android:codes="57" android:keyIcon="@drawable/sym_keyboard_num9"/>
        <Key android:codes="57" android:keyIcon="@drawable/sym_keyboard_num9"
             android:keyEdgeFlags="right"/>
    </Row>

    <Row android:rowEdgeFlags="bottom">
        <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_ok"/>
        <Key android:codes="10" android:keyIcon="@drawable/sym_keyboard_ok"
             android:keyEdgeFlags="left"/>
        <Key android:codes="48" android:keyIcon="@drawable/sym_keyboard_num0_no_plus"/>
        <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete"
             android:iconPreview="@drawable/sym_keyboard_feedback_delete"
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
    android:keyHeight="@dimen/password_keyboard_key_height"
    >

    <Row>
    <Row android:rowEdgeFlags="top">
        <Key android:keyLabel="1" android:keyEdgeFlags="left"/>
        <Key android:keyLabel="2"/>
        <Key android:keyLabel="3"/>
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
    android:keyHeight="@dimen/password_keyboard_key_height"
    >

    <Row>
    <Row android:rowEdgeFlags="top">
        <Key android:keyLabel="~" android:keyEdgeFlags="left"/>
        <Key android:keyLabel="`"/>
        <Key android:keyLabel="|"/>