wasabeef / recyclerview-animators

An Android Animation library which easily add itemanimator to RecyclerView items.
Apache License 2.0
11.49k stars 1.98k forks source link

item re-appears after the remove using SlideInLeftAnimator #62

Open girubhai opened 8 years ago

girubhai commented 8 years ago

Hi, After calling notifyItemRemoved(position) and after that notifyItemRangeChanged(position, data.size()); the item re-appears after the remove-animation over an other item at the same position it was "removed". I use the SlideInLeftAnimator as SlideInLeftAnimator animator = new SlideInLeftAnimator(); animator.setRemoveDuration(300); mRecyclerView.setItemAnimator(animator);

and remove item as data.remove(position); notifyItemRemoved(position); notifyItemRangeChanged(position, data.size());

Note: I have compiled the latest 'jp.wasabeef:recyclerview-animators:2.1.0' and the latest 'com.android.support:recyclerview-v7:23.1.1' and also test with FadeInAnimator with no success.

And if remove "notifyItemRangeChanged" then same bug as https://github.com/wasabeef/recyclerview-animators/issues/56

alizarei95 commented 8 years ago

same here , any idea ?

dvdh commented 8 years ago

Encountering the same issue, using these lib versions: jp.wasabeef:recyclerview-animators:2.2.1 com.android.support:appcompat-v7:23.2.0

When the phantom view issue happens, I double checked the RV adapter getItemCount returns 0 and have called the relevant notify* methods on the adapter.

TheFinestArtist commented 8 years ago

+1

wasabeef commented 8 years ago

ok

i will check it

agramian commented 7 years ago

I'm experiencing the same issues with the remove animation not working at all (despite being fired) and also the issue of seeing duplicate versions of the item during the animation (see below). I see the issues even without your library and just sub-classing SimpleItemAnimator so this could be an issue with RecyclerView itself.

Library versions

jp.wasabeef:recyclerview-animators:2.2.3 com.android.support:appcompat-v7:24.1.1'

Code snippet

I intentionally made the durations slow and different to be able to demonstrate the overlapping.

rv.setItemAnimator(new SlideInLeftAnimator(new OvershootInterpolator()));
rv.getItemAnimator().setAddDuration(5000);
rv.getItemAnimator().setRemoveDuration(4000);
rv.getItemAnimator().setMoveDuration(2000);
rv.getItemAnimator().setChangeDuration(1000);

Screen cap

20160804-125000-slideanimationissues

diklimchuk commented 6 years ago

Try using stable ids. Also, are you sure you're not using wrap_content for RecyclerView width? See https://medium.com/@elye.project/recyclerview-supported-wrap-content-not-quite-f04a942ce624.