But this code does not work correctly. Why?
Because build tools do not support it. The last thing I checked should contain any prefix namespace (for example, xmlns:a="http://schemas.android.com/apk/res/android" ), but the default namespace never worked.
If you want, you can suggest and make corrections. Along the way, you can determine if there is a philosophical reason for this, a technical reason, or if they simply never circumvented it.
Why is the namen element in CamelCase and the attributes are in under_score?
Element names are Java classes that are commonly found in CamelCase. Attributes are not in the "under_score" at all - the layout_ prefix indicates a family of attributes that are requests from the View to its container. But if you look closely at the attributes, you will see that most of them are camelCase, ignoring this prefix (e.g. android:textSize ).
CommonsWare
source share