48

These two terms occur in many places but what exactly do they mean in the context of Android animations?

David Rawson
  • 17,631
  • 6
  • 78
  • 112
srujan maddula
  • 1,150
  • 2
  • 11
  • 19

1 Answers1

63

The pivotX and pivotY is the central point of the animation.
So for example if you want to do Zoom In animation you can use this

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:fillAfter="true" >

    <scale
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:duration="1000"
        android:fromXScale="1"
        android:fromYScale="1"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toXScale="3"
        android:toYScale="3" >
    </scale>

</set>

and the android:pivotX="50%" and android:pivotY="50%" will mean the zoom will be started from the center.

There is also a nice tutorial by android hive here

Niko Adrianus Yuwono
  • 10,592
  • 7
  • 37
  • 61