ebarrenechea / header-decor

A couple of sticky header decorations for android's recycler view.
Apache License 2.0
878 stars 159 forks source link

Fantom header appears #66

Open ghost opened 7 years ago

ghost commented 7 years ago

In my RecyclerView I use 'notifyItemChanged(int position)' method to animate an image on an item when click on it. And when I click, above the item an excess header appears for a second and disappears. This doesn't happen if the list has only one header or with the last header if they are many. Step 1 (do nothing): snip_20170203184803

Step 2 (when I click on 'Attack 3'): snip_20170203184832

laricampos commented 7 years ago

I'm having the same problem. It happens when I call notifyItemChanged(int position) during the animation.

l1218yj2 commented 7 years ago

same here

micHar commented 7 years ago

It has something to do with the default item animator and the fact that this lib doesn't take animations into account. I could not find the exact reason, but for me disabling the animations for notifyItemChanged worked.

In Kotlin this is: (recyclerView.itemAnimator as SimpleItemAnimator).supportsChangeAnimations = false