I am using the below code, which working successfully using the filters. Now I just need to paginate my query before passing it to the adapter. I want to implement FirestorePagingAdapter, but not able to do so as the FirestorePagingOptions object had to be passed to the adapter, but the adapter type is not accepting it, as it is only accepting the Query object and have no idea if I can convert one type to another. Please help me out to paginate, either by using FirestorePagingOptions or some other way
I have commented the line where the pagination should be done.
I am using Firestore Database for the Android Project in RecyclerView With Filters option
public void onFilter(Filters filters) {
// Construct query basic query
Query query = mFirestore.collection("posts").orderBy("timestamp", Query.Direction.DESCENDING);
// Category (equality filter)
if (filters.hasCategory()) {
query = query.whereEqualTo("postcategory", filters.getCategory());
}
// Limit items
// query = query.limit(7);
// Update the query
PostsRef = query;
//Pagination
adapter.setQuery(query);
// Set header
mCurrentSearchView.setText(Html.fromHtml(filters.getSearchDescription(getActivity().getApplicationContext())));
// Save filters
mViewModel.setFilters(filters);
}