I want to make flip as an animation of my ImageView after I click on it. My intention is to reduce the width of the image to 0 and immediately expand it to 1.0. This should simulate a flip image.
This is what I really have. After clicking on the image, it reduces the image from 1.0 to 0.
My question is how to continue expanding part of the animation?
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <scale android:interpolator="@android:anim/linear_interpolator" android:fromXScale="1.0" android:toXScale="0.0" android:fromYScale="1.0" android:toYScale="1.0" android:pivotX="50%" android:pivotY="50%" android:duration="200" /> </set>
EDIT
I added another block for the back of the animation, but it does not work properly. It seems that startOffset is not valid or something like that. In other words, the animation is confused, it seems that the first part of the animation also affects this part of the code. What am I doing wrong?
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <scale android:interpolator="@android:anim/linear_interpolator" android:fromXScale="1.0" android:toXScale="0.0" android:fromYScale="1.0" android:toYScale="1.0" android:pivotX="50%" android:pivotY="50%" android:duration="200" /> <set android:startOffset="200"> <scale android:interpolator="@android:anim/linear_interpolator" android:fromXScale="0.0" android:toXScale="1.0" android:fromYScale="1.0" android:toYScale="1.0" android:pivotX="50%" android:pivotY="50%" android:duration="200" /> </set> </set>
source share