I have an ImageView which I want to always be the same size. If the image is smaller than the view, I'd like it to be centred in the view. If the Image is larger than the view then I'd like it scaled down - with aspect ratio preserved.
I've had several attempts at this myself - the latest of which is:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:id="@+id/itemImage" android:layout_width="100dp"
android:layout_height="100dp" android:scaleType="fitCenter"
android:adjustViewBounds="true" android:gravity="center" android:padding="10px" />
<TextView android:id="@+id/currentLentItem" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:padding="10px"/>
</LinearLayout>
What am I missing here?