You deal with this in the same way as with a user turning the phone to the side. This is the same presentation solution as the user interface.
Remember that Android supports alternative layouts for identical views. If you have a portrait layout, for example. res / layout / gallery.xml , you can create a landscape equivalent in res / layout-land / gallery.xml , and Android will automatically download the last layout file if the action starts in landscape mode.
Using a separate layout XML file, you can organize your image as it seems to you, it best suits the intent of your application (an application that displays medical images may have different presentation priorities than one that displays a family portrait). For example, you can simply fill the background with a gradient or more information that is otherwise hidden in portrait mode. It all depends on what you want to achieve using your application, and on how much you are willing to go to account for all the possibilities.
But ultimately, if the user can see the image in it, without requiring turning over their netbook on it, I think they will be happy :)
source share