Android – custom UI with custom attributes
Yes. Short guide: 1. Create an attribute XML Create a new XML file inside /res/values/attrs.xml, with the attribute and it’s type <?xml version=”1.0″ encoding=”UTF-8″?> <resources> <declare-styleable name=”MyCustomElement”> <attr name=”distanceExample” format=”dimension”/> </declare-styleable> </resources> Basically you have to set up one <declare-styleable /> for your view that contains all your custom attributes (here just one). I never … Read more