Question

I know I can extend an Android view and have seen the Notepad example of doing this. I was wondering if it is possible in addition to add new custom attributes for the view that would parse properly in the XML declarations of the custom view. I'm a bit of a novice at XML technology.

I read here that I can somehow add custom attributes in the custom view's constructor, but there is no detail given and no example shown.

Ideally I would also like to be able to extend the ADT visual layout previewer/editor to support the custom views (rendering them with my custom code and having the custom properties show up in the context menu, etc.)

I would love to be able to do this but am not sure it's feasible or even possible. I read that XML schema may or may not be extensible: "extend" an xml schema

If this scenario isn't directly supported, does someone know where to find the Android schema so I might be able to modify it directly?

Was it helpful?

Solution 2

I found the answer myself. The ApiDemos LabelView application has an example of this. I haven't yet verified whether or not the visual editor shows the custom behavior though.

OTHER TIPS

the panel widget in this project has its on xmlns its a pretty solid example not sure about your ADT question either http://code.google.com/p/android-misc-widgets/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top