0

I am working on supporting my app on multiple screens. From this link I could understand that using smallest width qualifier, we can have multiple layout files for same screen and Android OS will pick the appropriate ones depending on the width of the screen.

My question is, can smallest width qualifier be used for values folder? say for example I want to change the width of a widget depending on the width of the device screen. So I want to place width in dp in dimens.xml file and use this value in my layout file. So, can I create folders like values-sw320dp, values-sw410dp etc and put dimens.xml files in each having different values?

Jayakrishnan Salim
  • 977
  • 1
  • 10
  • 24

1 Answers1

1

Yes that's possible, and also a good way to handle different dimensions for different screen sizes.

For example, determining if the device is a tablet can also be done with values-sw600dp: https://stackoverflow.com/a/9308284/1395437

Community
  • 1
  • 1
Daniel Zolnai
  • 16,487
  • 7
  • 59
  • 71