summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/package.html
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/widget/package.html')
-rw-r--r--core/java/android/widget/package.html32
1 files changed, 32 insertions, 0 deletions
diff --git a/core/java/android/widget/package.html b/core/java/android/widget/package.html
new file mode 100644
index 0000000..7d94a4b
--- /dev/null
+++ b/core/java/android/widget/package.html
@@ -0,0 +1,32 @@
+<HTML>
+<BODY>
+The widget package contains (mostly visual) UI elements to use
+on your Application screen. You can design your own <p>
+To create your own widget, extend {@link android.view.View} or a subclass. To
+use your widget in layout XML, there are two additional files for you to
+create. Here is a list of files you'll need to create to implement a custom
+widget:
+<ul>
+<li><b>Java implementation file</b> - This is the file that implements the
+behavior of the widget. If you can instantiate the object from layout XML,
+you will also have to code a constructor that retrieves all the attribute
+values from the layout XML file.</li>
+<li><b>XML definition file</b> - An XML file in res/values/ that defines
+the XML element used to instantiate your widget, and the attributes that it
+supports. Other applications will use this element and attributes in their in
+another in their layout XML.</li>
+<li><b>Layout XML</b> [<em>optional</em>]- An optional XML file inside
+res/layout/ that describes the layout of your widget. You could also do
+this in code in your Java file.</li>
+</ul>
+ApiDemos sample application has an example of creating a custom layout XML
+tag, LabelView. See the following files that demonstrate implementing and using
+a custom widget:</p>
+<ul>
+ <li><strong>LabelView.java</strong> - The implentation file</li>
+ <li><strong>res/values/attrs.xml</strong> - Definition file</li>
+ <li><strong>res/layout/custom_view_1.xml</strong> - Layout
+file</li>
+</ul>
+</BODY>
+</HTML>