title: Add custom layout to toolbar
body: <p>I followed this <a href="https://guides.codepath.com/android/Google-Play-Style-Tabs-using-TabLayout">tutorial</a> to give my app a regular toolbar with some tabs.</p>
  
  <p>I want to change the toolbar so it looks more like this:</p>
  
  <p><a href="https://i.stack.imgur.com/7VFgd.png"><img src="https://i.stack.imgur.com/7VFgd.png" alt="enter image description here"></a></p>
  
  <p>I want to add some text and images into the toolbar. How can I do this?</p>
  
  <p><code>activity_main.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:id="@+id/appbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
          app:elevation="0dp"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="@color/primary"
              app:layout_scrollFlags="scroll|enterAlways"
              app:theme="@style/ToolbarTheme"
              app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
              /&gt;
  
          &lt;android.support.design.widget.TabLayout
              android:id="@+id/tabs"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              app:tabTextAppearance="@style/TabLayout"
              app:tabSelectedTextColor="@color/white"
              /&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/pager"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"
          /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>