program the content of my app for a 3.2 "mdpi screen and it fits well, but when changing the view mode to a 5.1" mdpi it does not fit, help with this problem.
This is totally natural since if both are in MDPI, the images do not enlarge or shrink. Generally the devices (in the market) with more inches, will have higher MDPI density and therefore there will be no problem and they will look good. In the example you show in Android Studio it would be an extreme case.
However if you would like to change the size, width, height or padding and margins you can create folders for the dimensions:
values-xlarge
values-large
values-small
values-normal
In each folder you would have a file dimens.xml
with sizes such as:
<dimen name="ancho_imagen">48dp</dimen>
And in another folder another size, the equivalences are the following:
For example, if the screen is 5 inches, the measurement (size or value) that is in the values-large
folder will be used.
This would use the value in any View
for example:
android:layout_width="@dimen/ancho_imagen"
Sincerely, the layout looks very good. The elements will never be seen exactly the same on all devices.
In addition, thanks to working in dps and not in sizes relative to the screen with scaling, a large screen can be used.
Greetings.