Link different size in dimen

Can I use a dimension resource link in another dimension? I mean something like this:

dimen.xml file:

 <dimen name="test1">18sp</dimen> <dimen name="test2">@dimen/test1</dimen> 
+6
source share
2 answers

It works the way I posted

 <dimen name="test1">18sp</dimen> <dimen name="test2">@dimen/test1</dimen> 
+10
source

Why do you want to create a second dimension with the same value as the first?

Do not create a second dimension, but use first!

-2
source

Source: https://habr.com/ru/post/950266/


All Articles