Example usage for android.widget ImageView getRotation

List of usage examples for android.widget ImageView getRotation

Introduction

In this page you can find the example usage for android.widget ImageView getRotation.

Prototype

@ViewDebug.ExportedProperty(category = "drawing")
public float getRotation() 

Source Link

Document

The degrees that the view is rotated around the pivot point.

Usage

From source file:Main.java

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();
}