How to implement Recycler View Default Item Add/Remove Animations in swapCursor function. notifyDataSetChanged() won't show any animations.
public void swapCursor(Cursor newCursor) {
mCursor = newCursor;
notifyDataSetChanged();
}
Just set the following in activity,
recyclerView.setHasFixedSize(true);
And in adapter, write
setHasStableIds(true); //in constructor
@Override
public long getItemId(int position) {
return cameraImageArrayList.get(position).hashCode(); //Any unique id
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With