How to animate default image of NetworkImageView and scale it and again re-scale it after response

267 Views Asked by At

I want to apply animation to default image in networkImageView and scale it to center then again scale it back to fit_XY after image get loaded. Please suggest how can I achieve it. Thanks

1

There are 1 best solutions below

0
On

Create anim folder in res folder. Put below xml file in anim folder.

 <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android">
   <scale 
    android:fromXScale="1"
    android:toXScale="0"
    android:fromYScale="1"
    android:toYScale="0"
    android:duration="200"
    android:pivotX="50%"
    android:pivotY="50%"/>

    </set>

Then in java code. write below lines.

Animation animation = AnimationUtils.loadAnimation(this, R.anim.test_animations);


            sampleImageView.startAnimation(animation);