First of all, I am not sure where I did wrong in the code I wrote.
As you can see here in the screenshots, are 3 different devices. Notice the image inside the red box. The image in Xperia Z Ultra screen has been cropped, but the rest is okay:
Samsung Galaxy SII (Jelly Bean)
Nexus 7 (KitKat)
Xperia Z Ultra (KitKat)
I put the images in a ListView which is then inflated inside an adapter. Here is the layout code for the custom rows:
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/img_item"
android:src="@drawable/error"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />
</RelativeLayout>
In adapter, I used Picasso image loader to load the image. I didn't set any image scaling options.
public class ItemPhotoAdapter extends BaseAdapter {
...
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
...
Picasso.with(context) //
.load(iim.getResized()) //
.placeholder(R.drawable.placeholder) //
.error(R.drawable.error)
.into(vh.item_image);
return view;
}
}
Anyone know what's going on here?