Android allows us to define hdpi/mdpi/ldpi for the drawable folder in order to account for different sized screens/devices. I was wondering if that same support can be applied for the Values folder (or even the layout folder)? Reason being, I typically define a “sizes.xml” file which holds standard dp sizes that I apply to margins and paddings. I also do the same for sp sizes for text. I’d like to adjust those values based on the phones dpi.
Android allows us to define hdpi/mdpi/ldpi for the drawable folder in order to account
Share
Yes, I believe anything in the
res/folder can use “Configuration Qualifiers”. So for example, you can have avalues-sw600dp-mdpi-land/folder.See “Using Configuration Qualifiers”:
http://developer.android.com/guide/practices/screens_support.html#qualifiers
I first noticed this by looking at Google’s IOSched app sample code, look at the
resfolder:https://github.com/google/iosched/tree/master/android/src/main/res
You’ll see that they have “values-sw600dp-land”, “values-w400dp” and “values-v17” folders, just to name a few.