Open tsonevn opened 6 years ago
Any news on this ? I have the same problem here
How is this still not fixed? It's breaking the entire app for us on Android and there's no way to solve it..
Are there any options to fix this? Building a reorderable list from scratch might be a little outside of my own capabilities.
Is there any hope that the issue get's resolved.
From @bryce-marshall on June 7, 2018 0:31
Which platform(s) does your issue occur on?
Android I am testing on Android 5.1
Please provide the following version numbers that your issue occurs with:
Please tell us how to recreate the issue in as much detail as possible.
When scrolling a RadListView component with item-reorder enabled AFTER one or more items have been reordered, an exception occurs.
UPDATE: Recreating the layout on the itemReorder event (as described here) does prevent the exception, however it is not a suitable workaround because:
Stack traces below.
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
https://play.nativescript.org/?template=play-ng&id=beBJ2A&v=52
Stack trace from default/standard layout
Bryce CHUWI: ERROR Error: java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling com.telerik.widget.list.RadListView{bb5e2ec VFED.... ........ 0,0-1280,1714 #5}, adapter:com.telerik.widget.list.ListViewWrapperAdapter@32d2a4c, layout:android.support.v7.widget.LinearLayoutManager@1d50214a, context:com.tns.NativeScriptActivity@1d3241e
Bryce CHUWI: An uncaught Exception occurred on "main" thread. java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 25(offset:25).state:26 com.telerik.widget.list.RadListView{bb5e2ec VFED.... ........ 0,0-1280,1714 #5}, adapter:com.telerik.widget.list.ListViewWrapperAdapter@32d2a4c, layout:android.support.v7.widget.LinearLayoutManager@1d50214a, context:com.tns.NativeScriptActivity@1d3241e at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5654) at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:285) at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:342) at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:358) at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:365) at android.support.v7.widget.GapWorker.run(GapWorker.java:396) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5258) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Stack trace from staggered layout
Bryce CHUWI: ERROR Error: java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling com.telerik.widget.list.RadListView{170d73f0 VFED.... ........ 0,0-1280,1609 #5}, adapter:com.telerik.widget.list.ListViewWrapperAdapter@84d411a, layout:android.support.v7.widget.StaggeredGridLayoutManager@1dff03ee, context:com.tns.NativeScriptActivity@d8aca0
Bryce CHUWI: An uncaught Exception occurred on "main" thread. java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 40(offset:40).state:41 com.telerik.widget.list.RadListView{170d73f0 VFED.... ......ID 0,0-1280,1609 #5}, adapter:com.telerik.widget.list.ListViewWrapperAdapter@84d411a, layout:android.support.v7.widget.StaggeredGridLayoutManager@1dff03ee, context:com.tns.NativeScriptActivity@d8aca0 at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5654) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5589) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5585) at android.support.v7.widget.LayoutState.next(LayoutState.java:100) at android.support.v7.widget.StaggeredGridLayoutManager.fill(StaggeredGridLayoutManager.java:1570) at android.support.v7.widget.StaggeredGridLayoutManager.scrollBy(StaggeredGridLayoutManager.java:2142) at android.support.v7.widget.StaggeredGridLayoutManager.scrollVerticallyBy(StaggeredGridLayoutManager.java:2002) at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1790) at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2996) at com.telerik.widget.list.RadListView.onTouchEvent(RadListView.java:542) at android.view.View.dispatchTouchEvent(View.java:8471) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2399) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2092) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2369) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1719) at android.app.Activity.dispatchTouchEvent(Activity.java:2742) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2330) at android.view.View.dispatchPointerEvent(View.java:8666) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4123) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3989) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3597) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3563) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3680) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3571) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3737) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3597) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3563) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3571) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5807) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5781) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5752) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5897) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:143) at android.os.Looper.loop(Looper.java:122) at android.app.ActivityThread.main(ActivityThread.java:5258) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Copied from original issue: NativeScript/NativeScript#5922