From 528954c4d63980c0515528624130477f921cbc60 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Fri, 11 Sep 2009 14:14:36 -0700 Subject: [PATCH] docs only. fix sample code errors per bug 2115299 Change-Id: Ie0e614b0b8fdb0ec744db288042ab1f484f52bfd --- docs/html/guide/topics/resources/available-resources.jd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/html/guide/topics/resources/available-resources.jd b/docs/html/guide/topics/resources/available-resources.jd index 0dfc625793e4..f5f1475b79da 100644 --- a/docs/html/guide/topics/resources/available-resources.jd +++ b/docs/html/guide/topics/resources/available-resources.jd @@ -908,7 +908,7 @@ res/layout/some_file.xml.

 <ViewGroupClass xmlns:android="http://schemas.android.com/apk/res/android"
-                id="@+id/string_name" (attributes)>
+                android:id="@+id/string_name" (attributes)>
    <widget or other nested ViewGroupClass>+
    <requestFocus/>(0 or 1 per layout file, assigned to any element)
 </ViewGroupClass>
@@ -919,7 +919,7 @@ res/layout/some_file.xml.

The file must have a single root element. This can be a ViewGroup class that contains other elements, or a widget (or custom item) if it's only one object. By default, you can use any (case-sensitive) Android {@link android.widget widget} or {@link android.view.ViewGroup ViewGroup} class name as an element. These elements support attributes that apply to the underlying class, but the naming is not as clear. How to discover what attributes are supported for what tags is discussed below. You should not assume that any nesting is valid (for example you cannot enclose <TextView> elements inside a <ListLayout>).

-

If a class derives from another class, the XML element inherits all the attributes from the element that it "derives" from. So, for example, <EditText> is the corresponding XML element for the EditText class. It exposes its own unique attributes (EditText_numeric), as well as all attributes supported by <TextView> and <View>. For the id attribute of a tag in XML, you should use a special syntax: "@+id/somestringvalue". The "@+" syntax creates a resource number in the R.id class, if one doesn't exist, or uses it, if it does exist. When declaring an ID value for an XML tag, use this syntax. Example: <TextView id="@+id/nameTextbox"/>, and refer to it this way in Java: findViewById(R.id.nameTextbox). All elements support the following values:

+

If a class derives from another class, the XML element inherits all the attributes from the element that it "derives" from. So, for example, <EditText> is the corresponding XML element for the EditText class. It exposes its own unique attributes (EditText_numeric), as well as all attributes supported by <TextView> and <View>. For the id attribute of a tag in XML, you should use a special syntax: "@+id/somestringvalue". The "@+" syntax creates a resource number in the R.id class, if one doesn't exist, or uses it, if it does exist. When declaring an ID value for an XML tag, use this syntax. Example: <TextView android:id="@+id/nameTextbox"/>, and refer to it this way in Java: findViewById(R.id.nameTextbox). All elements support the following values:

  • id - An ID value used to access this element in Java. Typically you will use the syntax @+id/string_name to generate an ID for you in the id.xml file if you haven't created one yourself. @@ -1007,7 +1007,7 @@ res/layout/some_file.xml.

    android:paddingBottom="4" // TextView.paddingBottom android:text="@string/redirect_getter"/> // TextView.text - <EditText id="@+id/text" + <EditText android:id="@+id/text" android:layout_width="fill_parent" // EditText.LayoutParams.width android:layout_height="wrap_content" // EditText.LayoutParams.height android:layout_weight="0" // EditText.LinearLayoutParams.weight @@ -1015,7 +1015,7 @@ res/layout/some_file.xml.

    <requestFocus /> </EditText> - <Button id="@+id/apply" + <Button android:id="@+id/apply" android:layout_width="wrap_content" // Button.LayoutParams.width android:layout_height="wrap_content" // Button.LayoutParams.height android:text="@string/apply" /> // TextView.text @@ -1047,7 +1047,7 @@ setContentView(R.layout.main_screen); Java implementation file - The implementation file. The class must extend {@link android.view.View View} or a subclass. See LabelView.java in ApiDemos.
  • - res/values/attrs.xml - Defines the XML element, and the attributes that it supports, for clients to use to instantiate your object in their layout XML file. Define your element in a <declare-styleable id=your_java_class_name>. See res/layout/attrs.xml in ApiDemos. + res/values/attrs.xml - Defines the XML element, and the attributes that it supports, for clients to use to instantiate your object in their layout XML file. Define your element in a <declare-styleable name=your_java_class_name>. See res/values/attrs.xml in ApiDemos.
  • res/layout/your_class.xml [optional] - An optional XML file to describe the layout of your object. This could also be done in Java. See custom_view_1.xml in ApiDemos. -- 2.11.0