Define custom Android components using short namespace?

Work with my first Android app. I am wondering if there is a way to use xmlns in markup in any way. In Flex, for example, I can define a namespace:

<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:cb="com.typeoneerror.apps.app.views.components.*"> <cb:CustomComponent paramName="demo"></cb:CustomComponent> </mx:VBox> 

Android seems a bit different. You use the namespace when defining parameters, but not in the tag itself. This is a bit of verbosity for me, so I'm wondering if there is a way to tweak or change this:

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cb="http://schemas.android.com/apk/res/com.typeoneerror.apps.app"> <com.typeoneerror.apps.app.views.components.CustomComponent cb:paramName="demo"/> </LinearLayout> 

I would like to use

 <cb:CustomComponent cb:paramName="demo"></cb:CustomComponent> 

Possible?

+7
source share
1 answer

No, sorry. The element name is the name of the Java class, and in the case of custom widgets, this is the fully qualified name of the class.

I saw some syntax when the name of the View element, and there is a class attribute with the class name of the widget. I can not find it in the documents and do not have an available sample.

+2
source

All Articles