title: onMeasure() parameters provided by LinearLayout
body: <p>I have created a custom view and I try to implement onMeasure() to work well in all situations. I am currently wondering about the parameters that are passed as  width/heightMeasurementSpec when my view is placed within a linear layout like this:</p>
  
  <pre><code>&lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" &gt;
    &lt;MyView   
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
     android:id="@+id/someId"&gt;&lt;/MyView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>In this case after doing</p>
  
  <pre><code>protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
  {
    int height = MeasureSpec.getSize(heightMeasureSpec);
    int heightmode = MeasureSpec.getMode(heightMeasureSpec);
    //...
  }
  </code></pre>
  
  <p>I have height = 271 (on a 480x320 screen) and heightmode = AT_MOST which seems to make sense.</p>
  
  <p>But when I add some TextViews like this after my view:</p>
  
  <pre><code>  &lt;LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" &gt;
        &lt;MyView   
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
         android:id="@+id/someId"&gt;&lt;/MyView&gt;
      &lt;TextView android:text="1"  android:layout_width="fill_parent"
    android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
      &lt;TextView android:text="2"  android:layout_width="fill_parent"
    android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I still get the same height/heightmode values (onMeasure is actually called twice, but with the same arguments). I thought that as the TextViews consume some space, there should be less space for MyView? (Which would be ok, but I need to know how much space I can occupy...)</p>
  
  <p>Any ideas? Thanks a lot!</p>