title: Is it possible to have an animated drawable?
body: <p>Is it possible to create a drawable that has some sort of animation, whether it is a frame by frame animation, rotation, etc, that is defined as a xml drawable and can be represented by a single Drawable object without having to deal with the animation in code?</p>
  
  <p>How I am thinking to use it:
  I have a list and each item in this list may at sometime have something happening to it.  While it is happening, I would like to have a spinning progress animation similar to a indeterminate ProgressBar.  Since there may also be several of these on screen I thought that if they all shared the same Drawable they would only need one instance of it in memory and their animations would be synced so you wouldn't have a bunch of spinning objects in various points in the spinning animation.</p>
  
  <p>I'm not attached to this approach.  I'm just trying to think of the most efficient way to display several spinning progress animations and ideally have them synced together so they are consistent in appearance.</p>
  
  <p>Thanks</p>
  
  <p><strong>In response to Sybiam's answer:</strong></p>
  
  <p>I have tried implementing a RotateDrawable but it is not rotating.</p>
  
  <p>Here is my xml for the drawable so far:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;rotate xmlns:android="http://schemas.android.com/apk/res/android"
   android:drawable="@drawable/my_drawable_to_rotate"
   android:fromDegrees="0" 
   android:toDegrees="360"
   android:pivotX="50%"
   android:pivotY="50%"
   android:duration="800"
   android:visible="true" /&gt;
  </code></pre>
  
  <p>I have tried using that drawable as the src and background of a ImageView and both ways only produced a non-rotating image.</p>
  
  <p>Is there something that has to start the image rotation?</p>