Provides a simple way to extend the default RecyclerView behaviour with support for headers, footers, empty view, DiffUtil and ArrayAdapter like methods.
Add the library as a dependency to your
Check the latest version here.
1. Header & footer support
adapter.addHeader(View view) adapter.addFooter(View view)
2. Empty view
Empty view support for MjolnirRecyclerView. View is automatically hidden when adapter is populated with some data, and is automatically shown once again when adapter becomes empty.
adapter.reset(items, new ItemDiffUtilResult())
As DiffUtil is a blocking sync action, it's executed on the background thread inside the MjolnirRecyclerAdapter by using a AsyncTask. As a result of this approach, you need to call cancel() method on your adapter when your activity or fragment is about to be destroyed, so that the adapter is not updated if the screen has been destroyed.
4. ArrayAdapter like methods
Feedback and code contributions are very much welcome. Just make a pull request with a short description of your changes. By making contributions to this project you give permission for your code to be used under the same license.
Maintained and sponsored by Infinum.