title: Best way to center content in android linear layout
body: <p>I've created the following splash screen layout using android developer studio. I wanted to center the content which consist of two text views and an image view. The following is the XML.</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="@drawable/splash_gradient"&gt;
  
  &lt;RelativeLayout
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
  
      &lt;ImageView id="@+id/splashscreen"
          android:layout_width="100dp"
          android:layout_height="250dp"
          android:paddingBottom="100dp"
          android:layout_centerInParent="true"
          android:gravity="center_vertical|center_horizontal"
          android:src="@drawable/splash_logo" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Sample"
          android:layout_centerInParent="true"
          android:fontFamily="@string/font_family_thin"
          android:paddingTop="90dp"
          android:paddingRight="90dp"
          android:textSize="35dp"
          android:textColor="#fff"
          /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="App"
          android:layout_centerInParent="true"
          android:fontFamily="@string/font_family_regular"
          android:textSize="35dp"
          android:paddingTop="90dp"
          android:paddingLeft="100dp"
          android:textColor="#fff"
          /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>This will look as following image.</p>
  
  <p><a href="https://i.stack.imgur.com/kU5jJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kU5jJ.png" alt="enter image description here"></a></p>
  
  <p>Is this the correct way to center my content or is there a better way to achieve what I'm looking for? Please guide me. Thanks in advance.</p>