3

I am using the Firebase UI Recycler View for an android app I am building.

At present, when I open the app I have a blank screen for some seconds before Firebase fills the recycler view. To avoid confusion from the user I plan on using a loading view animation.

I am not quite sure how to implement a loading animation till the Firebase UI recycler view is done downloading content from Firebase.

Is anyone familiar with how to do this?

Thanks in advance

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
j_king
  • 31
  • 1
  • 3
  • See http://stackoverflow.com/questions/40201574/how-to-dismiss-a-progress-bar-even-if-there-is-no-view-to-populate-in-the-fireba/40204298#40204298 – Frank van Puffelen Dec 12 '16 at 15:46

1 Answers1

0

I'd recommend adding a ProgressBar that is visible until your data has been collected from Firebase.

e.g. Start with ProgressBar 'VISIBLE' and the RecyclerView as 'GONE' then at the end of your Firebase listener event set the ProgressBar to 'GONE' and RecyclerView to 'VISIBLE'.

edant92
  • 694
  • 8
  • 18
  • Fair enough. With Firebase UI how can i detect when all the data has been collected? – j_king Dec 12 '16 at 11:35
  • 1
    You'd attach an additional `ValueListener` to the same reference. See http://stackoverflow.com/questions/40201574/how-to-dismiss-a-progress-bar-even-if-there-is-no-view-to-populate-in-the-fireba/40204298#40204298 – Frank van Puffelen Dec 12 '16 at 15:46
  • Yup. That sounds good. Thanks – j_king Dec 21 '16 at 16:28