repeatCount and repeatMode of android.view.animation.Animation - Blog Android

Friday, 3 February 2012

repeatCount and repeatMode of android.view.animation.Animation

  • android:repeatCount: Defines how many times the animation should repeat.
  • android:repeatMode: Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite.


Modify /res/anim/scale.xml in former article "Animation of Scale", add android:repeatCount and android:repeatMode properties; to make animation repeat playing foreward and backward infinitely.

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<scale
android:fromXScale="0.0"
android:toXScale="1.0"
android:fromYScale="0.0"
android:toYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:duration="2000"
android:repeatCount="infinite"
android:repeatMode="reverse"
/>
</set>


Borneo08

About Borneo08

Author Description here.. Nulla sagittis convallis. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.

Subscribe to this Blog via Email :

More links

Related Posts Plugin for WordPress, Blogger...