attrs.xml revision b79bd8bd1afdf165068ddafdc5fa0667f7ec4a70
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    <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        <!-- Default ActionBar dropdown style. -->
263        <attr name="actionDropDownStyle" format="reference"/>
264        <!-- The preferred item height for dropdown lists. -->
265        <attr name="dropdownListPreferredItemHeight" format="dimension"/>
266        <!-- Default PopupMenu style. -->
267        <attr name="popupMenuStyle" format="reference"/>
268
269        <!-- ============ -->
270        <!-- Panel styles -->
271        <!-- ============ -->
272        <eat-comment />
273
274        <!-- Default Panel Menu width. -->
275        <attr name="panelMenuListWidth" format="dimension" />
276
277        <!-- Default Panel Menu style. -->
278        <attr name="panelMenuListTheme" format="reference" />
279
280        <!-- Drawable used as a background for selected list items. -->
281        <attr name="listChoiceBackgroundIndicator" format="reference" />
282
283    </declare-styleable>
284
285    <declare-styleable name="MenuView">
286        <!-- Default appearance of menu item text. -->
287        <attr name="android:itemTextAppearance"/>
288        <!-- Default horizontal divider between rows of menu items. -->
289        <attr name="android:horizontalDivider"/>
290        <!-- Default vertical divider between menu items. -->
291        <attr name="android:verticalDivider"/>
292        <!-- Default background for the menu header. -->
293        <attr name="android:headerBackground"/>
294        <!-- Default background for each menu item. -->
295        <attr name="android:itemBackground"/>
296        <!-- Default animations for the menu. -->
297        <attr name="android:windowAnimationStyle"/>
298        <!-- Default disabled icon alpha for each menu item that shows an icon. -->
299        <attr name="android:itemIconDisabledAlpha"/>
300        <!-- Whether space should be reserved in layout when an icon is missing. -->
301        <attr name="android:preserveIconSpacing"/>
302    </declare-styleable>
303    <declare-styleable name="ActionMenuView">
304        <!-- Size of padding on either end of a divider. -->
305    </declare-styleable>
306
307    <!-- Base attributes that are available to all groups. -->
308    <declare-styleable name="MenuGroup">
309
310        <!-- The ID of the group. -->
311        <attr name="android:id" />
312
313        <!-- The category applied to all items within this group.
314             (This will be or'ed with the orderInCategory attribute.) -->
315        <attr name="android:menuCategory" />
316
317        <!-- The order within the category applied to all items within this group.
318             (This will be or'ed with the category attribute.) -->
319        <attr name="android:orderInCategory" />
320
321        <!-- Whether the items are capable of displaying a check mark. -->
322        <attr name="android:checkableBehavior" />
323
324        <!-- Whether the items are shown/visible. -->
325        <attr name="android:visible" />
326
327        <!-- Whether the items are enabled. -->
328        <attr name="android:enabled" />
329
330    </declare-styleable>
331
332    <!-- Base attributes that are available to all Item objects. -->
333    <declare-styleable name="MenuItem">
334
335        <!-- The ID of the item. -->
336        <attr name="android:id" />
337
338        <!-- The category applied to the item.
339             (This will be or'ed with the orderInCategory attribute.) -->
340        <attr name="android:menuCategory" />
341
342        <!-- The order within the category applied to the item.
343             (This will be or'ed with the category attribute.) -->
344        <attr name="android:orderInCategory" />
345
346        <!-- The title associated with the item. -->
347        <attr name="android:title" />
348
349        <!-- The condensed title associated with the item.  This is used in situations where the
350             normal title may be too long to be displayed. -->
351        <attr name="android:titleCondensed" />
352
353        <!-- The icon associated with this item.  This icon will not always be shown, so
354             the title should be sufficient in describing this item. -->
355        <attr name="android:icon" />
356
357        <!-- The alphabetic shortcut key.  This is the shortcut when using a keyboard
358             with alphabetic keys. -->
359        <attr name="android:alphabeticShortcut" />
360
361        <!-- The numeric shortcut key.  This is the shortcut when using a numeric (e.g., 12-key)
362             keyboard. -->
363        <attr name="android:numericShortcut" />
364
365        <!-- Whether the item is capable of displaying a check mark. -->
366        <attr name="android:checkable" />
367
368        <!-- Whether the item is checked.  Note that you must first have enabled checking with
369             the checkable attribute or else the check mark will not appear. -->
370        <attr name="android:checked"  />
371
372        <!-- Whether the item is shown/visible. -->
373        <attr name="android:visible" />
374
375        <!-- Whether the item is enabled. -->
376        <attr name="android:enabled" />
377
378        <!-- Name of a method on the Context used to inflate the menu that will be
379             called when the item is clicked. -->
380        <attr name="android:onClick" />
381
382        <!-- How this item should display in the Action Bar, if present. -->
383        <attr name="showAsAction">
384            <!-- Never show this item in an action bar, show it in the overflow menu instead.
385                 Mutually exclusive with "ifRoom" and "always". -->
386            <flag name="never" value="0" />
387            <!-- Show this item in an action bar if there is room for it as determined
388                 by the system. Favor this option over "always" where possible.
389                 Mutually exclusive with "never" and "always". -->
390            <flag name="ifRoom" value="1" />
391            <!-- Always show this item in an actionbar, even if it would override
392                 the system's limits of how much stuff to put there. This may make
393                 your action bar look bad on some screens. In most cases you should
394                 use "ifRoom" instead. Mutually exclusive with "ifRoom" and "never". -->
395            <flag name="always" value="2" />
396            <!-- When this item is shown as an action in the action bar, show a text
397                 label with it even if it has an icon representation. -->
398            <flag name="withText" value="4" />
399            <!-- This item's action view collapses to a normal menu
400                 item. When expanded, the action view takes over a
401                 larger segment of its container. -->
402            <flag name="collapseActionView" value="8" />
403        </attr>
404
405        <!-- An optional layout to be used as an action view.
406             See {@link android.view.MenuItem#setActionView(android.view.View)}
407             for more info. -->
408        <attr name="actionLayout" format="reference" />
409
410        <!-- The name of an optional View class to instantiate and use as an
411             action view. See {@link android.view.MenuItem#setActionView(android.view.View)}
412             for more info. -->
413        <attr name="actionViewClass" format="string" />
414
415        <!-- The name of an optional ActionProvider class to instantiate an action view
416             and perform operations such as default action for that menu item.
417             See {@link android.view.MenuItem#setActionProvider(android.view.ActionProvider)}
418             for more info. -->
419        <attr name="actionProviderClass" format="string" />
420
421    </declare-styleable>
422
423    <declare-styleable name="Spinner">
424        <!-- The prompt to display when the spinner's dialog is shown. -->
425        <attr name="prompt" format="reference" />
426        <!-- Display mode for spinner options. -->
427        <attr name="spinnerMode" format="enum">
428            <!-- Spinner options will be presented to the user as a dialog window. -->
429            <enum name="dialog" value="0" />
430            <!-- Spinner options will be presented to the user as an inline dropdown
431                 anchored to the spinner widget itself. -->
432            <enum name="dropdown" value="1" />
433        </attr>
434        <!-- List selector to use for spinnerMode="dropdown" display. -->
435        <attr name="android:dropDownSelector" />
436        <!-- Background drawable to use for the dropdown in spinnerMode="dropdown". -->
437        <attr name="android:popupBackground" />
438        <!-- Vertical offset from the spinner widget for positioning the dropdown in
439             spinnerMode="dropdown". -->
440        <attr name="android:dropDownVerticalOffset" />
441        <!-- Horizontal offset from the spinner widget for positioning the dropdown
442             in spinnerMode="dropdown". -->
443        <attr name="android:dropDownHorizontalOffset" />
444        <!-- Width of the dropdown in spinnerMode="dropdown". -->
445        <attr name="android:dropDownWidth" />
446        <!-- Reference to a layout to use for displaying a prompt in the dropdown for
447             spinnerMode="dropdown". This layout must contain a TextView with the id
448             {@code @android:id/text1} to be populated with the prompt text. -->
449        <attr name="popupPromptView" format="reference" />
450        <!-- Gravity setting for positioning the currently selected item. -->
451        <attr name="android:gravity" />
452        <!-- Whether this spinner should mark child views as enabled/disabled when
453             the spinner itself is enabled/disabled. -->
454        <attr name="disableChildrenWhenDisabled" format="boolean" />
455    </declare-styleable>
456
457    <declare-styleable name="LinearLayoutICS">
458        <!-- Drawable to use as a vertical divider between buttons. -->
459        <attr name="divider" />
460        <!-- Setting for which dividers to show. -->
461        <attr name="showDividers">
462            <flag name="none" value="0" />
463            <flag name="beginning" value="1" />
464            <flag name="middle" value="2" />
465            <flag name="end" value="4" />
466        </attr>
467        <!-- Size of padding on either end of a divider. -->
468        <attr name="dividerPadding" format="dimension" />
469    </declare-styleable>
470
471    <!-- Default Spinner style. -->
472    <attr name="spinnerStyle" format="reference" />
473
474    <!-- Default Spinner style. -->
475    <attr name="spinnerDropDownItemStyle" format="reference" />
476
477
478</resources>
479