MaterialList icon indicating copy to clipboard operation
MaterialList copied to clipboard

Example on getting animation to work?

Open Brian-McBride opened this issue 9 years ago • 5 comments

I can't seem to get animation to work.

materialListView = (MaterialListView) rootView.findViewById(R.id.scan_listview);
materialListView.setItemAnimator(new SlideInDownAnimator()); // This SHOULD be setting animation?

But when I add a view later:

materialListView.addAtStart(cardToAdd);

No animation. When dismissing a card with a swipe, it does remove. and the cards below do slide up rather nicely. It just isn't animating at all when adding nor with remove()

Brian-McBride avatar Apr 23 '15 23:04 Brian-McBride

I experienced the same issue.

nyjalusc avatar Jun 08 '15 00:06 nyjalusc

@FHellmann @dexafree Any update on this issue?

ganesh2shiv avatar Jun 25 '15 11:06 ganesh2shiv

I've take a look to the wasabeef/recyclerview-animators and found out...

  • 1. Solution: That the ViewHolder needs to extend AnimateViewHolder. The problem is, that we can't extend the ViewHolder with AnimateViewHolder, due to the fact, that the library of wasabeef is > API 14 and MaterialList is > API 10. So this will not work...

... or ...

  • 2. Solution: That the Adapter get's surrounded by a Wrapper AnimatorAdapter. This is the only way how it could work. But not with the current implementation of MaterialListView.setAdapter(Adapter). This will throw us a the IllegalArgumentException because the AnimatorAdapter will wrap and not extend the MaterialListAdapter.

So we have to find a solution which will work the the 2. Solution. There for the MaterialListView.setAdapter(Adapter) has to be changed.

FHellmann avatar Aug 28 '15 12:08 FHellmann

I will fix the animation issue with my next PR.

FHellmann avatar Sep 07 '15 09:09 FHellmann

See #98

FHellmann avatar Sep 07 '15 16:09 FHellmann