Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException, pointerIndex out of range when touching two vertical seekbars simultaneously multiple times #4

Open
iAlexM opened this issue Jun 8, 2016 · 4 comments

Comments

@iAlexM
Copy link

iAlexM commented Jun 8, 2016

If I have two vertical seekbars and I touch them simultaneously multiple times the app crashes: (fairly easy to replicate
the implementation is described below:
Here is the implementation:

<com.h6ah4i.android.widget.verticalseekbar.VerticalSeekBarWrapper
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_centerHorizontal="true"
            android:layout_below="@+id/left">

            <com.h6ah4i.android.widget.verticalseekbar.VerticalSeekBar
                android:id="@+id/vsb_volume_left"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:thumb="@drawable/drag_thumb_left"
                android:progressDrawable="@drawable/seekbar_progressbar"
                android:progress="50"
                android:maxHeight="9dp"
                android:minHeight="9dp"
                app:seekBarRotation="CW270"          
</com.h6ah4i.android.widget.verticalseekbar.VerticalSeekBarWrapper>
``
    <com.h6ah4i.android.widget.verticalseekbar.VerticalSeekBarWrapper
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_centerHorizontal="true"
            android:layout_below="@+id/right">

            <com.h6ah4i.android.widget.verticalseekbar.VerticalSeekBar
                android:id="@+id/vsb_volume_right"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:maxHeight="9dp"
                android:minHeight="9dp"
                android:thumb="@drawable/drag_thumb_right"
                android:progressDrawable="@drawable/seekbar_progressbar"
                app:seekBarRotation="CW270" />
        </com.h6ah4i.android.widget.verticalseekbar.VerticalSeekBarWrapper>

*No java side implementation
Here is the log:
```
06-08 17:37:05.286 11486-11486/com.domain.test E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.domain.test, PID: 11486
java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java:2074)
at android.support.v4.view.MotionEventCompatEclair.getX(MotionEventCompatEclair.java:32)
at android.support.v4.view.MotionEventCompat$EclairMotionEventVersionImpl.getX(MotionEventCompat.java:110)
at android.support.v4.view.MotionEventCompat.getX(MotionEventCompat.java:462)
at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:1987)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2108)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
at android.app.Activity.dispatchTouchEvent(Activity.java:2771)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
at android.view.View.dispatchPointerEvent(View.java:9520)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4238)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4104)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3703)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3669)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3795)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3677)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3852)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3703)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3669)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3677)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3650)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5932)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5906)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5867)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6035)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176)
at android.view.ViewRootImpl.doConsumeBatch

*this issue does not happen with standard SeekBar object
@h6ah4i h6ah4i added the bug label Jun 8, 2016
@h6ah4i h6ah4i self-assigned this Jun 8, 2016
@h6ah4i
Copy link
Owner

h6ah4i commented Jun 8, 2016

Thank you for the issue report. I will take a look at it.

@AdrianVidaurre
Copy link

I have the same issue when I implement two vertical seekbars.

@h6ah4i
Copy link
Owner

h6ah4i commented Jun 12, 2016

I think this is not an issue of this library. Unfortunately, it is a known bug of ViewPager.

@CalebMacdonaldBlack
Copy link

Use this in a wrapping view to disable pressing two vertical bars at once. android:splitMotionEvents="false"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants