I simply have an image from phone gallery, most of them are either portrait i.e. (height > width) or landscape (width > height)
i want to display each photo in a square shape each image is larger than the imageview that i am going to put it into, that is ok, i want the image to be cropped and centered,
I have been using the imageview scaleType
FitXY
it gives me what i want, a square, but it doesn't keep the aspect ratio, so image looks distorted.
so i use
centerCrop
the aspect ratio is kept, but the imageview is no longer a square (due to aspect ratio is being kept)
i guess what i want is both centerCrop + fitXY, i.e. i want a sqaure image with aspect ratio kept
how can i do this?