I have the following code to load an image in Picasso, using a drawable for the placeholder to display while the image is downloading. What I want though is an animated spin
@DBragion's answer was great. The problem with it (like many mentioned in the comments) was it didn't provide a way to specify the height / width of the progress indicator. Following is the modified version of his answer with combination of @AkankshaRathod's answer.
loading_indicator.png
progress_animation.xml
-
CardView (or any container Layout) containing your ImageView
Picasso loading:
Picasso.get().load(yourImageURL).into(imgCategoryImage, new Callback() {
@Override
public void onSuccess() {
loadingIndicator.setVisibility(View.GONE);
}
@Override
public void onError(Exception e) {
}
});