1

I have an image view and a button, what I want when I click the button I want to rotate the image view by 10 degrees. Please help me out.

Below is the code I have used

<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/cycle_interpolator">
<rotate android:fromDegrees="360"
    android:toDegrees="0"
    android:pivotX="50%"
    android:pivotY="0"
    android:duration="5000" />
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/cycle_interpolator">
<rotate android:fromDegrees="0"
    android:toDegrees="10"
    android:pivotX="50%"
    android:pivotY="50%"
    android:startOffset="0"
    android:duration="1500" />

1 Answers1

0
view.animate().rotation(10).start();
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Manikandan
  • 131
  • 13