I have already looked at this thread: ImageView adjustViewBounds not working but it doesn't apply to my situation.
Essentially, adjustViewBounds isn't working. Let's assume the following:
square_icon => 1000x1000
rectangle_icon => 400x100
device height => 1000
So what I want to happen is a vertical stacking of four icons with the following dimensions:
square_icon = 400x400
rectangle_icon = 400x100
square_icon = 400x400
rectangle_icon = 400x100
But what's happening is that the square_icon isn't taking up all the space it can... and the rectangle_icon is more like 400x200 instead of 400x100? The image isn't being scaled with an incorrect aspect ratio, there is just blank space added to the view (scalingType determines whether the space is at the top, bottom, or both)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
android:adjustViewBounds="true"
android:src="@drawable/square_icon" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/rectangle_icon" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
android:adjustViewBounds="true"
android:src="@drawable/square_icon" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/rectangle_icon" />
</LinearLayout>