title: Android: remove left margin from actionbar's custom layout
body: <p>I am using a custom actionbar view, and as you can see in the screenshot below, there is a blank gray space in the actionbar. I want to remove it.</p>
  
  <p><img src="https://i.stack.imgur.com/PzunE.png" alt="enter image description here"></p>
  
  <p>What have I done:</p>
  
  <blockquote>
    <p><strong>res/values-v11/styles.xml</strong></p>
  </blockquote>
  
  <pre><code>&lt;style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light"&gt;
          &lt;item name="android:actionBarStyle"&gt;@style/ActionBarStyle&lt;/item&gt;
          &lt;item name="actionBarStyle"&gt;@style/ActionBarStyle&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <blockquote>
    <p><strong>res/values/my_custom_actionbar.xml</strong></p>
  </blockquote>
  
  <pre><code>&lt;resources xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;style name="ActionBarStyle" parent="@style/Widget.AppCompat.Light.ActionBar.Solid"&gt;
          &lt;item name="android:height"&gt;60dp&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <blockquote>
    <p><strong>Manifest</strong></p>
  </blockquote>
  
  <pre><code>&lt;uses-sdk
          android:minSdkVersion="10"
          android:targetSdkVersion="19" /&gt;
  
  &lt;application
              android:icon="@drawable/ic_launcher"
              android:label="@string/AppName"
              android:theme="@style/AppBaseTheme" &gt;
      &lt;!-- activities... etc --&gt;
  &lt;/application&gt;
  </code></pre>
  
  <blockquote>
    <p><strong>MainActivity</strong></p>
  </blockquote>
  
  <pre><code>public void onCreate(Bundle bundle) {
      super.onCreate(bundle);
  
      ActionBar actionbar = getSupportActionBar();
  
      actionbar.setDefaultDisplayHomeAsUpEnabled(false);
      actionbar.setDisplayHomeAsUpEnabled(false);
      actionbar.setDisplayShowCustomEnabled(true);
      actionbar.setDisplayShowHomeEnabled(false);
      actionbar.setDisplayShowTitleEnabled(false);
      actionbar.setDisplayUseLogoEnabled(false);
      actionbar.setHomeButtonEnabled(false);
  
      // Add the custom layout
      View view = LayoutInflater.from(this).inflate(R.layout.actionbar, null, false);
      actionbar.setCustomView(view);
  }
  </code></pre>
  
  <p>I have found a recent post, that is pointing out that there is an issue with the latest release. I have also updated ADT and SDK to Android 5.</p>
  
  <p><a href="https://stackoverflow.com/questions/27298282/android-actionbars-custom-view-not-filling-parent">Android ActionBar&#39;s custom view not filling parent</a></p>
  
  <p>I don't know what should I do.</p>
  
  <p><strong>Edit (partial solution):</strong></p>
  
  <p>Not working on Android &lt;= API 10.</p>
  
  <p><a href="https://stackoverflow.com/questions/26433409/android-lollipop-appcompat-actionbar-custom-view-doesnt-take-up-whole-screen-w">Android Lollipop, AppCompat ActionBar custom view doesn&#39;t take up whole screen width</a></p>
  
  <p>What have I changed:</p>
  
  <p>Use the latest sdk version:</p>
  
  <pre><code>&lt;uses-sdk
          android:minSdkVersion="10"
          android:targetSdkVersion="21" /&gt;
  </code></pre>
  
  <p>Add a <code>toolbarStyle</code>:</p>
  
  <pre><code>&lt;style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light"&gt;
          &lt;item name="android:actionBarStyle"&gt;@style/ActionBarStyle&lt;/item&gt;
          &lt;item name="actionBarStyle"&gt;@style/ActionBarStyle&lt;/item&gt;
  
          &lt;item name="android:toolbarStyle"&gt;@style/ToolbarStyle&lt;/item&gt;
          &lt;item name="toolbarStyle"&gt;@style/ToolbarStyle&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="ToolbarStyle" parent="@style/Widget.AppCompat.Toolbar"&gt;
      &lt;item name="contentInsetStart"&gt;0dp&lt;/item&gt;
      &lt;item name="android:contentInsetStart"&gt;0dp&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>