title: How to preserve aspect ratio of VectorDrawable?
body: <p>I have been trying to create a splash screen for an Android app as described at 
  <a href="https://www.bignerdranch.com/blog/splash-screens-the-right-way/" rel="noreferrer" title="Splash Screens the Right Way | Big Nerd Ranch">Splash Screens the Right Way | Big Nerd Ranch</a> with a style </p>
  
  <pre><code>&lt;style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"&gt;
      &lt;item name="android:windowBackground"&gt;@drawable/background_splash&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>The background_splash looks like </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:drawable="@color/background"/&gt;
      &lt;item android:drawable="@drawable/sparrow"/&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>And sparrow.xml looks like</p>
  
  <pre><code>&lt;vector android:height="240dp"
      android:width="240dp"
      android:viewportHeight="512.0"
      android:viewportWidth="512.0"
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;path android:fillColor="#e000"
          android:pathData="M407.2,55.2c-20.8,2.4 -42.9,16.8 -65.6,42.7 -4.5,5.1, lot of data here ,-8.2z" android:strokeColor="#00000000"/&gt;
      &lt;path android:fillColor="#cc0000"
          android:pathData="M474,98.9c-12.6,3.9 -17.8,15.3 -12.4,26.8 1.4,2.8 3.1,5.4 3.9,5.7 1.3,0.5 11.4,-0.5 20.5,-1.9 1.4,-0.2 5,-0.6 8,-1 8,-0.8 11.1,-1.6 10.8,-2.5 -0.3,-0.7 -5.1,-6.4 -21.4,-25.3 -2.4,-2.7 -4.7,-3.2 -9.4,-1.8z" android:strokeColor="#00000000"/&gt;
  &lt;/vector&gt;
  </code></pre>
  
  <p>However, the issue that I am seeing is that aspect ratio of 1:1 as defined by width and height properties of <code>vector</code> is not maintained when it is displayed on the device screen. For example, a circle is displayed as follows in the android studio</p>
  
  <p><a href="https://i.stack.imgur.com/lO4cy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lO4cy.png" alt="in android studio"></a></p>
  
  <p>However, the above image is displayed as follows on the device as it takes over all the available height available to it.</p>
  
  <p><a href="https://i.stack.imgur.com/AlCAZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AlCAZ.png" alt="on device"></a></p>