Jude95 / SwipeBackHelper

make your activity can swipe to close
1.38k stars 268 forks source link

java.lang.IllegalArgumentException: pointerIndex out of range #14

Closed asdzheng closed 8 years ago

asdzheng commented 8 years ago

11-20 11:26:20.157 28454-28454/com.gosport W/System.err: java.lang.IllegalArgumentException: pointerIndex out of range 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.MotionEvent.nativeGetAxisValue(Native Method) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.MotionEvent.getX(MotionEvent.java:1979) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.support.v4.view.MotionEventCompatEclair.getX(MotionEventCompatEclair.java:32) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.support.v4.view.MotionEventCompat$EclairMotionEventVersionImpl.getX(MotionEventCompat.java:91) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.support.v4.view.MotionEventCompat.getX(MotionEventCompat.java:219) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at com.ningmilib.swipeback.ViewDragHelper.processTouchEvent(ViewDragHelper.java:1191) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at com.ningmilib.swipeback.SwipeBackLayout.onTouchEvent(SwipeBackLayout.java:261) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.View.dispatchTouchEvent(View.java:7731) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2212) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1945) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2218) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2198) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1536) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.app.Activity.dispatchTouchEvent(Activity.java:2458) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2146) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.View.dispatchPointerEvent(View.java:7911) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4048) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3927) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3488) 11-20 11:26:20.167 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3538) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3507) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3614) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3515) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3671) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3488) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3538) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3507) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3515) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3488) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5699) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5676) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5647) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5843) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.os.MessageQueue.nativePollOnce(Native Method) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.os.MessageQueue.next(MessageQueue.java:138) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.os.Looper.loop(Looper.java:123) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5094) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at java.lang.reflect.Method.invokeNative(Native Method) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at java.lang.reflect.Method.invoke(Method.java:515) 11-20 11:26:20.177 28454-28454/com.gosport W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893) 11-20 11:26:20.187 28454-28454/com.gosport W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:702) 11-20 11:26:20.187 28454-28454/com.gosport W/System.err: at dalvik.system.NativeStart.main(Native Method)

在有些情况下会报这个错,我去看原来项目的SwipeBackLayout,也有人提过这个问题,不过没修复。我把出错地方的index打印出来,index值为 -1;

这个报错并不会影响滑动。

Jude95 commented 8 years ago

你确定是新版本吗,那一个issue的已经解决过了。

asdzheng commented 8 years ago

我的版本是 '2.1.3'

asdzheng commented 8 years ago

不是说这个项目的issue,我刚才说的是原来那个SwipeBackLayout

Jude95 commented 8 years ago

什么样的操作会引发这个问题?

asdzheng commented 8 years ago

触发规则我也没发现,我把触发面积设置为10%,然后在没有触发的区域滑动,有时就会出现