title: Android image scaling in the Gallery
body: <p>I have two images in a Gallery view. First I add a 80x80 image, and then a bigger one (400x400). I want both images to be displayed as 80x80 to match the size of the first image.</p>
  
  <p>If I hardcode the size</p>
  
  <pre><code>image.setLayoutParams(new Gallery.LayoutParams(80, 80));
  image.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
  </code></pre>
  
  <p>all goes OK. But if I try to evade the hardcoding in case that the first image will be changed </p>
  
  <pre><code>image.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
  image.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
  </code></pre>
  
  <p>the big image is displayed as 400x80, and is not scaled: only the central slice of it is visible.</p>
  
  <p>How can I make all the images in the Gallery to be scaled to match the size of the first added image without specifying that size directly?</p>