In Android I've got the following:
dimens.xml
<dimen name="buttonMarginRL">10dp</dimen>
<dimen name="buttonMarginTB">5dp</dimen>
style.xml
<style name="my_button" parent="@android:style/Widget.Button">
<item name="android:textSize">16sp</item>
<item name="android:layout_marginLeft">@dimen/buttonMarginRL</item>
<item name="android:layout_marginRight">@dimen/buttonMarginRL</item>
<item name="android:layout_marginTop">@dimen/buttonMarginTB</item>
<item name="android:layout_marginBottom">@dimen/buttonMarginTB</item>
</style>
And I'm adding it to a button view:
someFragment.xml
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button"
style="@style/my_button" />
But the margins do not get applied. When putting 10dp and 5dp directly into the my_button style it works as expected. Is it possible within Android to use values specified in dimens.xml to be used in custom styles or may the dimens-values only be applied to view's directly?