Today I released my first library which is for a RecyclerViewCursorAdapter.
Using a ListView to display database data becomes a lot easier when you use a CursorAdapter combined with a CursorLoader to display data from your ContentProvider. The main benefit of CursorLoader is explained in the docs:
This class implements the Loader protocol in a standard way for querying cursors, building on AsyncTaskLoader to perform the cursor query on a background thread so that it does not block the application’s UI.
The CursorAdapter helped by efficiently clearing the reference to the Cursor that it held, so that the responsibility didn’t lay on the developer.
When ListView was replaced by RecyclerView, it came with a different type of Adapter with no CursorAdapter implementation. After being inspired by a StackOverflow answer to see how a CursorAdapter could be used as the underlying data source of a RecyclerView.Adapter class. Once I had it working, I quickly abstracted the idea into a library, which you can find complete with samples on Github. The README there will explain how to include this library and how to get started using CursorAdapter again with your RecyclerView!