2

I've created a new Android Resource Directory to Support different Screen sizes. I outsourced every hard coded size and TextSize in dimens.xml. But my values-small directory is not picked by Android. The dimensions are used in the layouts and in the activities.

Why is default picked instead of the small one?

The packages hierarchy looks like this:

The packages hierarchy looks like this

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
TimWalter
  • 47
  • 1
  • 12

2 Answers2

2

current size, that is mostly current used, is normal (reference)

small is practically not used by most devices

anatoli
  • 1,663
  • 1
  • 17
  • 43
  • Well, i works at large devices. but the Emulator says that the Screen size of this Emulator is small that's why i am wondering. I would like to Support every device obviously – TimWalter Jan 29 '17 at 12:57
  • If you want in code some resource(for example `large` screen), it looks first in `values-large`. If no resource found, then it looks in `values`. In `values-small`, `values-large` etc folders you should only define values, that are different to values in `values` folder – anatoli Jan 29 '17 at 13:15
0

You have to provide dimensions according to device screen density

values-sw720dp          10.1” tablet 1280x800 mdpi

values-sw600dp          7.0”  tablet 1024x600 mdpi

values-sw480dp          5.4”  480x854 mdpi 

values-sw480dp          5.1”  480x800 mdpi 

values-xxhdpi           5.5"  1080x1920 xxhdpi

values-xxxhdpi          5.5" 1440x2560 xxxhdpi

values-xhdpi            4.7”   1280x720 xhdpi 

values-xhdpi            4.65”  720x1280 xhdpi 

values-hdpi             4.0” 480x800 hdpi

values-hdpi             3.7” 480x854 hdpi

values-mdpi             3.2” 320x480 mdpi

values-ldpi             3.4” 240x432 ldpi

values-ldpi             3.3” 240x400 ldpi

values-ldpi             2.7” 240x320 ldpi

See answer https://stackoverflow.com/a/32861248/771098 for more details

Ernest Poletaev
  • 558
  • 5
  • 15