Is it bad to use multiple dimens.xml files with dififrent width for storing size variables in android?

Is it bad practice to use multiple dimens.xml files with different sw<>dp, in order to store different dp amounts for scaling sprites on different devices. Should I do this a different way.

Upvotes: 1

Views: 101

Answers (2)

Actiwitty
Actiwitty

Reputation: 1242

It is the recommended thing to do. You can customize dimensions originally defined in res/values/dimens.xml (such as screen margins) for sw720dp devices (e.g. 10" tablets) in landscape in the res/values-sw720dp-land for instance.

Upvotes: 2

pelotasplus
pelotasplus

Reputation: 10052

Sounds like a good idea. This is from one of my projects:

enter image description here

as you can see I have 2 dimens.xml files one in res/values/ folder and the second one in res/values-w820dp/ folder.

Upvotes: 1

Related Questions