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

Commit c7bc3d09 authored by Joe Onorato's avatar Joe Onorato Committed by Android (Google) Code Review
Browse files

Merge "Don't cancel the key buttons when you drag outside their bounds."

parents 835ea2f2 abb27777
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -100,18 +100,20 @@ public class KeyButtonView extends ImageView {
                if (mSending) {
                    x = (int)ev.getX();
                    y = (int)ev.getY();
                    if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) {
                    setPressed(x >= 0 && x < getWidth() && y >= 0 &&  y < getHeight());
                }
                break;
            case MotionEvent.ACTION_CANCEL:
                setPressed(false);
                if (mSending && !mLongPressed) {
                    mSending = false;
                    sendEvent(KeyEvent.ACTION_UP,
                            KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY
                                | KeyEvent.FLAG_CANCELED);
                        setPressed(false);
                    removeCallbacks(mCheckLongPress);
                }
                }
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL:
                setPressed(false);
                if (mSending && !mLongPressed) {
                    mSending = false;