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

Commit f501bd56 authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Remove usage of raw event coordinates for touch slop calculation" into tm-dev am: 3777edc2

parents e3c0d446 3777edc2
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -273,9 +273,8 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
                mLongClicked = false;
                mLongClicked = false;
                setPressed(true);
                setPressed(true);


                // Use raw X and Y to detect gestures in case a parent changes the x and y values
                mTouchDownX = (int) ev.getX();
                mTouchDownX = (int) ev.getRawX();
                mTouchDownY = (int) ev.getY();
                mTouchDownY = (int) ev.getRawY();
                if (mCode != KEYCODE_UNKNOWN) {
                if (mCode != KEYCODE_UNKNOWN) {
                    sendEvent(KeyEvent.ACTION_DOWN, 0, mDownTime);
                    sendEvent(KeyEvent.ACTION_DOWN, 0, mDownTime);
                } else {
                } else {
@@ -289,8 +288,8 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
                postDelayed(mCheckLongPress, ViewConfiguration.getLongPressTimeout());
                postDelayed(mCheckLongPress, ViewConfiguration.getLongPressTimeout());
                break;
                break;
            case MotionEvent.ACTION_MOVE:
            case MotionEvent.ACTION_MOVE:
                x = (int)ev.getRawX();
                x = (int) ev.getX();
                y = (int)ev.getRawY();
                y = (int) ev.getY();


                float slop = QuickStepContract.getQuickStepTouchSlopPx(getContext());
                float slop = QuickStepContract.getQuickStepTouchSlopPx(getContext());
                if (Math.abs(x - mTouchDownX) > slop || Math.abs(y - mTouchDownY) > slop) {
                if (Math.abs(x - mTouchDownX) > slop || Math.abs(y - mTouchDownY) > slop) {