Hugo Passos
Hugo Passos

Reputation: 8427

How to make zoom in/out stay at final position

Zoom in/out animation resets the object shape's after finished. Is there some way to make it stay at its final shape? I got this for now:

 <scale android:duration="1000"
        android:fromXScale="0"
        android:fromYScale="0"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toXScale="10"
        android:toYScale="10" />

Upvotes: 1

Views: 94

Answers (1)

tachyonflux
tachyonflux

Reputation: 20211

AnimationSet has a fillAfter property which applies the ending value after the animation ends.

<set xmlns:android="http://schemas.android.com/apk/res/android"
   android:fillAfter="true">
   <scale android:duration="1000"
        android:fromXScale="0"
        android:fromYScale="0"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toXScale="10"
        android:toYScale="10" />
</set>

Upvotes: 1

Related Questions