Reputation: 331
currently i'm using the FirestoreRecyclerAdapter and FirestoreRecyclerOptions and his can listening the data updates, but this method consumes much data, so, i'm tried using FirestorePagingOptions and FirestorePagingAdapter, he's can paginate the data and got economy of date, but, when the data is updated not happens with RecyclerView methods, i'm have adapter.startListening()
, but, didn't work.
This work very fine, but, the data consumed is strong.
public class AnuncioAdapter extends FirestoreRecyclerAdapter<AnuncioPrincipal, AnuncioAdapter.AnuncioHolder> {
public AnuncioAdapter(FirestoreRecyclerOptions<AnuncioPrincipal> options)
{
super(options);
}
The method work fine to economy, but, not update...
public class AnuncioAdapter extends FirestorePagingAdapter<AnuncioPrincipal, AnuncioAdapter.AnuncioHolder> {
public AnuncioAdapter(FirestorePagingOptions<AnuncioPrincipal> options)
{
super(options);
}
Upvotes: 1
Views: 428
Reputation: 111
Its simple
Upvotes: 0
Reputation: 598728
The FirebaseUI paging adapter does not use real-time listeners. According to the documentation:
The FirestorePagingAdapter binds a Query to a RecyclerView by loading documents in pages. This results in a time and memory efficient binding, however it gives up the real-time events afforted [sic] by the
FirestoreRecyclerAdapter
.
So you'll have to choose: either you can have real-time updates, or you can have pagination, but you can't have both with the adapters that come with FirebaseUI.
Upvotes: 4