List of usage examples for android.view.animation RotateAnimation setFillBefore
public void setFillBefore(boolean fillBefore)
From source file:Main.java
public static void rotate(final View view, float fromDegrees, float toDegrees, long duration) { if (Build.VERSION.SDK_INT >= 12) { if (duration == 0) view.setRotation(toDegrees); else/*from w ww .j a v a 2 s . co m*/ view.animate().rotation(toDegrees).setDuration(duration).start(); } else { RotateAnimation rotate = new RotateAnimation(fromDegrees, toDegrees, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); rotate.setDuration(duration); rotate.setFillEnabled(true); rotate.setFillBefore(true); rotate.setFillAfter(true); addAnimation(view, rotate); } }