title: Android: How to make a nice heartbeat animation?
body: <p>This is my solution</p>
  
  <p>anim/pulse.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;scale
      android:duration="300"
      android:fromXScale="1"
      android:fromYScale="1"
      android:pivotX="50%"
      android:pivotY="50%"
      android:repeatCount="infinite"
      android:repeatMode="reverse"
      android:toXScale="0.75"
      android:toYScale="0.75"
      android:interpolator="@android:interpolator/bounce" /&gt;
  &lt;scale
      android:duration="100"
      android:fromXScale="1"
      android:fromYScale="1"
      android:pivotX="50%"
      android:pivotY="50%"
      android:repeatCount="infinite"
      android:repeatMode="reverse"
      android:toXScale="1.25"
      android:toYScale="1.25"
      android:interpolator="@android:interpolator/bounce" /&gt;
   &lt;/set&gt;
  </code></pre>
  
  <p>then in activity.java:</p>
  
  <pre><code>ImageView imageView = (ImageView) findViewById(R.id.image);
  imageView.startAnimation(AnimationUtils.loadAnimation(this, R.anim.pulse));
  </code></pre>
  
  <p>I'm not satisfied because a real beating heart has more elegant contractions. How could it be improved?</p>
  
  <p>EDIT: I think that a fine effect would be something that imitate the heart beat. A fast contraction followed by another one. Maybe the last could be fast in the first half and then reverse slowly for the second half. Is there a way to make all these effects triggering each other?</p>