Which size of an image should be placed in the neutral drawable folder?
I have an icon file in 5 different versions:
On the other hand I have 6 different folders:
5 Files and 6 folders means that either one folder has to stay empty (which one?) or one file has to be used twice?
This is what the docs say:
If no matching resource is available, the system uses the default resource and scales it up or down as needed to match the current screen size and density
The "default" resources are those that are not tagged with a configuration qualifier. For example, the resources in drawable/ are the default drawable resources. The system assumes that default resources are designed for the baseline screen size and density, which is a normal screen size and a medium density. As such, the system scales default density resources up for high-density screens and down for low-density screens, as appropriate.
However, when the system is looking for a density-specific resource and does not find it in the density-specific directory, it won't always use the default resources. The system may instead use one of the other density-specific resources in order to provide better results when scaling. For example, when looking for a low-density resource and it is not available, the system prefers to scale-down the high-density version of the resource, because the system can easily scale a high-density resource down to low-density by a factor of 0.5, with fewer artifacts, compared to scaling a medium-density resource by a factor of 0.75.
OK, that the mdpi version should be placed in drawable-mdpi, ldpi in drawable-ldpi, etc. is out of question. But which version goes to the neutral folder?
Should I place the xxhdpi files there (scale down if no match is found)? What about the -xxhdpi folder than? Keep it empty or place the files there as well?
The default /drawable
folder expects mdpi images
. And mostly used in 2 cases:
To have non-density dependent images. eg: selectors, which indirectly link to images from density named folders again.
To have all the images in only this folder and ignore all the other drawable folders. In which case the images will be scaled depending on the screen density.
For your case:
You can keep only xml files like selectors in the default
/drawable
folder and other images in their respective folders
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With