Say I have the following directory tree:
resources/drawables/launcher_icon.png
resources/drawables/drawables.xml
Now for a specific device, I want to use a different png:
resources-whatever/drawables/launcher_icon.png
I compile for my whatever device, but it still uses the original image. Huh. Ah, but I access the image via the <bitmap> in drawables.xml, and it's seeing the regular drawables.xml in the normal resources directory, which refers to the original image. Fine. I verify this by copying the original drawables.xml in resources-whatever:
resources-whatever/drawables/launcher_icon.png
resources-whatever/drawables/drawables.xml
And everything works as expected, getting the device specific image, but now if I make a change to the original drawables.xml, I need to propagate that change throughout any copies of it. Ugh. Ah, I think, I'll just symlink the device specific drawables.xml to the original and thus avoid the duplication problem, so now I have:
resources-whatever/drawables/launcher_icon.png
resources-whatever/drawables/drawables.xml -> ../../resources/drawables/drawables.xml
...but this doesn't work as expected. In this case I just get the original behaviour. It seems like the compiler is resolving the symlink and processing it as if we're in the target directory, which is where the original image resides, so we get that one.
Is this what is going on? Is there some way of resolving this type of situation without just having multiple copies of your xml files in different directories, because that is horrible.