Pergunta

I'm developing an android game and will try cover as many different phone and tabled screen sizes and resolutions as possible. To make it easier to handle graphics I've designed some of my icons so that for example a 7" mdpi tablet uses same icons as an xhdpi phone.

That means I have put exactly the same icon file in drawable-xhdpi folder as in drawable-sw600dp-mdpi. I also have same files in drawable-land-xhdpi as in drawable-sw600dp-land-mdpi. It doesn't feel good to have duplicate files, can it be avoided somehow? Or how smart is eclipse compiler, can it detect duplicate files and compress the apk file accordingly?

Foi útil?

Solução

You can avoid duplicating image files by using aliases. An image alias is an XML resource file containing a <bitmap /> tag. Look at the documentation for the syntax.

In your case I think you should name your resources differently for phone and tablets if they don't end up having the same density-independent size. From what I understand, your tablet images are bigger than your phone images, which is generally not a good idea.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top