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

Commit 612f8da2 authored by Daniel Sandler's avatar Daniel Sandler Committed by Android (Google) Code Review
Browse files

Merge "Fix pressed states on system bar buttons."

parents a3ebcc9d a101f8f6
Loading
Loading
Loading
Loading
+453 B (1.9 KiB)
Loading image diff...
+922 B (4.58 KiB)
Loading image diff...
+506 B (1.92 KiB)
Loading image diff...
+4 −1
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ public class KeyButtonView extends ImageView {
                mRepeat = 0;
                mSending = true;
                sendEvent(KeyEvent.ACTION_DOWN, mDownTime);
                setPressed(true);
                break;
            case MotionEvent.ACTION_MOVE:
                if (mSending) {
@@ -80,14 +81,16 @@ public class KeyButtonView extends ImageView {
                    if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) {
                        mSending = false;
                        sendEvent(KeyEvent.ACTION_UP);
                        setPressed(false);
                    }
                }
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL:
                if (mSending) {
                    sendEvent(KeyEvent.ACTION_UP);
                    mSending = false;
                    sendEvent(KeyEvent.ACTION_UP);
                    setPressed(false);
                }
                break;
        }