Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If a drawable resource is provided for ldpi, mdpi, hdpi, xhdpi, this drawable does not need to provided for nodpi?

Do I understand this correctly:

All android devices fall in one of these 4 density buckets: ldpi, mdpi, hdpi, xhdpi.

So, if a drawable resource is provided for each of these for densities (a drawable or with the same name exists in each of these folders), then it is not necessary to provide a drawable with the same name in /res/drawable or /res/drawable-nodpi.

Is my understanfing correct?

So, the only reason, why it makes sense to provide that same resource in /res/drawable would be, to make the app more future-proof, in case a new density bucket is defined for Android OS?

like image 681
mrd Avatar asked May 19 '12 20:05

mrd


1 Answers

Is my understanfing correct?

Through this paragraph, you are more or less correct. You go a bit "off the rails" with your next paragraph:

So, the only reason, why it makes sense to provide that same resource in /res/drawable would be, to make the app more future-proof, in case a new density bucket is defined for Android OS?

Not really.

You put resources in res/drawable/ that are intrinsically scalable (e.g., a ShapeDrawable). You put resources in res/drawable-nodpi/ that, for some reason, you do not want to be scaled to match the device density.

If Android invents a new density bucket (e.g., -uhdpi for an ultra-high density of 400dpi), Android will probably do what it does today if you skip a density bucket: scale one of your other editions. For example, if you have -xhdpi and do not have -hdpi, Android will down-sample the -xhdpi image for use on an -hdpi device.

like image 192
CommonsWare Avatar answered Oct 12 '22 22:10

CommonsWare