I use Square Picasso like this:
Picasso.with(context)
.load(url)
.centerCrop()
.fit()
.into(imageView);
I want to have a rotation loading indicator while Picasso loads the image. I tried the solutions posted here:
Animated loading image in picasso
Show an "Loading..." image while background loading of image with Picasso
I created an animation:
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/progress_image"
android:pivotX="50%"
android:pivotY="50%"/>
and put this animation inside my Picasso
call:
Picasso.with( context )
.load( your_path )
.error( R.drawable.ic_error )
.placeholder( R.drawable.progress_animation )
.into( image_view );
My problem is that the animation is not running. Also it is not a tiny loading indicator in the middle of the image, instead the loading image is stretched to the dimensions of the image.
How can I add a Loading Indicator to Android Picasso?