title: Make view width wrap_content, but no more than 0.5 weight
body: <p>In my LinearLayout I have two child ViewGroups, basically I want them to take 50% of space each (and it is done), but there is also a possibility that content of one of these ViewGroups is much smaller than 50%, in this case, is there any way to make second view match the remaining space? </p>
  
  <p>Now my layout looks like this:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:paddingTop="5dp"
      android:paddingBottom="5dp"
      android:orientation="horizontal"
      android:weightSum="1"&gt;
  
  &lt;include layout="@layout/layout1"
      android:layout_width="0dip"
      android:layout_weight="0.5"
      android:layout_height="match_parent" /&gt;
  
  &lt;include layout="@layout/layout2"
      android:layout_width="0dip"
      android:layout_weight="0.5"
      android:layout_height="match_parent" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>And what I want to achieve is: one layout wrap_content, but no more than 50%, and the second layout fill remaining space.</p>
  
  <p>Thanks in advance!</p>