This project demonstrates how to create a custom view, add some configurable attributes to it, and make it appear in the LayoutEditor.
This is the companion code to this post http://droidista.blogspot.com/2014/06/adding-attributes-to-custom-view.html