We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e0e18ac + f2410fb commit c15d7f9Copy full SHA for c15d7f9
library/src/com/sothree/slidinguppanel/ViewDragHelper.java
@@ -843,7 +843,9 @@ private void saveLastMotion(MotionEvent ev) {
843
final int pointerId = MotionEventCompat.getPointerId(ev, i);
844
final float x = MotionEventCompat.getX(ev, i);
845
final float y = MotionEventCompat.getY(ev, i);
846
- if (mLastMotionX != null && mLastMotionY != null) {
+ // Sometimes we can try and save last motion for a pointer never recorded in initial motion. In this case we just discard it.
847
+ if (mLastMotionX != null && mLastMotionY != null
848
+ && mLastMotionX.length > pointerId && mLastMotionY.length > pointerId) {
849
mLastMotionX[pointerId] = x;
850
mLastMotionY[pointerId] = y;
851
}
0 commit comments