recyclerview-animators
recyclerview-animators copied to clipboard
Removed items will keep floating onto the recycler view when using SlideInUpAnimator
There should be a bug in SlideInUpAnimator, I am currently using recycler view with 23.1.1 version and animators with 2.0.1. I also tried to upgrade the version to 2.2.1, but the problem is still there.
The item won't disappear and will keep floating onto the recycler view after the animation when I call notifyItemRemoved().
I used it, it worked:
public void remove(int pos) {
data.remove(pos);
notifyItemRemoved(pos);
final Handler h = new Handler() {
public void handleMessage(android.os.Message msg) {
if(msg.what == 0x01) notifyDataSetChanged();
}
};
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000); //animation time
h.obtainMessage(0x01).sendToTarget();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
}
Edit: Ignore the response, even refresh the entire list, continued the problem!
@CaiqueJhones I didn't call notifyDataSetChanged() after notifyItemRemoved() since I don't want to refresh the whole list. I am using StaggeredGridLayoutManager in my recycler view, is it related to this issue?
@ydongzhu Ignore the response, even refresh the entire list, continued the problem!
Same problem here too.
I have the same problem. To be more accurate, in my case, it happens when calling notifyItemRangeRemoved after having called notifyItemChanged previously on an element. the 2 calls are distinct and there is too much time between them to be an overlap. If I scroll the recyclerview between the 2 calls it doesn't happen though. Maybe because onBindViewHolder gets called in the middle
Same here
Did anyone find a solution for this yet? I tried notifyItemRemoved(myItemAdapterPos) and notifyItemRangeChanged(typingIndicatorPosition, itemCount - 1), but none of them solved this issue, even tried using myViewHolder.setIsRecyclable(false) for that specific viewholder (because I have different viewholders for different items)