title: Android: Custom action bar,How to use entire width?
body: <p>Here is an image of my custom action bar:</p>
  
  <p><img src="https://i.stack.imgur.com/dLZ9T.png" alt="enter image description here"></p>
  
  <p>I want to use the entire width, I have search the internet for a solution but nothing wotrked for me.</p>
  
  <p>Here is my action bar .xml:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
  
      &lt;ImageView
          android:layout_width="50dp"
          android:layout_height="match_parent"
          android:id="@+id/invActionBarSave"
          android:src="@drawable/ic_ok_b"
          android:nestedScrollingEnabled="true"
          android:layout_alignParentRight="true"
          android:background="#ffb0afaf"
          android:paddingLeft="8dp"
          android:paddingRight="8dp"
          android:layout_marginTop="4dp"
          android:layout_marginBottom="4dp" /&gt;
  
      &lt;ImageView
          android:layout_width="50dp"
          android:layout_height="match_parent"
          android:id="@+id/invActionBarDelete"
          android:src="@drawable/ic_trash"
          android:nestedScrollingEnabled="true"
          android:layout_toLeftOf="@+id/invActionBarSave"
          android:layout_marginRight="5dp"
          android:background="#ffb0afaf"
          android:paddingLeft="8dp"
          android:paddingRight="8dp"
          android:layout_marginTop="4dp"
          android:layout_marginBottom="4dp" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:singleLine="true"
          android:text="אלסאדק אחמד אבו האני"
          android:textSize="18dp"
          android:textColor="#ff000000"
          android:id="@+id/invActionBarTitle"
          android:gravity="center|right"
          android:layout_toLeftOf="@+id/invActionBarDelete"
          android:layout_toRightOf="@+id/invActionBarHome"
          android:layout_marginRight="20dp"
          android:layout_marginLeft="10dp" /&gt;
  
      &lt;ImageView
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:id="@+id/invActionBarHome"
          android:src="@drawable/ic_back_b"
          android:nestedScrollingEnabled="true"
          android:layout_alignParentLeft="true"
          android:layout_alignParentRight="false"
          android:paddingLeft="10dp" /&gt;
  
      &lt;ProgressBar
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:indeterminateOnly="false"
          style="@style/ProgressBar.Horizontal"
          android:indeterminate="true"
          android:id="@+id/invActionBarProgressBar"
          android:visibility="gone"
          android:layout_below="@+id/invActionBarDelete"
          android:paddingLeft="10dp" /&gt;
  
  &lt;/RelativeLayout&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And here is my java code:</p>
  
  <pre><code>getSupportActionBar().setDisplayShowHomeEnabled(false);
      getSupportActionBar().setDisplayShowTitleEnabled(false);
      LayoutInflater mInflater = LayoutInflater.from(this);
      //View mCustomView = mInflater.inflate(R.layout.actionbar_invoice, null);
      getSupportActionBar().setCustomView(R.layout.actionbar_invoice);
      getSupportActionBar().setDisplayShowCustomEnabled(true);
      setContentView(R.layout.cstmrinvoice);
      getWindow().
              getDecorView().
              setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
  </code></pre>
  
  <p><strong>[EDIT]</strong></p>
  
  <p>Here is a simple one:</p>
  
  <p><img src="https://i.stack.imgur.com/LV7Hg.png" alt="enter image description here"></p>
  
  <p>And here is the .xml:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent" android:layout_height="fill_parent"
      android:contentInsetEnd="0dp"
      android:contentInsetStart="0dp"&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:textAppearance="?android:attr/textAppearanceSmall"
          android:text="Small Text"
          android:id="@+id/textView6"
          android:background="#ffff0000"
          android:textColor="#ffffffff" /&gt;
  &lt;/RelativeLayout&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The same result, there still a space at right of the action bar !</p>
  
  <p>Thank you</p>