Propagate notify* events from wrapped adapter to AnimationAdapter
It would be great if the notify* events could be propagated from the wrapper adapter to the AnimationAdapter, so that we can see the animation if we call any of those methods in the wrapper adapter.
@mheras
hi.
Do you have any good idea?
@wasabeef indeed: Make the AnimationAdapter an observer of the wrapped adapter. You can implement an inner class by subclassing RecyclerView.AdapterDataObserver so that you listen any notify* method call. Then, on each implemented method, you forward the event to all your registered observers (AnimationAdapter's observers). And that's all. Now the developer can call any notify* method on the wrapped adapter, and still make the RecyclerView aware of that :)
If you need an example of the implementation, do not hesitate to look here: https://github.com/mheras/RecyclerViewBoilerplate/blob/master/lib/src/main/java/com/mato/recyclerview/boilerplate/HeaderFooterAdapter.java
@wasabeef and of course this also makes possible to chain your AnimationAdapter with any other adapter implementations (like mine, as posted in my previous comment).
@wasabeef Have you had the chance to add this functionality to the lib?
@mheras
Hi.
I woud like you to pull-request.
It I wanna merge :shipit:
I need this functionality too.