I want to retrieve some information about custom attributes defined inside the 'attrs.xml' resource file of some library. In detail, I want to get the name and the format of all attributes.
I searched the documentation but I didn't find any example on how to do this. I only found examples on how to retrieve the values of these attributes inside a constructor of a custom view.
For example, given the following XML resource file.
<resources>
<declare-styleable name="PieChart">
<attr name="showText" format="boolean" />
<attr name="labelPosition" format="enum">
<enum name="left" value="0"/>
<enum name="right" value="1"/>
</attr>
</declare-styleable>
</resources>
I want to get the list of attributes with their names and types. Something like this.
Attribute name: showText, type: boolean
Attribute name: labelPosition, type: enum {left, right}