title: Fill remaining space with fixed aspect ratio surfaceview
body: <p>I'd like to layout a view like the following, but I'm not sure how to go about doing so:</p>
  
  <ul>
  <li>At the bottom of the screen is a regular view, with a fixed size (fill-width and some number of dp for height)</li>
  <li>Filling the remaining vertical space, I would like to place a custom view which inherits from glSurfaceView, with the restriction that it must have a fixed aspect ratio, which will be programatically set, but known before the activity is created. (In this case assume it with be 2:3 w:h).</li>
  </ul>
  
  <p>Here's a little picture of what I'm imagining:</p>
  
  <pre><code> .----------------------. 
   |   .--------------.   |  
   | b |              | b |  
   | g |              | g | 
   |   |              |   |  
   | i |  MySurface   | i | 
   | m |     View     | m | 
   | a |              | a | 
   | g |  (2:3 w:h)   | g | 
   | e |              | e | 
   |   *--------------*   | 
   |.--------------------.| 
   ||                    || 
   ||   SomeOtherView    || 
   ||                    || 
   |*--------------------*| 
   *----------------------* 
  </code></pre>
  
  <p>As far as setting up the MySurfaceView, I assume that normal layout_width and layout_height are not going to help me, because I don't know the available screen size until after the screen has been partially laid out, and <code>SomeOtherView</code> has been placed. </p>
  
  <p>Is there some function in <code>MySurfaceView</code> that I want to override, that for example will pass as arguments the available screen space, and let me decide how to set the width and height of the view? </p>
  
  <p>Is 'inflation' the right term I'm looking for here? I think that has something to do with what I'm looking for, but I don't really know the terminology.</p>
  
  <p><a href="https://stackoverflow.com/a/10522282/1236185">Updated below</a> with the result of my research, and I think a possible correct solution.</p>