OSDN Git Service

Deprecate fill_parent and introduce match_parent. (do not merge)
[android-x86/sdk.git] / eclipse / plugins / com.android.ide.eclipse.tests / unittests / com / android / ide / eclipse / testdata / mock_attrs.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 /*
4  * Copyright (C) 2008 The Android Open Source Project
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 -->
19 <resources>
20     <!-- WARNING !!! THIS IS A MOCK FILE. DO NOT USE FOR DOCUMENTATION PURPOSES.
21          This file has been trimmed down to only extract a number of interesting cases 
22          for unit tests.
23          
24          What this contains:
25          - View
26          - ViewGroup
27          - some attributes which format are defined in Theme
28          - orientation, gravity and layout_gravity defined before they are used
29          - ViewGroup_Layout
30          - ViewGroup_MarginLayout
31          - LinearLayout
32          - LinearLayout_Layout
33          - TableLayout
34          
35          Note that TableLayout does not have a TableLayout_Layout definition here
36          where these is a class TableLayout.LayoutData.
37     -->
38
39     <!-- These are the standard attributes that make up a complete theme. -->
40     <declare-styleable name="Theme">
41
42         <!-- Defines the scrollbars size. -->
43         <attr name="scrollbarSize" format="dimension" />
44
45     </declare-styleable>
46
47         
48     <!-- Standard orientation constant. -->
49     <attr name="orientation">
50         <!-- Defines an horizontal widget. -->
51         <enum name="horizontal" value="0" />
52         <!-- Defines a vertical widget. -->
53         <enum name="vertical" value="1" />
54     </attr>
55
56     <!-- Specifies how to place an object, both
57          its x and y axis, within a larger containing object. -->
58     <attr name="gravity">
59         <!-- Push object to the top of its container, not changing its size. -->
60         <flag name="top" value="0x30" />
61         <!-- Push object to the bottom of its container, not changing its size. -->
62         <flag name="bottom" value="0x50" />
63         <!-- Push object to the left of its container, not changing its size. -->
64         <flag name="left" value="0x03" />
65         <!-- Push object to the right of its container, not changing its size. -->
66         <flag name="right" value="0x05" />
67         <!-- Place object in the vertical center of its container, not changing its size. -->
68         <flag name="center_vertical" value="0x10" />
69         <!-- Grow the vertical size of the object if needed so it completely fills its container. -->
70         <flag name="fill_vertical" value="0x70" />
71         <!-- Place object in the horizontal center of its container, not changing its size. -->
72         <flag name="center_horizontal" value="0x01" />
73         <!-- Grow the horizontal size of the object if needed so it completely fills its container. -->
74         <flag name="fill_horizontal" value="0x07" />
75         <!-- Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. -->
76         <flag name="center" value="0x11" />
77         <!-- Grow the horizontal and vertical size of the object if needed so it completely fills its container. -->
78         <flag name="fill" value="0x77" />
79     </attr>
80
81     <!-- Standard gravity constant that a child can supply to its parent.
82          Defines how to place an object, both
83          its x and y axis, within a larger containing object. -->
84     <attr name="layout_gravity">
85         <!-- Push object to the top of its container, not changing its size. -->
86         <flag name="top" value="0x30" />
87         <!-- Push object to the bottom of its container, not changing its size. -->
88         <flag name="bottom" value="0x50" />
89         <!-- Push object to the left of its container, not changing its size. -->
90         <flag name="left" value="0x03" />
91         <!-- Push object to the right of its container, not changing its size. -->
92         <flag name="right" value="0x05" />
93         <!-- Place object in the vertical center of its container, not changing its size. -->
94         <flag name="center_vertical" value="0x10" />
95         <!-- Grow the vertical size of the object if needed so it completely fills its container. -->
96         <flag name="fill_vertical" value="0x70" />
97         <!-- Place object in the horizontal center of its container, not changing its size. -->
98         <flag name="center_horizontal" value="0x01" />
99         <!-- Grow the horizontal size of the object if needed so it completely fills its container. -->
100         <flag name="fill_horizontal" value="0x07" />
101         <!-- Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. -->
102         <flag name="center" value="0x11" />
103         <!-- Grow the horizontal and vertical size of the object if needed so it completely fills its container. -->
104         <flag name="fill" value="0x77" />
105     </attr>
106
107     <declare-styleable name="View">
108     <!-- NOTE: View does not have a javadoc. Do not place a comment BEFORE View to make sure it
109          is NOT interpreted as Javadoc -->
110     
111         <!-- Supply an identifier name for this view, to later retrieve it
112              with {@link android.view.View#findViewById View.findViewById()} or
113              {@link android.app.Activity#findViewById Activity.findViewById()}.
114              This must be a
115              resource reference; typically you set this using the
116              <code>@+</code> syntax to create a new ID resources.
117              For example: <code>android:id="@+id/my_id"</code> which
118              allows you to later retrieve the view
119              with <code>findViewById(R.id.my_id)</code>. -->
120         <attr name="id" format="reference" />
121         
122         <!-- Supply a tag for this view containing a String, to be retrieved
123              later with {@link android.view.View#getTag View.getTag()} or
124              searched for with {@link android.view.View#findViewWithTag
125              View.findViewWithTag()}.  It is generally preferable to use
126              IDs (through the android:id attribute) instead of tags because
127              they are faster and allow for compile-time type checking. -->
128         <attr name="tag" format="string" />
129         
130         <!-- The initial horizontal scroll offset, in pixels.-->
131         <attr name="scrollX" format="dimension" />
132
133         <!-- The initial vertical scroll offset, in pixels. -->
134         <attr name="scrollY" format="dimension" />
135
136         <!-- A drawable to use as the background.  This can be either a reference
137              to a full drawable resource (such as a PNG image, 9-patch,
138              XML state list description, etc), or a solid color such as "#ff000000"
139             (black). -->
140         <attr name="background" format="reference|color" />
141
142         <!-- Boolean that controls whether a view can take focus.  By default the user can not
143              move focus to a view; by setting this attribute to true the view is
144              allowed to take focus.  This value does not impact the behavior of
145              directly calling {@link android.view.View#requestFocus}, which will
146              always request focus regardless of this view.  It only impacts where
147              focus navigation will try to move focus. -->
148         <attr name="focusable" format="boolean" />
149
150         <!-- Sets the circumstances under which this view will take focus. There are
151              two choices: "weak" or "normal". The default value is "normal" for
152              any focusable views. The focus type only applies if the view
153              has been set to be focusable. -->
154         <attr name="focusType">
155             <!-- This view is focusable, but only if none of its descendants are already focused. -->
156             <enum name="normal" value="0" />
157             <!-- This view will always claim to be focusable. -->
158             <enum name="weak" value="1" />
159         </attr>
160         
161         <!-- Controls the initial visibility of the view.  -->
162         <attr name="visibility">
163             <!-- Visible on screen; the default value. -->
164             <enum name="visible" value="0" />
165             <!-- Not displayed, but taken into account during layout (space is left for it). -->
166             <enum name="invisible" value="1" />
167             <!-- Completely hidden, as if the view had not been added. -->
168             <enum name="gone" value="2" />
169         </attr>
170
171         <!-- Defines which scrollbars should be displayed on scrolling or not. -->
172         <attr name="scrollbars">
173             <!-- No scrollbar is displayed. -->
174             <flag name="none" value="0x00000000" />
175             <!-- Displays horizontal scrollbar only. -->
176             <flag name="horizontal" value="0x00000100" />
177             <!-- Displays vertical scrollbar only. -->
178             <flag name="vertical" value="0x00000200" />
179         </attr>
180
181         <!-- Sets the width of vertical scrollbars and height of horizontal scrollbars. -->
182         <attr name="scrollbarSize" />
183         
184         <!-- Text to display. (copied from TextView for the extra localization) -->
185         <attr name="text" format="string" localization="suggested" />
186         
187     </declare-styleable>
188
189     <!-- Attributes that can be used with a {@link android.view.ViewGroup} or any
190          of its subclasses.  Also see {@link #ViewGroup_Layout} for
191          attributes that this class processes in its children. -->
192     <declare-styleable name="ViewGroup">
193         <!-- Defines whether a child is limited to draw inside of its bounds or not.
194              This is useful with animations that scale the size of the children to more
195              than 100% for instance. In such a case, this property should be set to false
196              to allow the children to draw outside of their bounds. The default value of
197              this property is true. -->
198         <attr name="clipChildren" format="boolean" />
199         <!-- Defines the layout animation to use the first time the ViewGroup is laid out.
200              Layout animations can also be started manually after the first layout. -->
201         <attr name="layoutAnimation" format="reference" />
202         <!-- Defines whether a child's animation should be kept when it is over. Keeping
203              the animations is useful with animation whose final state is different from
204              the initial state of the View. This is particularly useful with animation
205              whose fillAfter property is enabled. This property is set to false by default. -->
206         <attr name="persistentDrawingCache">
207             <!-- The drawing cache is not persisted after use. -->
208             <flag name="none" value="0x0" />
209             <!-- The drawing cache is persisted after a layout animation. -->
210             <flag name="animation" value="0x1" />
211             <!-- The drawing cache is persisted after a scroll. -->
212             <flag name="scrolling" value="0x2" />
213             <!-- The drawing cache is always persisted. -->            
214             <flag name="all" value="0x3" />
215         </attr>
216     </declare-styleable>
217
218     <!-- This is the basic set of layout attributes that are common to all
219          layout managers.  These attributes are specified with the rest of
220          a view's normal attributes (such as {@link android.R.attr#background},
221          but will be parsed by the view's parent and ignored by the child.
222         <p>The values defined here correspond to the base layout attribute
223         class {@link android.view.ViewGroup.LayoutParams}. -->
224     <declare-styleable name="ViewGroup_Layout">
225         <!-- Specifies the basic width of the view.  This is a required attribute
226              for any view inside of a containing layout manager.  Its value may
227              be a dimension (such as "12dip") for a constant width or one of
228              the special constants. -->
229         <attr name="layout_width" format="dimension">
230             <!-- The view should be as big as its parent (minus padding). -->
231             <enum name="match_parent" value="-1" />
232             <!-- The view should be only big enough to enclose its content (plus padding). -->
233             <enum name="wrap_content" value="-2" />
234         </attr>
235
236         <!-- Specifies the basic height of the view.  This is a required attribute
237              for any view inside of a containing layout manager.  Its value may
238              be a dimension (such as "12dip") for a constant height or one of
239              the special constants. -->
240         <attr name="layout_height" format="dimension">
241             <!-- The view should be as big as its parent (minus padding). -->
242             <enum name="match_parent" value="-1" />
243             <!-- The view should be only big enough to enclose its content (plus padding). -->
244             <enum name="wrap_content" value="-2" />
245         </attr>
246     </declare-styleable>
247
248     <!-- This is the basic set of layout attributes for layout managers that
249          wish to place margins around their child views.
250          These attributes are specified with the rest of
251          a view's normal attributes (such as {@link android.R.attr#background},
252          but will be parsed by the view's parent and ignored by the child.
253         <p>The values defined here correspond to the base layout attribute
254         class {@link android.view.ViewGroup.MarginLayoutParams}. -->
255     <declare-styleable name="ViewGroup_MarginLayout">
256         <attr name="layout_width" />
257         <attr name="layout_height" />
258         <!--  Specifies extra space on the left side of this view.
259             This space is outside this view's bounds. -->
260         <attr name="layout_marginLeft" format="dimension"  />
261         <!--  Specifies extra space on the top side of this view.
262             This space is outside this view's bounds. -->
263         <attr name="layout_marginTop" format="dimension" />
264         <!--  Specifies extra space on the right side of this view.
265             This space is outside this view's bounds. -->
266         <attr name="layout_marginRight" format="dimension"  />
267         <!--  Specifies extra space on the bottom side of this view.
268             This space is outside this view's bounds. -->
269         <attr name="layout_marginBottom" format="dimension"  />
270     </declare-styleable>
271
272     <!-- This is a linear layout. -->
273     <declare-styleable name="LinearLayout">
274         <!-- Should the layout be a column or a row?  Use "horizontal"
275              for a row, "vertical" for a column.  The default is
276              horizontal. -->
277         <attr name="orientation" />
278         <attr name="baselineAligned" format="boolean|reference" />
279         <!-- When a linear layout is part of another layout that is baseline
280           aligned, it can specify which of its children to baseline align to
281           (i.e which child TextView).-->
282         <attr name="baselineAlignedChildIndex" format="integer|color" min="0"/>
283         <!-- Defines the maximum weight sum. If unspecified, the sum is computed
284              by adding the layout_weight of all of the children. This can be
285              used for instance to give a single child 50% of the total available
286              space by giving it a layout_weight of 0.5 and setting the weightSum
287              to 1.0. -->
288         <attr name="weightSum" format="float" />
289     </declare-styleable>
290
291     <declare-styleable name="LinearLayout_Layout">
292         <attr name="layout_width" />
293         <attr name="layout_height" />
294         <attr name="layout_weight" format="float" />
295         <attr name="layout_gravity" />
296     </declare-styleable>
297
298     <declare-styleable name="TableLayout">
299         <!-- The 0 based index of the columns to stretch. The column indices
300              must be separated by a comma: 1, 2, 5. Illegal and duplicate
301              indices are ignored. You can stretch all columns by using the
302              value "*" instead. Note that a column can be marked stretchable
303              and shrinkable at the same time. -->
304         <attr name="stretchColumns" format="string" />
305        <!-- The 0 based index of the columns to shrink. The column indices
306              must be separated by a comma: 1, 2, 5. Illegal and duplicate
307              indices are ignored. You can shrink all columns by using the
308              value "*" instead. Note that a column can be marked stretchable
309              and shrinkable at the same time. -->
310         <attr name="shrinkColumns" format="string" /> 
311         <!-- The 0 based index of the columns to collapse. The column indices
312              must be separated by a comma: 1, 2, 5. Illegal and duplicate
313              indices are ignored. -->
314         <attr name="collapseColumns" format="string" />
315     </declare-styleable>
316
317         <!-- Test for deprecated attributes. -->
318         <declare-styleable name="DeprecatedTest">
319                 <!-- Deprecated comments using delimiters.
320                          Ignored. {@deprecated In-line deprecated.} {@ignore Ignored}.
321                  -->
322                 <attr name="deprecated-inline" /> 
323
324                 <!-- Deprecated comments on their own line.
325                          @deprecated Multi-line version of deprecated
326                             that works till the next tag.
327                          @ignore This tag must be ignored
328                  -->
329                 <attr name="deprecated-multiline" />
330                 
331                 <!-- This attribute is not deprecated. -->
332                 <attr name="deprecated-not" />
333                 
334         <!-- {@deprecated There is no other javadoc here. } -->
335         <attr name="deprecated-no-javadoc" format="boolean" />
336                 
337         </declare-styleable>
338
339 </resources>
340