title: animated-rotate buggy in API level 23 and 24
body: <p>I have an SVG representation of a FontAwesome icon, which I want to give a rotation to, ideally entirely in XML.</p>
  
  <p>I've created the vector drawable (fa_spinner.xml):</p>
  
  <pre><code>&lt;vector xmlns:android="http://schemas.android.com/apk/res/android"
      android:height="256dp"
      android:width="256dp"
      android:viewportWidth="1792"
      android:viewportHeight="1792"&gt;
  
      &lt;path android:fillColor="#18272a"
          android:pathData="M526 1394q0 53-37.5 90.5t-90.5 37.5q-52 0-90-38t-38-90q0-53
              37.5-90.5t90.5-37.5 90.5 37.5 37.5 90.5zm498 206q0 53-37.5 90.5t-90.5
              37.5-90.5-37.5-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zm-704-704q0 53-37.5
              90.5t-90.5 37.5-90.5-37.5-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zm1202
              498q0 52-38 90t-90 38q-53 0-90.5-37.5t-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5
              90.5zm-964-996q0 66-47 113t-113 47-113-47-47-113 47-113 113-47 113 47 47 113zm1170
              498q0 53-37.5 90.5t-90.5 37.5-90.5-37.5-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5
              90.5zm-640-704q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm530
              206q0 93-66 158.5t-158 65.5q-93 0-158.5-65.5t-65.5-158.5q0-92 65.5-158t158.5-66q92
              0 158 66t66 158z" /&gt;
  &lt;/vector&gt;
  </code></pre>
  
  <p>And the XML rotation (loading_spinner.xml): </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;animated-rotate
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:duration="2000"
      android:fromDegrees="0"
      android:toDegrees="360"
      android:pivotX="50%"
      android:pivotY="50%"
      android:repeatCount="infinite"
      android:drawable="@drawable/fa_spinner"&gt;
  &lt;/animated-rotate&gt;
  </code></pre>
  
  <p>Then setting it in my view like so:</p>
  
  <pre><code>&lt;ImageView
      android:layout_width="100dp"
      android:layout_height="100dp"
      android:src="@drawable/loading_spinner"/&gt;
  </code></pre>
  
  <p>The problem being that this seems to behave differently in different API levels:</p>
  
  <ul>
  <li>API 22: No issues</li>
  <li>API 23: SVG flickers twice per rotation</li>
  <li>API 24: Doesn't rotate at all</li>
  <li>API 25: No issues</li>
  </ul>
  
  <p>Is there any XML only work-around for 23/24?</p>
  
  <p>Or is my only option to go the Java/XML way of starting an animation on a static image?</p>
  
  <p>Like so: </p>
  
  <pre><code>//The R.id.static_svg ImageView has src="@drawable/fa_spinner" 
  ImageView staticSvg = (ImageView) findViewById(R.id.static_svg);
  //R.anim.rotate is a simple rotate animation located in the anim folder
  staticSvg.startAnimation(
          AnimationUtils.loadAnimation(this, R.anim.rotate) );
  </code></pre>