title: TextView with ellipsize and buttons
body: <p>I'm trying to create a header with left and right buttons, and a title in the center, with a button immediately to the right of the button (which will allow selecting something). The layout should be like:</p>
  
  <pre><code>|&lt;Button&gt;      &lt;TextView&gt;&lt;Button&gt;         &lt;Button&gt;|
  </code></pre>
  
  <p>If the title is very long, it should ellipsize. To do that, it appears the textview needs a layout_weight, as seen in <a href="https://stackoverflow.com/questions/3785221/two-textviews-side-by-side-only-one-to-ellipsize">this solution</a>, otherwise it pushes the right buttons off the screen. However, setting the layout_weight for the textview pushes the center button off to the right:</p>
  
  <pre><code>|&lt;Button&gt;      &lt;TextView&gt;         &lt;Button&gt;&lt;Button&gt;|
  </code></pre>
  
  <p>The layout as it stands is this:</p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      &gt;
  
      &lt;Button
          android:text="Hello"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          /&gt;
  
      &lt;TextView
          android:text="Testing"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:singleLine="true"
          android:layout_weight="1"
          android:gravity="center"
          android:ellipsize="end"
          android:inputType="text"
          /&gt;
  
      &lt;Button
          android:text="Hello"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          /&gt;
  
      &lt;Button
          android:text="Hello"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>[EDIT] Trying FunkTheMonk's approach doesn't quite work, as it ends up pushing the center button out of the layout if the string is long:</p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      &gt;
  
      &lt;Button
          android:text="Hello1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          /&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:orientation="horizontal"
              android:gravity="center"
              android:layout_weight="1"
          &gt;
          &lt;TextView
              android:text="Testing a very long text to see how it works how do you like me now this is still longer yet"
              android:layout_margin="3dp"
              android:layout_width="wrap_content"
              android:layout_height="fill_parent"
              android:singleLine="true"
              android:gravity="center"
              android:ellipsize="end"
              android:inputType="text"
              /&gt;
  
          &lt;Button
              android:text="Hello2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;Button
          android:text="Hello3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>