title: How to center CardView inside LinearLayout?
body: <p>I have a portrait display and I want to translate it to landscape mode. </p>
  
  <p>In landscape mode, first child of encompassing LinearLayout, which is also a LinearLayout, should contain CardView with ImageView (rounded, I'm not sure how is that gonna turn out). In second LinearLayout, I would like to have Username and Password EditText next to each other horizontally. And finally, the last LinearLayout should contain Login and Sign Up buttons also horizontally. </p>
  
  <p>I don't know how to center CardView inside first child LinearLayout and how to make ImageView rounded.</p>
  
  <p>This what I have:
  <a href="https://i.stack.imgur.com/u3OVF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u3OVF.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/gradient"
      android:gravity="center"
      tools:context=".LoginActivity"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:orientation="horizontal"
          android:layout_weight="1"&gt;
  
  
          &lt;androidx.cardview.widget.CardView
              android:id="@+id/imageView"
              android:layout_width="150dp"
              android:layout_height="match_parent"
              app:cardBackgroundColor="#090909"
              app:cardCornerRadius="250dp"&gt;
  
  
              &lt;!--&lt;androidx.cardview.widget.CardView
                  android:layout_width="150dp"
                  android:layout_height="145dp"
                  android:gravity="center"
                  app:cardCornerRadius="250dp"&gt;
  
              &lt;/androidx.cardview.widget.CardView&gt;--&gt;
  
          &lt;/androidx.cardview.widget.CardView&gt;
  
          &lt;!--&lt;ImageView
              android:layout_width="150dp"
              android:layout_height="match_parent"
              android:layout_gravity="center_horizontal"
              android:scaleType="centerCrop"
              android:src="@drawable/login_logo" /&gt;--&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1"
          android:orientation="horizontal"&gt;
  
          &lt;!--HERE WILL BE Username and Password--&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1"
          android:orientation="horizontal"&gt;
      &lt;!--HERE WILL BE Login and Sign up--&gt;
  
      &lt;/LinearLayout&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>