I am using firebase firestore as my backend. I have a recyclerView where I should load my data, I found about firestorePagingAdapter and it works fine for loading data from firestore when data is needed(when user scrolls down the list), problem is that I want to cache that data in my room database so if user switches from screen and comes back it won't fetch data from firestore but from room database.
Is it possible to do something like that, since my recyclerView extends FirestrePagingAdapter there is no way for me to call repository (I'm using mvvm) functions for writing data in db from recyclerView class. I read that paging library can be used with room database + network as data sources but I haven't found any working example and documentation is really confusing and I don;t think it can work with FirestorePagingAdapter.