diff options
| author | 2022-05-11 18:49:29 +0000 | |
|---|---|---|
| committer | 2022-05-11 23:11:17 +0000 | |
| commit | 0c4b89a6fe11b05824e5a3ba2f13541f6d2b72f2 (patch) | |
| tree | 5533a7225135b41b5aee1e21470295c856730f11 | |
| parent | 827c5557cd8d2d58f71fb7651a5b39846e5b0046 (diff) | |
Remove usage of raw event coordinates for touch slop calculation
- This change was added in ag/3737691 for 2 button mode which is now
removed from the system, using the raw coordinates is problematic
since they depend on device orientation
Bug: 231636998
Test: Enable 3 button, rotate to landscape and verify unpinning works
Change-Id: I3f942a00570d516a7642182ff1412b17cd5464ff
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/navigationbar/buttons/KeyButtonView.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/KeyButtonView.java index d27b71673ce5..622f5a279a5f 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/KeyButtonView.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/buttons/KeyButtonView.java @@ -273,9 +273,8 @@ public class KeyButtonView extends ImageView implements ButtonInterface { mLongClicked = false; setPressed(true); - // Use raw X and Y to detect gestures in case a parent changes the x and y values - mTouchDownX = (int) ev.getRawX(); - mTouchDownY = (int) ev.getRawY(); + mTouchDownX = (int) ev.getX(); + mTouchDownY = (int) ev.getY(); if (mCode != KEYCODE_UNKNOWN) { sendEvent(KeyEvent.ACTION_DOWN, 0, mDownTime); } else { @@ -289,8 +288,8 @@ public class KeyButtonView extends ImageView implements ButtonInterface { postDelayed(mCheckLongPress, ViewConfiguration.getLongPressTimeout()); break; case MotionEvent.ACTION_MOVE: - x = (int)ev.getRawX(); - y = (int)ev.getRawY(); + x = (int) ev.getX(); + y = (int) ev.getY(); float slop = QuickStepContract.getQuickStepTouchSlopPx(getContext()); if (Math.abs(x - mTouchDownX) > slop || Math.abs(y - mTouchDownY) > slop) { |