MarkoMilos / Paginate

Library for creating simple pagination functionality upon RecyclerView and AbsListView
Apache License 2.0
1.35k stars 225 forks source link

Wrapped Adapter needed. #7

Open CillianMyles opened 8 years ago

CillianMyles commented 8 years ago

Hello,

Firstly thanks very much for your work. It has been very easy to get up and running with the library. :+1:

I have run into trouble though; I need access to my "WrappedAdapter" for another library. I am testing out libraries for FastScroll w/ RecyclerView and have come across this https://github.com/krimin-killr21/MaterialScrollBar.

The problem is this library requires that the RecyclerView.Adapter must implement an interface (this interface tells the indicator which letter to display at which position). At runtime MaterialScrollBar checks if it does and crashes as your libs Adapter has wrapped mine which has the interface implementation.

My question is would it be possible for your WrappedAdapter class to extend the Adapter it is wrapping. Not sure would this be possible but I believe it would solve my problem. If you think it would work let me know and I can try to implement it and create a pull request.

Or maybe you have another solution?

Thanks in advance!

MarkoMilos commented 8 years ago

Hi,

glad that you like the library, unfortunately, mentioned feature is not currently available. I made this architectural decision (not to force you to extend some "PaginageWrapperAdapter" with your custom adapter). However, I will need to think of something in order to make it "compatible" with other libraries that are using adapter as well or that are wrapping adapter.

Il try to think of something to make this available for future release, however, along the way I don't want to clutter existing API with some complex setup.

broakenmedia commented 8 years ago

This would be great! Currently can't use Paginate with any HeaderedGridView!