From 45baff978fec05b84c138acd3590c5b1290e7fcd Mon Sep 17 00:00:00 2001 From: David Friedman Date: Mon, 31 Aug 2015 01:48:37 -0700 Subject: [PATCH] Docs: Updated URI information for custom-view xlmns directive to reflect Gradle If you're building with Gradle, you no longer include the whole, fully-qualified name of your project in the URI. Instead, you just end the URI with res-auto. Change-Id: Ie7dda8ff8f320951a5bd5d94b80b738cc0d483dc --- docs/html/training/custom-views/create-view.jd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/html/training/custom-views/create-view.jd b/docs/html/training/custom-views/create-view.jd index 11be85f45e907..d9eebf5ff5dab 100644 --- a/docs/html/training/custom-views/create-view.jd +++ b/docs/html/training/custom-views/create-view.jd @@ -146,10 +146,16 @@ enable this behavior in your custom view, you must:

In order to avoid having to repeat the long namespace URI, the sample uses an {@code xmlns} directive. This directive assigns the alias {@code custom} to the namespace {@code - http://schemas.android.com/apk/res/com.example.customviews}. You can choose any alias + http://schemas.android.com/apk/res-auto}. You can choose any alias you want for your namespace.

+

Note: If you are not using Gradle to build +your project, your {@code xlmns} URI cannot include {@code res-auto}. +Instead, the URI must contain the fully qualified name of your project. In +this example, the non-Gradle URI would be: +{@code http://schemas.android.com/apk/res/com.example.customviews}.

+

Notice the name of the XML tag that adds the custom view to the layout. It is the fully qualified name of the custom view class. If your view class is an inner class, you must further qualify it with the name of the view's outer class.