Set maximum resolution on ImageView

Is there a way to set a maximum resolution on ImageViews? Java or xml, doesn’t matter (ex. 1080 * 1920 pixels, that the image get downscaled)