title: Navigation drawer header layout : "Connected"
body: <p>I would like to have the same result for the header of the navigation drawer as in this picture : </p>
  
  <p><a href="https://i.stack.imgur.com/bLzri.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bLzri.png" alt="Here (in green)"></a></p>
  
  <p>Actually, the xml code of my nav header (which I add in the MainActivity using navigationView.addHeaderView(navHeader); )  is the following : </p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/colorPrimary"
      android:orientation="horizontal"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      android:theme="@style/ThemeOverlay.AppCompat.Dark"&gt;
  
  &lt;ImageView
      android:id="@+id/loginView"
      android:layout_width="50dp"
      android:layout_height="50dp"
      android:gravity="center"
      android:paddingTop="@dimen/nav_header_vertical_spacing"
      android:src="@android:drawable/ic_menu_camera" /&gt;
  
  &lt;TextView
      android:id="@+id/loginName"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center"
      android:paddingTop="@dimen/nav_header_vertical_spacing"
      android:text="SE CONNECTER"
      android:textAppearance="@style/TextAppearance.AppCompat.Body1"
      android:textSize="16sp" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And I get that as result:</p>
  
  <p><a href="https://i.stack.imgur.com/LrNRI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LrNRI.png" alt="this"></a></p>
  
  <p>Sorry for the french in the screenshot ;)</p>