title: Android- how to achieve a central scale animation on a vector image
body: <p>I have recently started dabbling in vector images and animations. However, I wanted to be able to scale my image uniformly in all directions once the path morph animation has completed. </p>
  
  <p>I have tried applying pivotX and Y wherever I can but it doesnt seem to make a difference.</p>
  
  <p>How can I achieve a central scale rather than it just expanding from left to right?</p>
  
  <p><em>test_layout.xml</em></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_gravity="center"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;ImageView
          android:id="@+id/test_image"
          android:layout_gravity="center"
          android:src="@drawable/animated_logo"
          android:layout_width="200dp"
          android:layout_height="200dp" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p><em>animated_logo.xml</em></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
      android:drawable="@drawable/closed_logo" &gt;
      &lt;target
          android:animation="@anim/scale"
          android:name="logo"/&gt;
  &lt;/animated-vector&gt;
  </code></pre>
  
  <p><em>scale.anim</em></p>
  
  <pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;objectAnimator
      android:duration="1500"
      android:propertyName="scaleX"
      android:valueFrom="1.0"
      android:valueTo="10"
      android:valueType="floatType"/&gt;
  &lt;objectAnimator
      android:duration="1500"
      android:propertyName="scaleY"
      android:valueFrom="1.0"
      android:valueTo="10"
      android:valueType="floatType"/&gt;
  </code></pre>
  
  <p></p>
  
  <p><em>closed_logo.xml</em></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;vector xmlns:android="http://schemas.android.com/apk/res/android"
      android:viewportWidth="75"
      android:viewportHeight="75"
      android:width="1000dp"
      android:height="1000dp"&gt;
      &lt;group android:name="logo"&gt;
          &lt;path
              android:name="box"
              android:fillColor="#DADADA"
              android:pathData="M65.5,54.4L11.1,65.5L0,11.1L54.4,0L65.5,54.4z"/&gt;
  
  
      &lt;path
              android:name="bottom_left"
              android:fillColor="#47A89C"
              android:pathData="M 7.1,22.2 l 15.2,36.0 l 10.4,-25.6 L 32.699997,32.6 L 7.1,22.2 L 7.1,22.2z" /&gt;
  
          &lt;path
              android:name="top_left"
              android:fillColor="#564B74"
              android:pathData="M43.1,7.1L7.1,22.2l25.6,10.4L43.1,7.1z" /&gt;
  
          &lt;path
              android:name="top_right"
              android:fillColor="#D2A219"
              android:pathData="M 22.3,58.2 L 58.3,43.0 l 0.0,0.0 L 32.7,32.6 L 22.3,58.2z" /&gt;
  
          &lt;path
              android:name="bottom_right"
              android:fillColor="#BD6474"
              android:pathData="M 32.7,32.6 L 58.3,43.0 l 0.0,0.0 L 43.0,7.1 L 32.7,32.6z" /&gt;
      &lt;/group&gt;
  &lt;/vector&gt;
  </code></pre>