shuhart / StickyHeader

A simple lightweight sticky header ItemDecorator for RecyclerView
Apache License 2.0
134 stars 30 forks source link

Possible extra header, and crash in sample app. #5

Open LossyDragon opened 5 years ago

LossyDragon commented 5 years ago

Hello,

I was playing around with the sample app you've provided and I noticed a quirk with the top header, along with a crash.

The first issue might be related to #4, but I did not see a full on extra header. Gif shown below.

https://i.imgur.com/BW2NiG9.gif

The second issue is the crash. Playing with the sample app, if you go a little crazy scrolling up and down, the following crash happens.

`2019-05-22 19:59:58.346 27441-27441/com.shuhart.stickyheader.sample E/AndroidRuntime: FATAL EXCEPTION: main Process: com.shuhart.stickyheader.sample, PID: 27441 java.lang.ArrayIndexOutOfBoundsException: length=33; index=-1 at java.util.ArrayList.get(ArrayList.java:439) at com.shuhart.stickyheader.sample.SectionAdapter.getHeaderPositionForItem(SectionAdapter.java:53) at com.shuhart.stickyheader.StickyHeaderItemDecorator.onDrawOver(StickyHeaderItemDecorator.java:81) at android.support.v7.widget.RecyclerView.draw(RecyclerView.java:4017) at android.view.View.updateDisplayListIfDirty(View.java:19082) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290) at android.view.View.updateDisplayListIfDirty(View.java:19042) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290) at android.view.View.updateDisplayListIfDirty(View.java:19042)

`
andreimesina commented 4 years ago

Hello :) Any updates on this issue? I also caught this in my app and had the same stack trace @shuhart