Search code examples
androidscaleandroid-animation

don't scale normally animation android


I want to create a animation that goes like this : It scales from the bottom left corner to the top right corner.

Here's my code so far :

<set xmlns:android="http://schemas.android.com/apk/res/android" >

<scale
    android:duration="500"
    android:fillAfter="true"
    android:fromXScale="0.0"
    android:fromYScale="1.0"
    android:toXScale="1.0"
    android:toYScale="1.0"
    >
</scale>

</set>

Is there some tutorial on how to do animations ? I understand the concept but i don't know all the variables, like pivotX and pivotY.


Solution

  • What i did is use pivotX and pivotY :

    <scale
        android:duration="300"
        android:fillAfter="true"
        android:fromXScale="0.0"
        android:fromYScale="0.0"
        android:toXScale="1.0"
        android:toYScale="1.0"
        android:pivotX="0%"
        android:pivotY="100%"
        >
    </scale>
    

    pivots are the starting points of the animation.