A naked layout resource directory Android OS interprets as layout, normal, mdpi, according to the docs. If I create a new project and make layout structure like this:
/res/
/layout/
/layout-normal/
OR
/res/
/layout/
/layout-normal-mdpi/
I get no error. Why?
If there is no error, then I can conclude that naked layout directory is not normal, mdpi, but it’s for all those layout which were not explicitly set, right?! So its purpose is always variable?!
In example no.2., if I load the content on normal, mdpi mobile screen, will it load from the naked or explicit directory?
Thanks in advance anyone taking time to clarify this for me.
The app may be running on a device that disqualifies the
/layout-normal-mdpiresources from consideration. It will then fall back on the resources in/layout. In other words, the resources in/layoutwill be used as the default for any configuration that has no more specific resource available.It makes a bit more sense to talk about drawables. The system will scale drawables from
/drawablefrom the defaultmdpito the density of the actual configuration. The/drawable-mdpiresources, on the other hand, will be used specifically formdpiconfigurations.