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