cymcsg / UltimateRecyclerView

A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.
Apache License 2.0
7.22k stars 1.43k forks source link

Weird duplication when new data are loaded on the List during the pagination #422

Open castrojr913 opened 8 years ago

castrojr913 commented 8 years ago

I made two classes in order to implement a pagination. Please, read these links for that purporse:

MyListAdapter AbstractListAdapter

However, when the list loads new data due to the pagination process, It duplicates an early item shown previously. I don't understand why, I have tried using notifyDataSetChanged, notifyItemChanged and so forth, and It has almost been imposible to fix.

ScreenShot

Note: As a second approach, I tried extending the class easyUltimateAdapter and, unfortunately, It threw a NullPointerException when I scrolled the list down. Therefore, I kept trying with the first implementation.

I apreciate your help. Thanks.

jjhesk commented 8 years ago

I see you have messed up the implementations on your code. You will have to pay attentions on getItemViewType and this applyLoadMoreAlignmentWorkaround. ViewTreeObserver need cause race condition. Its not good practice.