Skip to content
Advertisement

Make the user waiting for activity to finish loading

everyone, I am working on a project that retrieves data from firestore and some of that contains URL for an image. when I start the app I notice a delay when loading the image. so I thought about what I’ve seen in the Facebook app that when loading an image showing a view with some animation to inform the user that the app still loading in the background, any help, please.

this is how I retrieve the data

JavaScript

Advertisement

Answer

You can add “ProgressBar” widget in your “single_post.xml” file, then make its reference on your ViewHolder class (PostViewHolder) and then last step is to change your Glide code in “onBindViewHolder” method.

single_post.xml

JavaScript

PostViewHolder

JavaScript

OnBindViewHolder Method

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement