Java tutorial
//package com.java2s; import android.animation.ObjectAnimator; import android.widget.ImageView; public class Main { public static void rotate(ImageView iv, boolean ivDownFlag) { float startRotation = iv.getRotation(); float endRotation = ivDownFlag ? startRotation + 180 : startRotation - 180; ObjectAnimator.ofFloat(iv, "rotation", startRotation, endRotation).setDuration(500).start(); } }