-
Notifications
You must be signed in to change notification settings - Fork 554
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
[5.0.0-b6] Duplicate SubItems when starting with expanded Headers #95
Comments
@bornest, can you enable debug log, and post here it? Also in the demo app the collapsed header last item works fine. |
I call setExpanded(true); in my ExpandableHeaderItem constructor. Here's the log of my Fragment creation and initialization (from click on navigation drawer item till everything is loaded):
And here's the log of what happens when I try to collapse the last header:
|
@bornest, could you also give the part of the code with all the calls of the Adapter when you start the Activity? |
I've encountered an interesting bug:
if Header is set to be Expanded in constructor or at any time before it's passed to Adapter,
its SubItems are duplicated (and sometimes tripled) when displayed.
[I've checked the list that I pass to updateDataSet() - it has no duplicates]
If you collapse this header and expand it again, duplicates disappear.
But if it is the last header in the list, the app crashes when you try to collapse it
with following exception
FATAL EXCEPTION: main Process: , PID: 12372 java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{1630a510 position=44 id=-1, oldPos=45, pLpos:45 scrap [attachedScrap] tmpDetached no parent} at android.support.v7.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:4505) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4636) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4617) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1994) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1390) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1353) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:574) at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:2979) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2904) at android.support.v7.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1482) at android.support.v7.widget.RecyclerView.access$400(RecyclerView.java:147) at android.support.v7.widget.RecyclerView$1.run(RecyclerView.java:294) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:549) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) 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:5294) 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:904) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:115)
And if you set the Header to be Collapsed in constructor or at any time before it's passed to Adapter,
there are no duplicate SubItems and everything is OK.
(I wonder why example app doesn't have this issue)
The text was updated successfully, but these errors were encountered: