This is my xml code:

```
        <ImageView
        android:id="@+id/ColImgPath"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:adjustViewBounds="true"
        android:background="@drawable/border"/>

```

and this my java code, that it is inside listview:

```
ImageView imageView = (ImageView) convertView.findViewById(R.id.ColImgPath);
        imageView.setPadding(5, 5, 5, 5);
            imageView.setVisibility(View.VISIBLE);
    try {
            Bitmap bmp = ((Bitmap) MyArrList.get(position).get("ImageThumBitmap"));
            int bmpx = bmp.getWidth();
            int bmpy = bmp.getHeight();

            Log.i("INFO","X: "+bmpx+" Y: "+bmpy);

            Bitmap photobitmap1 = Bitmap.createScaledBitmap(bmp, bmpx/2,bmpy/2, true);
            imageView.setImageBitmap(photobitmap1);
            //imageView.setImageBitmap((Bitmap) MyArrList.get(position).get("ImageThumBitmap"));

        } catch (Exception e) {
            // When Error
            imageView.setImageResource(android.R.drawable.ic_menu_report_image);
        }

```

The problem is that I want to put the bitmap resized into bitmap but the imageview always appears squared.
The size of the bitmap is: `X: 4160 Y: 3120` and the screen size is : `WIDTH= 1080 HEIGHT= 1776`

I want to put the width fill parent and resize the height keeping the aspect ratio. I tried some xml alternatives like `ScaleType.

Someone knows the way to put correctly the bitmap?