blazsolar / HorizontalPicker

Android widget allowing user to select one item from set of them by swiping left and right.
http://blaz.solar/HorizontalPicker
Apache License 2.0
227 stars 81 forks source link

ArrayIndexOutOfBoundsException when setting sideItem #51

Open Ormaz opened 8 years ago

Ormaz commented 8 years ago

Hello,

I have some issues with the picker. My app is crashing everytime I set the side item and when I start to scroll or if the array has only one element. It's happening only in my phone, that's quite weird. Furthermore, is it possible to change the text color of the middle item and not for all the elements?

Thanks!

capture d ecran 2016-05-09 a 12 16 33

akul1994 commented 7 years ago

hey. i'm getting the same error. any fix for this?

jpage4500 commented 7 years ago

I'm getting reports of a crash via Crashlytics so I can't say for sure how it's reproduced - but looks like the same error here:

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
       at com.wefika.horizontalpicker.HorizontalPicker$PickerTouchHelper.onPopulateNodeForVirtualView(HorizontalPicker.java:1310)
       at android.support.v4.widget.ExploreByTouchHelper.createNodeForChild(ExploreByTouchHelper.java:803)
       at android.support.v4.widget.ExploreByTouchHelper.obtainAccessibilityNodeInfo(ExploreByTouchHelper.java:724)
       at android.support.v4.widget.ExploreByTouchHelper$MyNodeProvider.createAccessibilityNodeInfo(ExploreByTouchHelper.java:1245)
       at android.support.v4.view.accessibility.AccessibilityNodeProviderCompat$AccessibilityNodeProviderKitKatImpl$1.createAccessibilityNodeInfo(AccessibilityNodeProviderCompat.java:130)
       at android.support.v4.view.accessibility.AccessibilityNodeProviderCompatKitKat$1.createAccessibilityNodeInfo(AccessibilityNodeProviderCompatKitKat.java:47)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfVirtualNode(AccessibilityInteractionController.java:1232)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1135)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1131)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1131)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1131)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1131)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:932)
       at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:202)
       at android.view.AccessibilityInteractionController.-wrap1(AccessibilityInteractionController.java)
       at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1292)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6682)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
mustafaguven commented 5 years ago

I'm getting reports of a crash via Crashlytics so I can't say for sure how it's reproduced - but looks like the same error here:

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
       at com.wefika.horizontalpicker.HorizontalPicker$PickerTouchHelper.onPopulateNodeForVirtualView(HorizontalPicker.java:1310)
       at android.support.v4.widget.ExploreByTouchHelper.createNodeForChild(ExploreByTouchHelper.java:803)
       at android.support.v4.widget.ExploreByTouchHelper.obtainAccessibilityNodeInfo(ExploreByTouchHelper.java:724)
       at android.support.v4.widget.ExploreByTouchHelper$MyNodeProvider.createAccessibilityNodeInfo(ExploreByTouchHelper.java:1245)
       at android.support.v4.view.accessibility.AccessibilityNodeProviderCompat$AccessibilityNodeProviderKitKatImpl$1.createAccessibilityNodeInfo(AccessibilityNodeProviderCompat.java:130)
       at android.support.v4.view.accessibility.AccessibilityNodeProviderCompatKitKat$1.createAccessibilityNodeInfo(AccessibilityNodeProviderCompatKitKat.java:47)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfVirtualNode(AccessibilityInteractionController.java:1232)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1135)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1131)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1131)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1131)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1131)
       at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:932)
       at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:202)
       at android.view.AccessibilityInteractionController.-wrap1(AccessibilityInteractionController.java)
       at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1292)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6682)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

I know its been a long time but did you solve this issue in some way?

nick2525 commented 2 years ago

@jpage4500 Is this library abandoned? I have the same bug