[Feature request] Callbacks for data population
See original GitHub issueI’m probably wrong, but I don’t think the FirebaseRecyclerAdapter
and its children have callbacks for when the data is about to be initially populated or when it’s finished populating items. I checked docs and code for the current and 2.0.0 branches, and I didn’t see listeners or callbacks that would allow someone to display a progress bar if the database is taking a lot of time to fetch some items on a slow network and hide it when the items are populated. I know it’s possible to do this for simple references like so:
dataRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Data data = dataSnapshot.getValue(Data.class);
textView.setText(data.getText());
progressBar.setVisibility(View.GONE);
}
@Override
public void onCancelled(DatabaseError databaseError) {
// ...
}
});
However, I’m wondering if something like this should be implemented in the FirebaseRecyclerAdapters:
dataAdapter.setOnPopulatedListener(new OnPopulatedListener() {
@Override
public void onPopulation() {
progressBar.setVisibility(View.GONE);
}
});
// Or perhaps, probably the right choice, by subclassing
public void onInitialPopulation() {
progressBar.setVisibility(View.GONE);
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Learn From Churn #3 -Feature Request Data vs Feature Fitment
In my last post, I discussed how Ticketing vs Product Usage data predicted possible customer churn. You can read it here. So, let's...
Read more >Event Handling and Callback Functions - DifferentialEquations.jl
The ContinuousCallback is applied when a given continuous condition function hits zero. · The DiscreteCallback is applied when its condition function is true...
Read more >Callback Functions - MapsAlive User Guide
The callback functions let you write code to listen for specific events and perform actions when they occur.
Read more >Clientside Callbacks | Dash for Python Documentation | Plotly
Clientside callbacks allow you to write your callbacks in JavaScript that runs ... to be run directly in the browser instead of a...
Read more >Long Callbacks in Dash Web Apps - Towards Data Science
A long callback runs in a separate process and comes with additional options allowing you to improve the responsiveness of your app, e.g.,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@TheCraftKid So many questions! 😄 Well, now #633 should take care of it.
See https://github.com/firebase/FirebaseUI-Android/pull/477#issuecomment-270283875 for when
onDataChanged
isn’t called.Why won’t it be supported for the indexing? Is it an implementation issue? Also, in what situations is onDataChanged not called?