Open hadifar opened 9 years ago
same problem here , any idea ?
@AmirHadifar @Pishtaz
Hi,
is it not running in the following call?
notifyItemInserted(position);
and notifyItemRemoved(position);
do I need this for adapter animation ?
Sent from Windows Mail
From: Daichi Furiya Sent: Monday, September 7, 2015 10:11 AM To: wasabeef/recyclerview-animators Cc: Ali Zarei
@AmirHadifar @Pishtaz
Hi,
is it not running in the following call? notifyItemInserted(position); and notifyItemRemoved(position);
— Reply to this email directly or view it on GitHub.
@Pishtaz
ok, just sent.
I have the same issue. When I run my code with notifyDataSetChanged(), it's killing my animations, nothing happens, the item is just instantly removed. When I run my code without notifyDataSetChanged(); it shows the animation, but does not update the data. Is there a fix for this?
@Pishtaz @Hhwhiskey
Please use the following
notifyItemChanged(int)
notifyItemInserted(int)
notifyItemRemoved(int)
notifyItemRangeChanged(int, int)
notifyItemRangeInserted(int, int)
notifyItemRangeRemoved(int, int)
If you want your animations to work, do not rely on calling notifyDataSetChanged()
;
as it is the RecyclerView's default behavior, animations are not triggered to start inside this method.
Hi , I follow your instruction But no animation appear. no exception no error
here is my recyclerView :
recyclerView = (RecyclerView) findViewById(R.id.headersList); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(linearLayoutManager); recyclerView.addItemDecoration(new DividerItemDecoration(getResources().getDrawable(R.drawable.empty_divider))); recyclerView.setItemAnimator(new SlideInLeftAnimator()); recyclerView.getItemAnimator().setChangeDuration(1000); recyclerView.getItemAnimator().setMoveDuration(1000); adapter = new HeadersAdapter(); recyclerView.setAdapter(adapter);
and here is my adapter :