title: Programmatically start Animatable (AnimatedVectorDrawable) at a particular offset
body: <p>Is there a way to programmatically start an <code>AnimatedVectorDrawable</code> at a particular offset?</p>
  <p><strong>Context:</strong></p>
  <p>I'm developing for API 19 and up, so I'm using Android Jetpack. I have a custom <code>View</code> with an animatable &quot;indicator&quot; (a <code>&lt;selector&gt;</code> with vector images).</p>
  <p>The way I currently start my animation is as follows:</p>
  <pre class="lang-java prettyprint-override"><code>ImageView indicator = findViewById(R.id.indicator);
  indicatorDrawable = indicator.getDrawable().getCurrent();
  if(indicatorDrawable instanceof Animatable) {
      ((Animatable) indicatorDrawable).start();
  }
  </code></pre>
  <p>And this is the animator, associated with my &quot;indicator&quot;, in xml:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;set xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
      &lt;objectAnimator
          android:duration=&quot;500&quot;
          android:propertyName=&quot;fillAlpha&quot;
          android:valueFrom=&quot;0.5&quot;
          android:valueTo=&quot;0&quot;
          android:repeatMode=&quot;reverse&quot;
          android:repeatCount=&quot;infinite&quot;/&gt;
  &lt;/set&gt;
  </code></pre>
  <p>This all works fine. However, I have multiple instances of my custom <code>View</code> in an <code>Activity</code> and I need to synchronize their &quot;indicator&quot; animations (which can individually switch on or off at any time).</p>
  <p>I won't bother you with the details, but I currently have an acceptable solution that basically uses a <code>static</code> millisecond field in my custom <code>View</code>. It works, but it causes the animations to stall for some time, if they are trying to catch up.</p>
  <p>I'd much rather immediately start the animation at a particular offset, to avoid this stalling.</p>
  <p>I would think I should somehow be able to access above <code>ObjectAnimator</code> associated with my <code>Animatable</code>, and set its <code>startOffset</code>, but I can't figure out how.</p>
  <hr />
  <p>So, can I somehow access the <code>ObjectAnimator</code> and individually set its <code>startOffset</code> for each individual <code>Animatable</code>, programmatically?</p>