title: Scale an ImageView to fill screen horizontally and scroll (if necessary) vertically in ScrollView
body: <p>I've tried as many permutations of <code>scaleType</code> and <code>fillViewport</code> and <code>adjustViewBounds</code> and <code>layout_*</code> as I can think of and none of them do what I want.  They either fill the screen but lose the aspect ration (<code>fillXY</code>), cut off a portion of the image (<code>centerCrop</code>), or scale the image down so it doesn't fill the width of the screen (<code>centerInside, fitStart, fitCenter, center, matrix</code>).  </p>
  
  <p>Here is one specific example:  </p>
  
  <p>Source image is 222x470 pixels.<br>
  Emulator screen is 480x800hdpi in portrait orientation.  </p>
  
  <p>I want the <code>ScrollView</code> to fill the entire screen.<br>
  I want the <code>ImageView</code> to scale the image so it fills the width of the screen (stretching the source image from 222 wide to 480 wide).<br>
  I want the <code>ImageView</code> to preserve the aspect ratio of the source image, meaning its height will have to scale from 470 pixels to approximately 1016 pixels.<br>
  Since that won't fit on the screen (it is only 800 pixels high), the <code>ScrollView</code> should kick in.  By default the top of the image should show and the <code>ScrollView</code> should allow scrolling down to see the rest of the image.  </p>
  
  <p>This is just one example.  Ideally I'd like this to work regardless of image size and screen size.</p>
  
  <p>Extra credit if you know a way to do it all within the XML layout.  </p>
  
  <p>And before y'all come down on me like a ton of bricks (or bricked cellphones?), I'm aware there are several similar questions on this site (see <a href="https://stackoverflow.com/questions/9623361/imageview-fill-horizontal-maintaining-aspect-ratio">here</a>, <a href="https://stackoverflow.com/questions/16289398/scale-scrollview-contents-to-fill-screen">here</a>, <a href="https://stackoverflow.com/questions/15616605/android-imageview-scale-to-screen-width-within-a-scrollview">here</a>, <a href="https://stackoverflow.com/questions/8276728/fitting-imageview-horizontally">here</a>, and <a href="https://stackoverflow.com/questions/16858492/how-to-scale-small-imageview-to-fill-large-scrollview">here</a>) but they are either unanswered or the answers are unacceptable ("use fitXY", which does not preserve aspect ratio, or require specifying exact pixel width/height in the ImageView which is not a general purpose solution to the problem).  It'd be nice to get a solid answer to this documented and out there.</p>