I've been wanting to write some more on Android screen design from a technical perspective. I felt inspired yesterday when I came back fromand wrote this post on resolution, dpi, sizes and creating assets.
12 plus ones
Shared publicly•View activity
View 12 previous comments
- let me clarify my use case (it was an app developed a few months ago): The app contains a "get info" button, 80dp width with a "phone" icon as a "drawableLeft" (i.e. typical TextView/CompoundButon).
When shown on a Galaxy Tab 10.1 (xlarge-mdpi) the button was too small (as per the app designer and customer) so I had to create a copy of the drawable-hdpi phone icon inside drawable-xlarge-mdpi.
It's very similar to the launcher icons issue: a design decision where we want "bigger than the standard" buttons in xlarge-mdpi devices. Someone at Google decided that the launcher icon "viewable/touchable area" should be bigger than the standard and they put the "launchericonDensity/launcherIconSize/getDrawableForDensity" stuff in the framework to avoid resource duplication.Nov 24, 2012
- Yes I get it now, you don't want to create an entire new layout for xlarge-mdpi, just switch the drawables. That's not so much a "which size should my asset be" problem like in my post, but more the issue of how do you make everything responsive....Like a said, still a valid issue :) I'm pretty sure the aliasing trick works in this case, I think I've seen this in the platform apps too. And eh...nice launcher man ;)Nov 24, 2012
- Alias resources works with any qualifier: put all your different resources in the "drawable" folder like icon_mdpi.png, icon_hdpi.png... instead of a separate folder for each. Then use a xml alias in each folder you would copy the bitmaps otherwise. Aliases works exactly as if you were copying the real files: drawable-mdpi/icon.xml (links to "icon_mdpi"), drawable-hdpi/icon.xml (links to "icon_hdpi"), drawable-xlarge-mdpi/icon.xml (links to "icon_hdpi" if you prefer it)...Nov 24, 2012
- oh great! I always thought wrong about the plain "drawable" directory. So I could put my 3 different sizes pngs there and just alias the required one without android scaling it?Nov 24, 2012
- yes!Nov 24, 2012
- I spent a lot of time designing for print and have been waiting for high density displays for years. It will be only a short while now for all displays to be the equivalent of 300 DPI or more. At that point design will finally once again happen in physical and absolute meassures of length. Combine that with less storage and bandwidth restrictions and you can simply ship images that are just large enough for the desired output dimensions at 300dpi (or whatever it will be) and leave it to the OS to scale it down (and never up!) at run time. We are in a transitional phase. I'd call 30 years of low resolution pixel designs hell and we are finally ready to leave it behind. Sorry for the slightly off topic rant :)Nov 25, 2012