In the below example code, I have set the animation to an ImagView when you clicks on image, image will rotate 180 degrees from Y axis. Here first, I have added an ImageView within actvity_main.xml layout, after that I have created a flip.xml resource file within animator folder and here I have added flip animation attributes, Now see programming part, here I have used AnimatorSet class and load flip.xml res. and used start() method for animation.
You can see below example code it clearly describes How to make Flip animation image in android
Step(1)-I have created flip.xml resource file within animator folder-