title: Why does scale animation change button size?
body: <p>I have a few buttons in an Android app of mine, "Start", "Stop", and "Pause". When Start is pressed is becomes disabled and Stop and Pause become enabled. Similarly, when Stop or Pause is pressed, Start becomes enabled again. When these buttons change state, I would like to animate the change with a bouncing animation to visually indicate to the user that the button is now available. The problem is that the animation is actually changing the buttons size(background). Check out this gif to see what I mean (watch the Stop button): <a href="https://i.stack.imgur.com/XkgTy.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XkgTy.gif" alt="enter image description here"></a> </p>
  
  <p>Here is the code for the animation:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"
      android:interpolator="@android:anim/linear_interpolator"&gt;
  
      &lt;scale
          android:fromXScale="1.0"
          android:toXScale="1.1"
          android:fromYScale="1.0"
          android:toYScale="1.1"
          android:pivotX="50%"
          android:pivotY="50%"
          android:duration="200"
          android:repeatCount="0"
          android:repeatMode="reverse" /&gt;
  
  &lt;/set&gt;
  </code></pre>
  
  <p>And how I'm applying it to the buttons:</p>
  
  <pre><code>Animation scaleAnimation = AnimationUtils.loadAnimation(this, R.anim.scale_button);
  startButton.startAnimation(scaleAnimation);
  stopButton.startAnimation(scaleAnimation);
  </code></pre>
  
  <p>Why is the Stop button size changing and how can I keep it from doing this?</p>
  
  <p>Thanks!</p>
  
  <p>Note: I originally set the "repeatCount" of the animation to 1 so that it would scale the button back down. I changed it to 0 to debug this problem but the same thing is still happening.</p>