diff options
author | Winson <winsonc@google.com> | 2015-10-12 16:18:36 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2015-10-12 23:54:59 +0000 |
commit | c14a11e88241cb0b75f98a9af2c4061d14e1b4a6 (patch) | |
tree | 02552bc9f2189af002d1c08589bec896391d972c /packages | |
parent | 7a097ff159466c4e887f1c821aeaa545f80e54b6 (diff) | |
download | frameworks_base-c14a11e88241cb0b75f98a9af2c4061d14e1b4a6.zip frameworks_base-c14a11e88241cb0b75f98a9af2c4061d14e1b4a6.tar.gz frameworks_base-c14a11e88241cb0b75f98a9af2c4061d14e1b4a6.tar.bz2 |
Ensure we update the active pointer id on pointer up/down.
Bug: 24841350
Change-Id: Id5d91ee8adbb638caf66976d701cfbc0befaca04
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java index 2e0b80a..be618e2 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java @@ -162,6 +162,14 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { mVelocityTracker.addMovement(createMotionEventForStackScroll(ev)); break; } + case MotionEvent.ACTION_POINTER_DOWN: { + final int index = ev.getActionIndex(); + mActivePointerId = ev.getPointerId(index); + mLastMotionX = (int) ev.getX(index); + mLastMotionY = (int) ev.getY(index); + mLastP = mSv.mLayoutAlgorithm.screenYToCurveProgress(mLastMotionY); + break; + } case MotionEvent.ACTION_MOVE: { if (mActivePointerId == INACTIVE_POINTER_ID) break; @@ -187,6 +195,20 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { mLastP = mSv.mLayoutAlgorithm.screenYToCurveProgress(mLastMotionY); break; } + case MotionEvent.ACTION_POINTER_UP: { + int pointerIndex = ev.getActionIndex(); + int pointerId = ev.getPointerId(pointerIndex); + if (pointerId == mActivePointerId) { + // Select a new active pointer id and reset the motion state + final int newPointerIndex = (pointerIndex == 0) ? 1 : 0; + mActivePointerId = ev.getPointerId(newPointerIndex); + mLastMotionX = (int) ev.getX(newPointerIndex); + mLastMotionY = (int) ev.getY(newPointerIndex); + mLastP = mSv.mLayoutAlgorithm.screenYToCurveProgress(mLastMotionY); + mVelocityTracker.clear(); + } + break; + } case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: { // Animate the scroll back if we've cancelled |