title: Android Splash Screen stretched
body: <p>I am trying to create a splash screen using <a href="https://android.jlelse.eu/the-complete-android-splash-screen-guide-c7db82bce565" rel="nofollow noreferrer">this tutorial</a> by using an additional theme.
  This is my launcher theme in <code>styles.xml</code>:</p>
  
  <pre><code>    &lt;style name="AppTheme.Launcher" parent="Theme.MaterialComponents.DayNight.DarkActionBar"&gt;
          &lt;item name="android:windowBackground"&gt;@drawable/ic_launch_screen&lt;/item&gt;
          &lt;item name="colorPrimaryDark"&gt;@color/color_white&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p>This is the <code>ic_launch_screen.xml</code> file:</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/color_white" /&gt;
      &lt;item&gt;
          &lt;bitmap android:src="@drawable/ic_splash_screen" /&gt;
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>The <code>ic_splash_screen</code> file is already a 9-patch file looking like this:</p>
  
  <p><a href="https://i.stack.imgur.com/2VVa1m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2VVa1m.png" alt="enter image description here"></a></p>
  
  <p>In the 9-patch preview in Android Studio it shows that, if stretched, the logos will not be resized and look perfectly aligned.</p>
  
  <p>Yet, when I use it in this combination, the splash screen looks stretched on my Huawei and Samsung but not on the pixel 2 emulator:
  Huawei Mate 10 Pro &amp; Samsung Galaxy s9+ (they are stretched the same way):</p>
  
  <p><a href="https://i.stack.imgur.com/gqV6Wm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gqV6Wm.jpg" alt="enter image description here"></a></p>
  
  <p>On the emulator it looks perfect like this:</p>
  
  <p><a href="https://i.stack.imgur.com/SJZdWm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SJZdWm.png" alt="enter image description here"></a></p>
  
  <p>The problem is not because of the system navigation. It still looks stretched on the Huawei when I use three key navigation like in the emulator.</p>
  
  <p>I have already tried playing around in the <code>ic_launch_screen.xml</code> by using <code>&lt;nine-patch&gt;</code> elements or the <code>gravity:center</code> attribute but it looks even more messed up then.</p>