title: Layout and drawable are not centered the same way
body: <p>I have two layouts for my splash screen, which basically consist of an icon centered in a screen.</p>
  
  <p>One of them is <code>drawable/launch_screen.xml</code>. This one is used for the <code>AppTheme</code>.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;item android:drawable="@android:color/black" /&gt;
  
      &lt;item&gt;
          &lt;bitmap
              android:gravity="center"
              android:src="@android:drawable/ic_menu_camera" /&gt;
      &lt;/item&gt;
  
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>I use this file for my app theme as follows:</p>
  
  <pre><code>&lt;style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
      &lt;item name="android:windowBackground"&gt;@drawable/launch_screen&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>And the other one is <code>layout/launch_screen.xml</code>. This is used by the library <code>react-native-splash-screen</code>.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@android:color/black"
      android:gravity="center"
      android:orientation="vertical"&gt;
  
      &lt;ImageView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:src="@android:drawable/ic_menu_camera" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>If you want the details, I built the splash screen mechanism following <a href="https://medium.com/handlebar-labs/how-to-add-a-splash-screen-to-a-react-native-app-ios-and-android-30a3cec835ae" rel="nofollow noreferrer">this guide</a>. As soon as the app opens, <code>AppTheme</code> shows <code>drawable/launch_screen</code> as the background, then the Splash Screen comes in and the <code>layout/launch_screen</code> is dsplayed.</p>
  
  <p>So, these files are basically an icon centered in a blank screen, without any other style. I'm expecting them both to be centered perfectly. However in reality, they look like:</p>
  
  <p><a href="https://i.stack.imgur.com/o3ZNf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o3ZNf.jpg" alt="enter image description here"></a></p>
  
  <p>First picture is the one in <code>drawable</code>, and the second one is in <code>layout</code>. As you see, second one, which is built with <code>LinearLayout</code> is positioned a bit upper. Since these screens are shown one after the other, it feels like the icon moves upwards.</p>
  
  <p>I have tried adding a margin or padding to the ImageView, but it does not render the same in different device. Also I tried to use <code>gravity</code> and <code>layout_gravity</code> with different parameters and combinations but they either do not center them exactly the same. I was thinking that status bar could cause this problem, but status bar is always there and the app is always fullscreen. Do you have any ideas why this centering problem might occur? Thanks in advance.</p>