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 | |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 17 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
Romain Guy | 0cbe49a | 2010-01-08 15:05:22 -0800 | [diff] [blame^] | 18 | android:layout_width="match_parent" |
| 19 | android:layout_height="match_parent"> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 20 | |
| 21 | <RelativeLayout |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 22 | android:id="@+id/relative_sublayout_attrs" |
| 23 | android:background="@drawable/blue" |
Romain Guy | 0cbe49a | 2010-01-08 15:05:22 -0800 | [diff] [blame^] | 24 | android:layout_width="match_parent" |
| 25 | android:layout_height="match_parent"> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 26 | |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 27 | <!-- view1, centered within its parent. --> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 28 | <TextView |
| 29 | android:id="@+id/relative_view1" |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 30 | android:layout_width="wrap_content" |
| 31 | android:layout_height="wrap_content" |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 32 | android:layout_centerInParent="true" |
| 33 | android:text="@string/relative_view1"/> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 34 | |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 35 | <!-- view2, below view1 and has same left position with view1. --> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 36 | <TextView |
| 37 | android:id="@+id/relative_view2" |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 38 | android:layout_width="wrap_content" |
| 39 | android:layout_height="wrap_content" |
| 40 | android:layout_below="@id/relative_view1" |
| 41 | android:layout_alignLeft="@id/relative_view1" |
| 42 | android:text="@string/relative_view2"/> |
| 43 | |
| 44 | <!-- view3, has same top position with view1 and same bottom position with view2, |
| 45 | and on the right of view1. --> |
| 46 | <TextView |
| 47 | android:id="@+id/relative_view3" |
| 48 | android:layout_width="wrap_content" |
| 49 | android:layout_height="wrap_content" |
| 50 | android:layout_alignTop="@id/relative_view1" |
| 51 | android:layout_alignBottom="@id/relative_view2" |
| 52 | android:layout_toRightOf="@id/relative_view1" |
| 53 | android:text="@string/relative_view3"/> |
| 54 | |
| 55 | <!-- view4, has same right position with view3 and above view3. --> |
| 56 | <TextView |
| 57 | android:id="@+id/relative_view4" |
| 58 | android:layout_width="wrap_content" |
| 59 | android:layout_height="wrap_content" |
| 60 | android:layout_alignRight="@id/relative_view3" |
| 61 | android:layout_above="@id/relative_view3" |
| 62 | android:text="@string/relative_view4"/> |
| 63 | |
| 64 | <!-- view5 goes on the left-bottom --> |
| 65 | <TextView |
| 66 | android:id="@+id/relative_view5" |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 67 | android:layout_width="wrap_content" |
| 68 | android:layout_height="wrap_content" |
| 69 | android:layout_alignParentBottom="true" |
| 70 | android:layout_alignParentLeft="true" |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 71 | android:text="@string/relative_view5"/> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 72 | |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 73 | <!-- view6 goes on the top-right --> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 74 | <TextView |
| 75 | android:id="@+id/relative_view6" |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 76 | android:layout_width="wrap_content" |
| 77 | android:layout_height="wrap_content" |
| 78 | android:layout_alignParentTop="true" |
| 79 | android:layout_alignParentRight="true" |
| 80 | android:text="@string/relative_view6"/> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 81 | |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 82 | <!-- view7, has same baseline with view6 and centered horizontally within its parent. --> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 83 | <TextView |
| 84 | android:id="@+id/relative_view7" |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 85 | android:layout_width="wrap_content" |
| 86 | android:layout_height="wrap_content" |
| 87 | android:layout_alignBaseline="@id/relative_view6" |
| 88 | android:layout_centerHorizontal="true" |
| 89 | android:text="@string/relative_view7"/> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 90 | |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 91 | <!-- view8, centered vertically within its parent and on the left of view1. --> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 92 | <TextView |
| 93 | android:id="@+id/relative_view8" |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 94 | android:layout_width="wrap_content" |
| 95 | android:layout_height="wrap_content" |
| 96 | android:layout_toLeftOf="@id/relative_view1" |
| 97 | android:layout_centerVertical="true" |
| 98 | android:text="@string/relative_view8"/> |
| 99 | |
| 100 | <!-- view9, has same top and bottom position with view3 and same left position |
| 101 | with its parent. --> |
| 102 | <TextView |
| 103 | android:id="@+id/relative_view9" |
| 104 | android:layout_width="wrap_content" |
| 105 | android:layout_height="wrap_content" |
| 106 | android:layout_alignLeft="@id/gravity_bottom" |
| 107 | android:layout_alignTop="@id/relative_view3" |
| 108 | android:layout_alignBottom="@id/relative_view3" |
| 109 | android:layout_alignWithParentIfMissing="true" |
| 110 | android:text="@string/relative_view9"/> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 111 | |
| 112 | </RelativeLayout> |
| 113 | |
| 114 | <RelativeLayout |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 115 | android:id="@+id/relative_sublayout_gravity" |
| 116 | android:background="@drawable/yellow" |
Romain Guy | 0cbe49a | 2010-01-08 15:05:22 -0800 | [diff] [blame^] | 117 | android:layout_width="match_parent" |
| 118 | android:layout_height="match_parent"> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 119 | |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 120 | <!-- view10 --> |
| 121 | <TextView |
| 122 | android:id="@+id/relative_view10" |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 123 | android:layout_width="wrap_content" |
| 124 | android:layout_height="wrap_content" |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 125 | android:text="@string/relative_view10"/> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 126 | |
| 127 | <!-- view11 --> |
| 128 | <TextView |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 129 | android:id="@+id/relative_view11" |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 130 | android:layout_width="wrap_content" |
| 131 | android:layout_height="wrap_content" |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 132 | android:layout_below="@id/relative_view10" |
| 133 | android:text="@string/relative_view11"/> |
| 134 | </RelativeLayout> |
| 135 | |
| 136 | <RelativeLayout |
| 137 | android:id="@+id/relative_sublayout_ignore_gravity" |
| 138 | android:background="@drawable/red" |
Romain Guy | 0cbe49a | 2010-01-08 15:05:22 -0800 | [diff] [blame^] | 139 | android:layout_width="match_parent" |
| 140 | android:layout_height="match_parent" |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 141 | android:ignoreGravity="@+id/relative_view12" |
| 142 | android:gravity="right"> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 143 | |
| 144 | <!-- view12 --> |
| 145 | <TextView |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 146 | android:id="@id/relative_view12" |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 147 | android:layout_width="wrap_content" |
| 148 | android:layout_height="wrap_content" |
Phil Dubach | 699c509 | 2009-06-09 16:32:25 -0700 | [diff] [blame] | 149 | android:text="@string/relative_view12"/> |
| 150 | |
| 151 | <!-- view13 --> |
| 152 | <TextView |
| 153 | android:id="@+id/relative_view13" |
| 154 | android:layout_width="wrap_content" |
| 155 | android:layout_height="wrap_content" |
| 156 | android:text="@string/relative_view13"/> |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 157 | </RelativeLayout> |
| 158 | |
| 159 | <Spinner |
| 160 | android:id="@+id/spinner1" |
Romain Guy | 0cbe49a | 2010-01-08 15:05:22 -0800 | [diff] [blame^] | 161 | android:layout_width="match_parent" |
| 162 | android:layout_height="match_parent" |
The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 163 | android:prompt="@string/text_view_hello"/> |
| 164 | |
| 165 | </RelativeLayout> |