title: Setting custom position of CENTER.CROP images in gallery. Cutting bottom part of image instead of top one
body: <p>I have a problem with centering images in gallery. I want them to fill maximum space available in gallery but don't want them to be cutted on top of the screen. I'd like to see theirs top parts rather than bottom ones.</p>
  
  <p><strong>My question is how can I set the position so that I can see the 'top part' of an image in gallery?</strong></p>
  
  <pre><code>images.setScaleType(ImageView.ScaleType.CENTER_CROP)
  </code></pre>
  
  <p>sets the image to fill all the available space maintaining its ratio. The problem is my images are more higher than widther and in result the top part of them isn't visible.</p>
  
  <p>I have a custom gallery: CustomGallery which layout is:</p>
  
  <pre><code>android:id="@+id/photos_gallery"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:fadingEdge="none"
  android:spacing="0dp"
  </code></pre>
  
  <p>The gallery uses adapter: GalleryAdapter which extends BaseAdapter. Its getView method is following:</p>
  
  <pre><code>@Override
  public View getView(int position, View convertView, ViewGroup parent) {
      ImageView image = new ImageView(mcontext);
      image.setLayoutParams(new Gallery.LayoutParams(
          android.widget.Gallery.LayoutParams.FILL_PARENT,
          android.widget.Gallery.LayoutParams.FILL_PARENT));      
      image.setScaleType(ImageView.ScaleType.CENTER_CROP);        
  
      image.setImageBitmap(getImgSource(position));   
  
      return image;   
  }
  </code></pre>