Sunday, August 1, 2010

[android-developers] Resource Directory Qualifier Limitation?

I think I am finding what I think is a significant limitation in the
way the resource directory qualifiers (-hdpi, -v4, -en, etc) work. I
have three directories: drawable-hdpi-v4, drawable-ldpi-v4, and
drawable (for normal screens and phones running 1.5). I have image X
that I want to have a high resolution version of in the hdpi directory
and a default one in the plain "drawable" directory. I also have
image Y that I would like Android to upscale, or downscale depending
on the screen size and only want to manage one image file located in
the "drawable" directory. This is to save file size because I don't
need crisp resolution for 240dpi phones and also so I don't have to
create three versions of ALL images if I want Android to handle the
scaling.

I am finding that using post-v4 emulators with 240dpi screens with
Eclipse, they get confused with this "hybrid" directory structure and
choose to treat all images the same way. I.e. if image Y is found in
the "drawable" folder and not in "hdpi", it correctly displays it
upscaled and then goes and sees that there is both an image X in
"drawable" and "drawable-hdpi-v4" and chooses one of them at random
and upscales whichever one it picks the same way it scaled Image Y.
So, if it decides to use the high-res version it blows it up even
bigger when it didn't have too as if it was found in the "drawable"
directory.

I have no idea what's going on here or if there's a solution. Do I
have to have all of my resources in the "drawable" directory and let
Android scale things or have three times the number of image files by
having resources in all three directories to make sure all resources
are found and treated consistently? I am hoping this is some weird
emulator bug that does not reflect how the real OS would treat things.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment