What is the <macro> tag in android xml file

232 Views Asked by At

I was looking at some attributes references in the material design library and I stubled upon the <macro> tag.

Quick example found in the res/values of com.google.android.material:material:1.10.0 lib:

<macro name="m3_comp_assist_chip_container_shape">?attr/shapeAppearanceCornerSmall</macro>
<macro name="m3_comp_assist_chip_label_text_type">?attr/textAppearanceLabelLarge</macro>

I cannot find documentation about it in the android documentation. I searched in the XLIFF specification too and the word macro do not appears. Still, Android studio recognised it and allow me to write it in the <resources> tag.

What is the <macro> tag ? How/when should it be used ?

1

There are 1 best solutions below

2
ΓDΛ On BEST ANSWER

macro is a form of constant definition.

<macro> is not official property in Android resources.

For you

m3_comp_assist_chip_container_shape

to this value

?attr/shapeViewCornerSmall

This value has been assigned.