Android (API 7) - Animation : onAnimationRepeat
<p>I have an issue with my apps : I would like to modify an ImageView when the animation is repeated but the <code>onAnimationRepeat</code> function (from the <code>AnimationListener</code> class) is not called.</p>

<p>This is a sample to reproduce it:</p>

<ul>
<li>Create a new project "test" (Android 2.1, API 7) (I used <code>com.test.test</code> for package name)</li>
<li>Create a folder <code>anim</code> inside <code>res</code> folder and create <code>fade_in.xml</code> with these lines</li>
</ul>

<p><img src="http://i.stack.imgur.com/oAtsw.png" alt="fade_in.xml"></p>

<p>The activity code:</p>

<pre><code>package com.test.test;

import android.app.Activity;
import android.graphics.Color;
import android.graphics.PorterDuff.Mode;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation.AnimationListener;
import android.widget.Button;
import android.widget.ImageView;

public class TestActivity extends Activity {

    Button button = null;
    ImageView image = null;

    Animation animation = null;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        button = (Button)findViewById(R.id.button1);
        image = (ImageView)findViewById(R.id.imageView1);

        animation = AnimationUtils.loadAnimation(this, R.anim.fade_in);
        animation.setAnimationListener(new AnimationListener() {            

            int repeatNumber = 0;

            @Override
            public void onAnimationStart(Animation animation) {Log.i("start", "start");}

            @Override
            public void onAnimationEnd(Animation animation) {Log.i("end", "end");}

            @Override
            public void onAnimationRepeat(Animation animation) {
                repeatNumber++;
                Log.i("repeat", String.valueOf(repeatNumber));
                switch(repeatNumber)
                {
                case 1:image.setColorFilter(Color.RED, Mode.MULTIPLY);break;
                case 2:image.setColorFilter(Color.BLUE, Mode.MULTIPLY);break;
                case 3:image.setColorFilter(Color.YELLOW, Mode.MULTIPLY);break;
                default:break;
                }
            }
        });

        button.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {image.startAnimation(animation);}
        });

    }
}
</code></pre>

<p>And the layout:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" &gt;

    &lt;Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button" /&gt;

    &lt;ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher" /&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>The <code>ImageView</code> color doesn't change...Can you help me?</p>
