title: Copy default toolbar layout (title and subtitle) to a custom layout (same margins, padding, text size, ...)
body: <p>For a better look when changing toolbar titles I use a custom layout with <code>TextSwitchers</code>. I sometimes still switch to another (simple) activity with a default toolbar, so I want my custom toolbar to have the texts at the exact same position.</p>
  
  <p><em>What are the paddings, margins, text sizes and positions the default toolbar will use for title and subtitle? Are they defined anywhere?</em></p>
  
  <p>My layout currently looks like following (if the custom icon <code>ivToolbarDataSource</code> is not used and set to invisible, it SHOULD look EXACTLY like a default toolbar, currently it looks slightly different)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&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="?attr/colorPrimary"
      android:elevation="4dp"
      android:theme="?actionBarThemeStyle"
      app:popupTheme="?actionBarPopupThemeStyle"
      app:layout_scrollFlags="scroll|enterAlways"&gt;
  
      &lt;LinearLayout
          android:orientation="vertical"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
  
          &lt;LinearLayout
              android:orientation="horizontal"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"&gt;
  
              &lt;ImageView
                  android:id="@+id/ivToolbarDataSource"
                  android:layout_gravity="center_vertical"
                  android:layout_marginRight="2dp"
                  android:layout_width="24dp"
                  android:layout_height="24dp" /&gt;
  
              &lt;LinearLayout
                  android:layout_gravity="center_vertical"
                  android:layout_width="0dp"
                  android:layout_weight="1"
                  android:layout_height="wrap_content"&gt;
  
                  &lt;TextSwitcher
                      android:id="@+id/tsToolbarTitle"
                      android:layout_gravity="center_vertical"
                      android:layout_width="0dp"
                      android:layout_weight="1"
                      android:layout_height="wrap_content"&gt;
  
                      &lt;TextView
                          android:id="@+id/tvToolbarTitle1"
                          style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
                          android:maxLines="1"
                          android:ellipsize="end"
                          android:theme="?actionBarThemeStyle"
                          android:layout_gravity="center_vertical"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content" /&gt;
  
                      &lt;TextView
                          android:id="@+id/tvToolbarTitle2"
                          style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
                          android:maxLines="1"
                          android:ellipsize="end"
                          android:theme="?actionBarThemeStyle"
                          android:layout_gravity="center_vertical"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content" /&gt;
  
                  &lt;/TextSwitcher&gt;
  
              &lt;/LinearLayout&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;TextSwitcher
              android:id="@+id/tsToolbarSubTitle"
              android:layout_gravity="center_vertical"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"&gt;
  
              &lt;TextView
                  android:id="@+id/tvToolbarSubTitle1"
                  style="@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle"
                  android:maxLines="1"
                  android:ellipsize="end"
                  android:theme="?actionBarThemeStyle"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" /&gt;
  
              &lt;TextView
                  android:id="@+id/tvToolbarSubTitle2"
                  style="@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle"
                  android:maxLines="1"
                  android:ellipsize="end"
                  android:theme="?actionBarThemeStyle"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" /&gt;
  
          &lt;/TextSwitcher&gt;
  
  
      &lt;/LinearLayout&gt;
  
  &lt;/android.support.v7.widget.Toolbar&gt;
  </code></pre>
  
  <p>I'm using the correct styles for the <code>TextViews</code> but still it's not 100% the same with the default toolbar...</p>