androidandroid-layout

Same dimen in App and Library


Can someone let me know, what if there is some dimen by same name in app and a library.

dimen.xml inside app

<dimen name="activity_horizontal_margin">10dp</dimen>

dimen.xml inside library

<dimen name="activity_horizontal_margin">12dp</dimen>

Which one will be used at runtime?

I can try it, but I will not be clear for the reason to being used as final value.


Solution

  • When you redefine (the same name) a dimension resource is like overriding the lib resource.
    Just like you override a class method.