I have an ImageView (square), I need to enter a photo in such a way that if the photo was taken in a vertical orientation, then the fields remained left and right (Fig. 1), and if in a horizontal orientation, then below and above (Fig. .2). How can I do that? Perhaps there is some special scaleType for this?
Picture 1:
Figure 2: