2

I've next problem. I create next attr.xml :

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="PublicMap">
        <attr name="public_map" format="boolean"/>
    </declare-styleable>
    <declare-styleable name="SceneMap">
        <attr name="public_map" format="boolean"/>
        <attr name="preview_mode" format="boolean"/>
    </declare-styleable>
</resources>

now project can not be compiled. Error is "error: Attribute "public_map" has already been defined". Is not possible to declare attributes with the same name for different views?

KoirN
  • 338
  • 1
  • 4
  • 14

1 Answers1

0

I tested this on one of my project and noticed that its NOT possible to have same attr name under different declare-styleable.

However, you may append a prefix in order to differentiate attributes with similar names.

waqaslam
  • 67,549
  • 16
  • 165
  • 178