The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!-- Copyright (C) 2008 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 | <menu xmlns:android="http://schemas.android.com/apk/res/android"> |
| 18 | |
| 19 | <!-- Checkable items appear only in submenus or context menus. --> |
| 20 | |
| 21 | <!-- Carefully look at the attribute name checkableBehavior on groups, but |
| 22 | the attribute name checkable on items. The checkableBehavior encompasses |
| 23 | the number of items that will be checkable within that group. --> |
| 24 | |
| 25 | <item android:title="None"> |
| 26 | <menu> |
| 27 | <!-- The none checkableBehavior is default, but we explicitly show it here. --> |
| 28 | <group android:id="@+id/noncheckable_group" |
| 29 | android:checkableBehavior="none"> |
| 30 | <!-- Notice how these items inherit from the group. --> |
| 31 | <item android:id="@+id/noncheckable_item_1" |
| 32 | android:title="Item 1" /> |
| 33 | <item android:id="@+id/noncheckable_item_2" |
| 34 | android:title="Item 2" /> |
| 35 | <item android:id="@+id/noncheckable_item_3" |
| 36 | android:title="Item 3" /> |
| 37 | </group> |
| 38 | </menu> |
| 39 | </item> |
| 40 | |
| 41 | <item android:title="All"> |
| 42 | <menu> |
| 43 | <group android:id="@+id/checkable_group" |
| 44 | android:checkableBehavior="all"> |
| 45 | <!-- Notice how these items inherit from the group. --> |
| 46 | <item android:id="@+id/checkable_item_1" |
| 47 | android:title="Item 1" /> |
| 48 | <item android:id="@+id/checkable_item_2" |
| 49 | android:title="Item 2" |
| 50 | android:checked="true" /> |
| 51 | <item android:id="@+id/checkable_item_3" |
| 52 | android:title="Item 3" |
| 53 | android:checked="true" /> |
| 54 | </group> |
| 55 | </menu> |
| 56 | </item> |
| 57 | |
| 58 | <item android:title="Single"> |
| 59 | <menu> |
| 60 | <group android:id="@+id/exclusive_checkable_group" |
| 61 | android:checkableBehavior="single"> |
| 62 | <!-- Notice how these items inherit from the group. --> |
| 63 | <item android:id="@+id/exclusive_checkable_item_1" |
| 64 | android:title="Item 1" /> |
| 65 | <item android:id="@+id/exclusive_checkable_item_2" |
| 66 | android:title="Item 2" /> |
| 67 | <item android:id="@+id/exclusive_checkable_item_3" |
| 68 | android:title="Item 3" |
| 69 | android:checked="true" /> |
| 70 | </group> |
| 71 | </menu> |
| 72 | </item> |
| 73 | |
| 74 | <item android:title="All without group" |
| 75 | android:id="@+id/submenu"> |
| 76 | <menu> |
| 77 | <!-- Notice how these items have each set. --> |
| 78 | <item android:id="@+id/nongroup_checkable_item_1" |
| 79 | android:title="Item 1" |
| 80 | android:checkable="true" /> |
| 81 | <item android:id="@+id/nongroup_checkable_item_2" |
| 82 | android:title="Item 2" |
| 83 | android:checkable="true" |
| 84 | android:checked="true" /> |
| 85 | <item android:id="@+id/nongroup_checkable_item_3" |
| 86 | android:title="Item 3" |
| 87 | android:checkable="true" |
| 88 | android:checked="true" /> |
| 89 | </menu> |
| 90 | </item> |
| 91 | |
| 92 | </menu> |