I want to rotate my image view by clicking in my button. I want this: when user click in the button , rotate image view 90 degree. when click in my button again ,rotate image view 180 degree. when click in my button again ,rotate image view 270 degree. when click in my button again ,rotate image view 0 degree. and this continue like this ... I can rotate my image view correctly just one time with 90 degree by this code :
mImageView.setRotation(0);
and by this I can rotate to 90 degree and return it to 0 degree.
float deg = (mImageView.getRotation() == 90F) ? 0F : 90F;
mImageView.animate().rotation(deg).setInterpolator(new AccelerateDecelerateInterpolator());
how I can do this?