I was wondering if it is possible to make a dimension a multiple of another dimension in Android. E.g., so I can do something like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="base">50dp</dimen>
<dimen name="size_of_something">4*@dimen/base</dimen>
</resources>
Right now, I use a workaround like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="base_x1">50dp</dimen>
<dimen name="base_x2">100dp</dimen>
<dimen name="base_x3">150dp</dimen>
<dimen name="base_x4">200dp</dimen>
<!-- etc... -->
<dimen name="size_of_something">@dimen/base_x4</dimen>
</resources>
But this means that I have to update all the multiples every time I change the base size, which is not only cumbersome, but also error-prone.