Progress bar visible before firebase loading and gone after loading is done
I want to add a library of a progress bar in my app in which the progress bar visible before the firebase image data loading and after loading the progress bar Gone. I am using Retrofit and Firebase Storage for saving my wallpaper application images. All the images are loading in Recycler view with Grid Layout. I want to show a progress bar before the loading and after when the loading is done the progress bar should Be Gone.
The simple and best way to show a progress bar while loading data from server is, to include a progress bar in your xml file and set indeterminate to ‘true’.
If you are using Async task, then inside onPreExecute(), you can set the progress bar variable.setVisibility to VISIBLE. After loading and setting the data in onPostExecute, you can set progressBar.setVisibility(VISIBLE.GONE).