title: Android: Frame Animation stretches to view size
body: <p>I am trying to make frame animation stay within the center of the image view in which the animation is playing BEFORE the image is downloaded. Basically its an animation for a loading spinner. Here is my imageview in xml file.</p>
  
  <pre><code>&lt;TableRow
            android:gravity="center"  &gt;
  
              &lt;ImageView
                  android:id="@+id/imageViewUrl1"
                  android:layout_width="0dp"
                  android:layout_height="94dp"
                  android:layout_gravity="center"
                  android:layout_weight="0.5"
                  android:adjustViewBounds="true"
                  android:gravity="center"
                  android:onClick="OnClickThumbnail"
                  android:paddingTop="10dp"
                  android:scaleType="fitCenter"
                  android:textColor="@android:color/white" 
                  android:src="@drawable/frameblack" /&gt;
  </code></pre>
  
  <p>Here is my frame xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;  
  &lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android"  
      android:oneshot="false" &gt;  
          &lt;item android:drawable="@drawable/framezero" android:duration="60" /&gt; 
          &lt;item android:drawable="@drawable/frameone" android:duration="60"  /&gt;  
          &lt;item android:drawable="@drawable/frametwo" android:duration="60" /&gt;  
          &lt;item android:drawable="@drawable/framethree" android:duration="60" /&gt; 
      &lt;item android:drawable="@drawable/framefour" android:duration="60" /&gt; 
      &lt;item android:drawable="@drawable/framefive" android:duration="60" /&gt; 
      &lt;item android:drawable="@drawable/framesix" android:duration="60" /&gt; 
      &lt;item android:drawable="@drawable/frameseven" android:duration="60" /&gt; 
      &lt;item android:drawable="@drawable/frameeight" android:duration="60" /&gt; 
      &lt;item android:drawable="@drawable/framenine" android:duration="60" /&gt; 
      &lt;item android:drawable="@drawable/frameten" android:duration="60"  /&gt; 
  
  &lt;/animation-list&gt;
  </code></pre>
  
  <p>and here is the code i m using to start the animation</p>
  
  <pre><code>final ImageView imageView = (ImageView) findViewById(R.id.imageViewUrl1);   
          AnimationDrawable yourAnimation;   
  
          imageView.setBackgroundResource(R.drawable.loadinganim);   
          yourAnimation = (AnimationDrawable) imageView.getBackground();
                  yourAnimation.start();
  </code></pre>
  
  <p>The problem is that the animation stretches the entire width and height of the imageview. The imageview is set to fitCenter. How can i avoid this stretch?</p>