I've a ImageView with fixed height (400dp) and variable width (match parent). I'm using Coil to load the content from the web.
I've some images that are landescape and other that are portrait.
I want to always fit the width and crop the height:
I can't get that.
If I use CenterCrop, the image is cropped on the width if is too large 
If I use CenterFit, the image doesn't fit the width if it's too tall

What's the best way to obtain the desired behaviour?
I tried using all the possible ScaleType, both on the ImageView and the Coil loader.

Make a custom
ImageViewlike so:Use it in your layout like this:
And load the image using Coil to this
CustomImageView.Replace
com.examplewith your package name.