title: Inflated children of custom LinearLayout don't show when overriding onMeasure
body: <p>I'm trying to show a <code>MyCustomLinearLayout</code> which extends <code>LinearLayout</code>. I'm inflating the <code>MyCustomLinearLayout</code> with the <code>android:layout_height="match_parent"</code> attribute. 
  What I want is to show an <code>ImageView</code> in this <code>MyCustomLinearLayout</code>. The height of this <code>ImageView</code> should be <code>match_parent</code>, and the width should be equal to the height. I'm trying to accomplish this by overriding the <code>onMeasure()</code> method. What happens, is that <code>MyCustomLinearLayout</code> does become square like it should, but the <code>ImageView</code> is not showing.</p>
  
  <p>Below my used code. <em>Please note that this is an extremely simplified version of my problem. The <code>ImageView</code> will be replaced by a more complex component.</em></p>
  
  <pre><code>public MyCustomLinearLayout(Context context, AttributeSet attrs) {
      super(context, attrs);
      init(context);
  }
  
  private void init(Context context) {
      final LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      inflater.inflate(R.layout.view_myimageview, this);
  
      setBackgroundColor(getResources().getColor(R.color.blue));
  }
  
  @Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
      int height = getDefaultSize(getSuggestedMinimumHeight(), heightMeasureSpec);
      setMeasuredDimension(height, height);
  }
  </code></pre>
  
  <p>The <code>view_myimageview.xml</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;merge xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
      &lt;ImageView
          android:id="@+id/view_myimageview_imageview"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:src="@drawable/ic_launcher" /&gt;
  
  &lt;/merge&gt;
  </code></pre>
  
  <p>So when I override the <code>onMeasure()</code> method, the <code>ImageView</code> is not showing, when I don't override the <code>onMeasure()</code> method, the <code>ImageView</code> shows, but way too small, because the <code>MyCustomLinearLayout</code>'s width is too small.</p>