I’ve been messing around in the ADT source. There are Layout Rules for all the views that can be dragged over in the graphical editor. These rules appear to allow you to add extra XML attributes automatically (for instance, adding the handler, and content for a SlidingDrawer). Has anyone use these successfully? I tried just using my custom view + Rule, like how the current ones are, but it doesn’t work. I also don’t see where these Rule files are used.
Basically, I’m trying to create a modified SlidingDrawer. Even just extending SlidingDrawer itself, it seems to lose the XML attributes of it’s parent. (So it doesn’t show up in the UI screen, and doesn’t place the handler, and content views).
Ok, the view rules require at least ADT 16.
A few things which are good to know:
1) Make sure the rule is the same name as your custom class, only with Rule at the end (ex MyCustomViewRule).
2) Make sure your view rule is in the same package
3) Make sure you export your view rules to a separate jar
4) Add the jar to your project, but do NOT add it to the build path
5) Add the following line to your project.properties file (note: the location has to be the actual filesystem location)
I believe in r17 they are going to make the filepath relative to the project, or workspace, rather than the actual filesystem location.