MaterialList
MaterialList copied to clipboard
Example on getting animation to work?
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()
I experienced the same issue.
@FHellmann @dexafree Any update on this issue?
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.
I will fix the animation issue with my next PR.
See #98