attrs.xml revision 3954d59cb6073615ead9dd34cbdba9e16b8c5b6f
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2012 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16
17<resources>
18    <!-- Many app-specific attributes are declared in this file.
19         Unless otherwise specified, they are intended to be set within
20         the context of a theme declaration.
21
22         Each cluster of attributes below states whether it is meant to
23         be set by the app and read by the system, or set by the system and
24         read by the app. -->
25    <eat-comment/>
26
27    <!-- These attributes are meant to be specified and customized by the app.
28         The system will read and apply them as needed. These attributes control
29         properties of the activity window, such as whether an action bar should
30         be present and whether it should overlay content. -->
31    <declare-styleable name="ActionBarWindow">
32        <attr name="windowActionBar" format="boolean"/>
33        <attr name="windowActionBarOverlay" format="boolean"/>
34        <attr name="windowSplitActionBar" format="boolean" />
35    </declare-styleable>
36
37    <!-- ============================================ -->
38
39    <!-- Action bar appearance and styling attributes.
40         These attributes are meant to be specified and customized by the
41         app. The system will read and apply them as needed. -->
42    <eat-comment/>
43
44    <!-- Default style for tabs within an action bar -->
45    <attr name="actionBarTabStyle" format="reference"/>
46    <attr name="actionBarTabBarStyle" format="reference"/>
47    <attr name="actionBarTabTextStyle" format="reference"/>
48    <attr name="actionOverflowButtonStyle" format="reference"/>
49    <!-- Reference to a style for the Action Bar -->
50    <attr name="actionBarStyle" format="reference"/>
51    <!-- Reference to a theme that should be used to inflate widgets
52         and layouts destined for the action bar. Most of the time
53         this will be a reference to the current theme, but when
54         the action bar has a significantly different contrast
55         profile than the rest of the activity the difference
56         can become important. If this is set to @null the current
57         theme will be used.-->
58    <attr name="actionBarSplitStyle" format="reference"/>
59    <!-- Reference to a theme that should be used to inflate widgets
60         and layouts destined for the action bar. Most of the time
61         this will be a reference to the current theme, but when
62         the action bar has a significantly different contrast
63         profile than the rest of the activity the difference
64         can become important. If this is set to @null the current
65         theme will be used.-->
66    <attr name="actionBarWidgetTheme" format="reference"/>
67    <!-- Size of the Action Bar, including the contextual
68         bar used to present Action Modes. -->
69    <attr name="actionBarSize" format="dimension"/>
70    <!-- Custom divider drawable to use for elements in the action bar. -->
71    <attr name="actionBarDivider" format="reference"/>
72    <!-- Custom item state list drawable background for action bar items. -->
73    <attr name="actionBarItemBackground" format="reference"/>
74    <!-- TextAppearance style that will be applied to text that
75         appears within action menu items. -->
76    <attr name="actionMenuTextAppearance" format="reference"/>
77    <!-- Color for text that appears within action menu items. -->
78    <attr name="actionMenuTextColor" format="color|reference"/>
79    <!-- Specifies a drawable to use for the 'home as up' indicator. -->
80    <attr name="homeAsUpIndicator" format="reference"/>
81    <!-- Text color, typeface, size, and style for the text inside of a popup menu. -->
82    <attr name="textAppearanceLargePopupMenu" format="reference"/>
83    <!-- Text color, typeface, size, and style for small text inside of a popup menu. -->
84    <attr name="textAppearanceSmallPopupMenu" format="reference"/>
85    <!-- Default action button style. -->
86    <attr name="actionButtonStyle" format="reference"/>
87
88    <!-- ============================================ -->
89
90    <!-- Assorted theme compatibility attributes.
91         These attributes are meant to be set by the system and read by apps
92         for use in layouts or other style declarations. -->
93    <eat-comment/>
94    <!-- A style that may be applied to horizontal LinearLayouts
95         to form a button bar. -->
96    <attr name="buttonBarStyle" format="reference"/>
97    <!-- A style that may be applied to Buttons placed within a
98         LinearLayout with the style buttonBarStyle to form a button bar. -->
99    <attr name="buttonBarButtonStyle" format="reference"/>
100    <!-- A style that may be applied to buttons or other selectable items
101         that should react to pressed and focus states, but that do not
102         have a clear visual border along the edges. -->
103    <attr name="selectableItemBackground" format="reference"/>
104    <!-- A drawable that may be used as a vertical divider between visual elements. -->
105    <attr name="dividerVertical" format="reference"/>
106    <!-- A drawable that may be used as a horizontal divider between visual elements. -->
107    <attr name="dividerHorizontal" format="reference"/>
108
109    <!-- The preferred list item height. -->
110    <attr name="listPreferredItemHeight" format="dimension"/>
111    <!-- A smaller, sleeker list item height. -->
112    <attr name="listPreferredItemHeightSmall" format="dimension"/>
113    <!-- A larger, more robust list item height. -->
114    <attr name="listPreferredItemHeightLarge" format="dimension"/>
115
116    <!-- The preferred padding along the left edge of list items. -->
117    <attr name="listPreferredItemPaddingLeft" format="dimension"/>
118    <!-- The preferred padding along the right edge of list items. -->
119    <attr name="listPreferredItemPaddingRight" format="dimension"/>
120
121    <!-- ListPopupWindow comaptibility -->
122    <attr name="dropDownListViewStyle" format="reference"/>
123    <attr name="listPopupWindowStyle" format="reference"/>
124
125
126    <!-- The preferred TextAppearance for the primary text of list items. -->
127    <attr name="textAppearanceListItem" format="reference"/>
128    <!-- The preferred TextAppearance for the primary text of small list items. -->
129    <attr name="textAppearanceListItemSmall" format="reference"/>
130
131    <attr name="title" format="string"/>
132    <attr name="height" format="dimension"/>
133
134
135    <!-- ============================================ -->
136
137    <!-- Attributes used to style the Action Bar.
138         These should be set on your theme; the default actionBarStyle will
139         propagate them to the correct elements as needed.
140
141         Please Note: when overriding attributes for an ActionBar style
142         you must specify each attribute twice: once with the "android:"
143         namespace prefix and once without. -->
144    <declare-styleable name="ActionBar">
145        <!-- The type of navigation to use. -->
146        <attr name="navigationMode">
147            <!-- Normal static title text -->
148            <enum name="normal" value="0"/>
149            <!-- The action bar will use a selection list for navigation. -->
150            <enum name="listMode" value="1"/>
151            <!-- The action bar will use a series of horizontal tabs for navigation. -->
152            <enum name="tabMode" value="2"/>
153        </attr>
154        <!-- Options affecting how the action bar is displayed. -->
155        <attr name="displayOptions">
156            <flag name="useLogo" value="0x1"/>
157            <flag name="showHome" value="0x2"/>
158            <flag name="homeAsUp" value="0x4"/>
159            <flag name="showTitle" value="0x8"/>
160            <flag name="showCustom" value="0x10"/>
161            <flag name="disableHome" value="0x20"/>
162        </attr>
163        <!-- Specifies title text used for navigationMode="normal" -->
164        <attr name="title"/>
165        <!-- Specifies subtitle text used for navigationMode="normal" -->
166        <attr name="subtitle" format="string"/>
167        <!-- Specifies a style to use for title text. -->
168        <attr name="titleTextStyle" format="reference"/>
169        <!-- Specifies a style to use for subtitle text. -->
170        <attr name="subtitleTextStyle" format="reference"/>
171        <!-- Specifies the drawable used for the application icon. -->
172        <attr name="icon" format="reference"/>
173        <!-- Specifies the drawable used for the application logo. -->
174        <attr name="logo" format="reference"/>
175        <!-- Specifies the drawable used for item dividers. -->
176        <attr name="divider" format="reference"/>
177        <!-- Specifies a background drawable for the action bar. -->
178        <attr name="background" format="reference"/>
179        <!-- Specifies a background drawable for a second stacked row of the action bar. -->
180        <attr name="backgroundStacked" format="reference|color"/>
181        <!-- Specifies a background drawable for the bottom component of a split action bar. -->
182        <attr name="backgroundSplit" format="reference|color"/>
183        <!-- Specifies a layout for custom navigation. Overrides navigationMode. -->
184        <attr name="customNavigationLayout" format="reference"/>
185        <!-- Specifies a fixed height. -->
186        <attr name="height"/>
187        <!-- Specifies a layout to use for the "home" section of the action bar. -->
188        <attr name="homeLayout" format="reference"/>
189        <!-- Specifies a style resource to use for an embedded progress bar. -->
190        <attr name="progressBarStyle" format="reference"/>
191        <!-- Specifies a style resource to use for an indeterminate progress spinner. -->
192        <attr name="indeterminateProgressStyle" format="reference"/>
193        <!-- Specifies the horizontal padding on either end for an embedded progress bar. -->
194        <attr name="progressBarPadding" format="dimension"/>
195        <!-- Specifies padding that should be applied to the left and right sides of
196             system-provided items in the bar. -->
197        <attr name="itemPadding" format="dimension"/>
198    </declare-styleable>
199
200    <!-- Valid LayoutParams for views placed in the action bar as custom views. -->
201    <declare-styleable name="ActionBarLayout">
202        <attr name="android:layout_gravity"/>
203    </declare-styleable>
204
205    <!-- TODO(trevorjohns): Write docs for this. -->
206    <declare-styleable name="ActionMenuItemView">
207        <attr name="android:minWidth"/>
208    </declare-styleable>
209
210    <declare-styleable name="ActionMode">
211        <!-- Specifies a style to use for title text. -->
212        <attr name="titleTextStyle"/>
213        <!-- Specifies a style to use for subtitle text. -->
214        <attr name="subtitleTextStyle"/>
215        <!-- Specifies a background for the action mode bar. -->
216        <attr name="background"/>
217        <!-- Specifies a background for the split action mode bar. -->
218        <attr name="backgroundSplit"/>
219        <!-- Specifies a fixed height for the action mode bar. -->
220        <attr name="height"/>
221    </declare-styleable>
222
223    <declare-styleable name="View">
224        <!-- Sets the padding, in pixels, of the start edge; see {@link android.R.attr#padding}. -->
225        <attr name="paddingStart" format="dimension"/>
226        <!-- Sets the padding, in pixels, of the end edge; see {@link android.R.attr#padding}. -->
227        <attr name="paddingEnd" format="dimension"/>
228    </declare-styleable>
229
230    <!-- =================== -->
231    <!-- Action mode styles  -->
232    <!-- =================== -->
233    <eat-comment/>
234    <attr name="actionModeStyle" format="reference"/>
235    <attr name="actionModeCloseButtonStyle" format="reference"/>
236    <!-- Background drawable to use for action mode UI -->
237    <attr name="actionModeBackground" format="reference"/>
238    <!-- Background drawable to use for action mode UI in the lower split bar -->
239    <attr name="actionModeSplitBackground" format="reference"/>
240    <!-- Drawable to use for the close action mode button -->
241    <attr name="actionModeCloseDrawable" format="reference"/>
242
243    <!-- Drawable to use for the Cut action button in Contextual Action Bar -->
244    <attr name="actionModeCutDrawable" format="reference"/>
245    <!-- Drawable to use for the Copy action button in Contextual Action Bar -->
246    <attr name="actionModeCopyDrawable" format="reference"/>
247    <!-- Drawable to use for the Paste action button in Contextual Action Bar -->
248    <attr name="actionModePasteDrawable" format="reference"/>
249    <!-- Drawable to use for the Select all action button in Contextual Action Bar -->
250    <attr name="actionModeSelectAllDrawable" format="reference"/>
251    <!-- Drawable to use for the Share action button in WebView selection action modes -->
252    <attr name="actionModeShareDrawable" format="reference"/>
253    <!-- Drawable to use for the Find action button in WebView selection action modes -->
254    <attr name="actionModeFindDrawable" format="reference"/>
255    <!-- Drawable to use for the Web Search action button in WebView selection action modes -->
256    <attr name="actionModeWebSearchDrawable" format="reference"/>
257
258    <!-- PopupWindow style to use for action modes when showing as a window overlay. -->
259    <attr name="actionModePopupWindowStyle" format="reference"/>
260
261    <!-- These are the standard attributes that make up a complete theme. -->
262    <declare-styleable name="Theme">
263        <!-- TODO(trevorjohns): Add other attributes! -->
264        <!-- Default ActionBar dropdown style. -->
265        <attr name="actionDropDownStyle" format="reference"/>
266        <!-- The preferred item height for dropdown lists. -->
267        <attr name="dropdownListPreferredItemHeight" format="dimension"/>
268        <!-- Default PopupMenu style. -->
269        <attr name="popupMenuStyle" format="reference"/>
270
271        <!-- ============ -->
272        <!-- Panel styles -->
273        <!-- ============ -->
274        <eat-comment />
275
276        <attr name="panelMenuListWidth" format="dimension" />
277
278        <!-- Default Panel Menu style. -->
279        <attr name="panelMenuListTheme" format="reference" />
280
281    </declare-styleable>
282
283    <declare-styleable name="MenuView">
284        <!-- Default appearance of menu item text. -->
285        <attr name="android:itemTextAppearance"/>
286        <!-- Default horizontal divider between rows of menu items. -->
287        <attr name="android:horizontalDivider"/>
288        <!-- Default vertical divider between menu items. -->
289        <attr name="android:verticalDivider"/>
290        <!-- Default background for the menu header. -->
291        <attr name="android:headerBackground"/>
292        <!-- Default background for each menu item. -->
293        <attr name="android:itemBackground"/>
294        <!-- Default animations for the menu. -->
295        <attr name="android:windowAnimationStyle"/>
296        <!-- Default disabled icon alpha for each menu item that shows an icon. -->
297        <attr name="android:itemIconDisabledAlpha"/>
298        <!-- Whether space should be reserved in layout when an icon is missing. -->
299        <attr name="android:preserveIconSpacing"/>
300    </declare-styleable>
301    <declare-styleable name="ActionMenuView">
302        <!-- Size of padding on either end of a divider. -->
303    </declare-styleable>
304
305    <!-- Base attributes that are available to all groups. -->
306    <declare-styleable name="MenuGroup">
307
308        <!-- The ID of the group. -->
309        <attr name="android:id" />
310
311        <!-- The category applied to all items within this group.
312             (This will be or'ed with the orderInCategory attribute.) -->
313        <attr name="android:menuCategory" />
314
315        <!-- The order within the category applied to all items within this group.
316             (This will be or'ed with the category attribute.) -->
317        <attr name="android:orderInCategory" />
318
319        <!-- Whether the items are capable of displaying a check mark. -->
320        <attr name="android:checkableBehavior" />
321
322        <!-- Whether the items are shown/visible. -->
323        <attr name="android:visible" />
324
325        <!-- Whether the items are enabled. -->
326        <attr name="android:enabled" />
327
328    </declare-styleable>
329
330    <!-- Base attributes that are available to all Item objects. -->
331    <declare-styleable name="MenuItem">
332
333        <!-- The ID of the item. -->
334        <attr name="android:id" />
335
336        <!-- The category applied to the item.
337             (This will be or'ed with the orderInCategory attribute.) -->
338        <attr name="android:menuCategory" />
339
340        <!-- The order within the category applied to the item.
341             (This will be or'ed with the category attribute.) -->
342        <attr name="android:orderInCategory" />
343
344        <!-- The title associated with the item. -->
345        <attr name="android:title" />
346
347        <!-- The condensed title associated with the item.  This is used in situations where the
348             normal title may be too long to be displayed. -->
349        <attr name="android:titleCondensed" />
350
351        <!-- The icon associated with this item.  This icon will not always be shown, so
352             the title should be sufficient in describing this item. -->
353        <attr name="android:icon" />
354
355        <!-- The alphabetic shortcut key.  This is the shortcut when using a keyboard
356             with alphabetic keys. -->
357        <attr name="android:alphabeticShortcut" />
358
359        <!-- The numeric shortcut key.  This is the shortcut when using a numeric (e.g., 12-key)
360             keyboard. -->
361        <attr name="android:numericShortcut" />
362
363        <!-- Whether the item is capable of displaying a check mark. -->
364        <attr name="android:checkable" />
365
366        <!-- Whether the item is checked.  Note that you must first have enabled checking with
367             the checkable attribute or else the check mark will not appear. -->
368        <attr name="android:checked"  />
369
370        <!-- Whether the item is shown/visible. -->
371        <attr name="android:visible" />
372
373        <!-- Whether the item is enabled. -->
374        <attr name="android:enabled" />
375
376        <!-- Name of a method on the Context used to inflate the menu that will be
377             called when the item is clicked. -->
378        <attr name="android:onClick" />
379
380        <!-- How this item should display in the Action Bar, if present. -->
381        <attr name="showAsAction">
382            <!-- Never show this item in an action bar, show it in the overflow menu instead.
383                 Mutually exclusive with "ifRoom" and "always". -->
384            <flag name="never" value="0" />
385            <!-- Show this item in an action bar if there is room for it as determined
386                 by the system. Favor this option over "always" where possible.
387                 Mutually exclusive with "never" and "always". -->
388            <flag name="ifRoom" value="1" />
389            <!-- Always show this item in an actionbar, even if it would override
390                 the system's limits of how much stuff to put there. This may make
391                 your action bar look bad on some screens. In most cases you should
392                 use "ifRoom" instead. Mutually exclusive with "ifRoom" and "never". -->
393            <flag name="always" value="2" />
394            <!-- When this item is shown as an action in the action bar, show a text
395                 label with it even if it has an icon representation. -->
396            <flag name="withText" value="4" />
397            <!-- This item's action view collapses to a normal menu
398                 item. When expanded, the action view takes over a
399                 larger segment of its container. -->
400            <flag name="collapseActionView" value="8" />
401        </attr>
402
403        <!-- An optional layout to be used as an action view.
404             See {@link android.view.MenuItem#setActionView(android.view.View)}
405             for more info. -->
406        <attr name="actionLayout" format="reference" />
407
408        <!-- The name of an optional View class to instantiate and use as an
409             action view. See {@link android.view.MenuItem#setActionView(android.view.View)}
410             for more info. -->
411        <attr name="actionViewClass" format="string" />
412
413        <!-- The name of an optional ActionProvider class to instantiate an action view
414             and perform operations such as default action for that menu item.
415             See {@link android.view.MenuItem#setActionProvider(android.view.ActionProvider)}
416             for more info. -->
417        <attr name="actionProviderClass" format="string" />
418
419    </declare-styleable>
420
421    <declare-styleable name="Spinner">
422        <!-- The prompt to display when the spinner's dialog is shown. -->
423        <attr name="prompt" format="reference" />
424        <!-- Display mode for spinner options. -->
425        <attr name="spinnerMode" format="enum">
426            <!-- Spinner options will be presented to the user as a dialog window. -->
427            <enum name="dialog" value="0" />
428            <!-- Spinner options will be presented to the user as an inline dropdown
429                 anchored to the spinner widget itself. -->
430            <enum name="dropdown" value="1" />
431        </attr>
432        <!-- List selector to use for spinnerMode="dropdown" display. -->
433        <attr name="android:dropDownSelector" />
434        <!-- Background drawable to use for the dropdown in spinnerMode="dropdown". -->
435        <attr name="android:popupBackground" />
436        <!-- Vertical offset from the spinner widget for positioning the dropdown in
437             spinnerMode="dropdown". -->
438        <attr name="android:dropDownVerticalOffset" />
439        <!-- Horizontal offset from the spinner widget for positioning the dropdown
440             in spinnerMode="dropdown". -->
441        <attr name="android:dropDownHorizontalOffset" />
442        <!-- Width of the dropdown in spinnerMode="dropdown". -->
443        <attr name="android:dropDownWidth" />
444        <!-- Reference to a layout to use for displaying a prompt in the dropdown for
445             spinnerMode="dropdown". This layout must contain a TextView with the id
446             @android:id/text1 to be populated with the prompt text. -->
447        <attr name="popupPromptView" format="reference" />
448        <!-- Gravity setting for positioning the currently selected item. -->
449        <attr name="android:gravity" />
450        <!-- Whether this spinner should mark child views as enabled/disabled when
451             the spinner itself is enabled/disabled. -->
452        <attr name="disableChildrenWhenDisabled" format="boolean" />
453    </declare-styleable>
454
455
456    <attr name="dividerPadding" format="dimension"/>
457
458    <!-- Default Spinner style. -->
459    <attr name="spinnerStyle" format="reference" />
460
461    <!-- Default Spinner style. -->
462    <attr name="spinnerDropDownItemStyle" format="reference" />
463
464
465</resources>
466