title: Extended Toolbar with Custom View not Displaying with Full Width
body: <p>I went through lots of answers here related to Toolbar but none of the answers could help me.</p>
  
  <p>What I'm trying to achieve is to have an extended toolbar whhich will display a logo, possibly a name of the Activity/App, it will have an action button/drawer toggle to the right that will display a navigation-like drawer to the right, an overflow menu with other options like settings and also a navigation Tab at the bottom that will allow the user to move between different fragments (different days in a month). </p>
  
  <p>The way I'm trying to achieve this is through toolbar.
  First I create the toolbar and add my custom view.</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_actionbar"
          android:layout_width="match_parent"
          android:layout_height="@dimen/min_double_toolbar_height"
          app:theme="@style/ThemeOverlay.AppCompat.ActionBar"
          android:minHeight="?attr/actionBarSize"
          android:background="@color/primary"
  
          app:contentInsetStart="0dp"
          app:contentInsetEnd="0dp"
          app:contentInsetLeft="0dp"
          app:contentInsetRight="0dp"
          android:clipToPadding="false"
          &gt;
          &lt;!-- ThemeOVerlay Makes sure the text and items are using solid colors--&gt;
  
          &lt;include
              android:layout_width="match_parent"
              android:layout_height="72dp"
              android:layout_gravity="bottom"
              layout="@layout/day_navigation_tab"
              /&gt;
  
      &lt;/android.support.v7.widget.Toolbar&gt;
  </code></pre>
  
  <p>day_navigation_tab is just a horizontal  with Two image views with Padding of 72dp (as by guidelines) and a text view with layout weight set to 1 so it stretches for the whole available space. And a height of 72dp.</p>
  
  <p>Now in my BaseActivity XML I include the toolbar in the Framelayout of the main context (otherwise the toolbar would cover the whole screen for an unknown reason for me (took me ages to figre that out))</p>
  
  <pre><code>&lt;...ommited&gt;
  
      &lt;FrameLayout
          android:id="@+id/container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
          &lt;include
              android:id="@+id/toolbar"
              layout="@layout/app_bar"
              /&gt;
      &lt;/FrameLayout&gt;
  
      &lt;!-- android:layout_gravity="start" tells DrawerLayout to treat
           this as a sliding drawer on the left side for left-to-right
           languages and on the right side for right-to-left languages.
           If you're not building against API 17 or higher, use
           android:layout_gravity="left" instead. --&gt;
      &lt;!-- The drawer is given a fixed width in dp and extends the full height of
           the container. --&gt;
      &lt;fragment android:id="@+id/navigation_drawer"
                android:layout_width="@dimen/navigation_drawer_width"
                android:layout_height="match_parent"
                android:layout_gravity="right"
                android:name="alterway.agency.timeentry.NavigationDrawerFragment"
                tools:layout="@layout/fragment_navigation_drawer"
                app:layout="@layout/fragment_navigation_drawer"
      /&gt;
  
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>However, when I use the toolbar I inflate the Menu on the actionBar in onCreateOptionsMenu my custom view gets shrinked and won't extend the edge of the created options.
  A picture below illustrates that better, It's a screenshot from a Design View in Android Studio. 
  Yellow rectangle indicates where the option items will be placed. 
  Purple indicates the original size in the DesignView. Black indicates the size when running the app.</p>
  
  <p><img src="https://i.stack.imgur.com/WFvh2.png" alt="Design View of the toolbar"></p>
  
  <p>Thank you for any help.</p>
  
  <p>Related questions that might be useful to anybody who comes across this looking to solve a similar problem:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/27007985/support-toolbars-custom-view-not-using-full-width">design - Support Toolbars custom view not using full width</a></li>
  <li><a href="https://stackoverflow.com/questions/26491689/how-do-i-declare-an-extended-height-toolbar-action-bar-on-android-lollipop">How do I set up an extended toolbar on Android L</a></li>
  </ul>