In my Android project I have a custom view with a custom property. Setting the property works fine:
<com.mycompany.CustomView
[...]
mycompany:myproperty="myvalue"
/>
What I want to do is set the property in a style, so that I have a style like this:
<style name="CustomViewStyle">
<item name="mycompany:myproperty">myvalue</item>
</style>
And change the custom view declaration to this:
<com.mycompany.CustomView
[...]
style="@style/CustomViewStyle"
/>
However, this results in the build error No resource found that matches the given name: attr 'mycompany:myproperty'. Adding the namespace declaration xmlns:mycompany="http://schemas.android.com/apk/res-auto" to style.xml does not help. Is there a way to make this work?