I am trying to understand how rotate animation works.
With the following I rotate a view as follows:
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="8000"
>
<rotate android:fromDegrees="0"
android:toDegrees="30"
android:pivotX="100%"
android:pivotY="100%"
/>
<rotate
android:toDegrees="100"
android:pivotX="100%"
android:pivotY="30%"
/>
</set>
Now where the arrow is I am trying to rotate again using that as a center.
So I modified my animation set as follows:
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="8000">
<rotate android:fromDegrees="0"
android:toDegrees="30"
android:pivotX="100%"
android:pivotY="100%"
/>
<rotate
android:toDegrees="100"
android:pivotX="100%"
android:pivotY="30%"
/>
<rotate android:pivotY="-30%"
android:pivotX="40%"
android:toDegrees="100"/>
</set>
I.e. I added
<rotate android:pivotY="-30%"
android:pivotX="40%"
android:toDegrees="100"/>
This seems correct to me because looking at the screen the rotate point is around 30% less than the left most value of y and x is about 40% more than the left most value of x.
But when the animation runs it is not working as expected. To be honest I have no clue what is the actual rotation point and the whole view skews to the left.
Result:
What am I misunderstanding here?