blob: db4b2e8b28619ce49ff2840f82a9b3e651acec74 [file] [log] [blame]
The Android Open Source Projectf8057102009-03-15 16:47:16 -07001<?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 Projectf8057102009-03-15 16:47:16 -070017<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
Romain Guy0cbe49a2010-01-08 15:05:22 -080018 android:layout_width="match_parent"
19 android:layout_height="match_parent">
The Android Open Source Projectf8057102009-03-15 16:47:16 -070020
21 <RelativeLayout
Phil Dubach699c5092009-06-09 16:32:25 -070022 android:id="@+id/relative_sublayout_attrs"
23 android:background="@drawable/blue"
Romain Guy0cbe49a2010-01-08 15:05:22 -080024 android:layout_width="match_parent"
25 android:layout_height="match_parent">
The Android Open Source Projectf8057102009-03-15 16:47:16 -070026
Phil Dubach699c5092009-06-09 16:32:25 -070027 <!-- view1, centered within its parent. -->
The Android Open Source Projectf8057102009-03-15 16:47:16 -070028 <TextView
29 android:id="@+id/relative_view1"
The Android Open Source Projectf8057102009-03-15 16:47:16 -070030 android:layout_width="wrap_content"
31 android:layout_height="wrap_content"
Phil Dubach699c5092009-06-09 16:32:25 -070032 android:layout_centerInParent="true"
33 android:text="@string/relative_view1"/>
The Android Open Source Projectf8057102009-03-15 16:47:16 -070034
Phil Dubach699c5092009-06-09 16:32:25 -070035 <!-- view2, below view1 and has same left position with view1. -->
The Android Open Source Projectf8057102009-03-15 16:47:16 -070036 <TextView
37 android:id="@+id/relative_view2"
Phil Dubach699c5092009-06-09 16:32:25 -070038 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 Projectf8057102009-03-15 16:47:16 -070067 android:layout_width="wrap_content"
68 android:layout_height="wrap_content"
69 android:layout_alignParentBottom="true"
70 android:layout_alignParentLeft="true"
Phil Dubach699c5092009-06-09 16:32:25 -070071 android:text="@string/relative_view5"/>
The Android Open Source Projectf8057102009-03-15 16:47:16 -070072
Phil Dubach699c5092009-06-09 16:32:25 -070073 <!-- view6 goes on the top-right -->
The Android Open Source Projectf8057102009-03-15 16:47:16 -070074 <TextView
75 android:id="@+id/relative_view6"
Phil Dubach699c5092009-06-09 16:32:25 -070076 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 Projectf8057102009-03-15 16:47:16 -070081
Phil Dubach699c5092009-06-09 16:32:25 -070082 <!-- view7, has same baseline with view6 and centered horizontally within its parent. -->
The Android Open Source Projectf8057102009-03-15 16:47:16 -070083 <TextView
84 android:id="@+id/relative_view7"
Phil Dubach699c5092009-06-09 16:32:25 -070085 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 Projectf8057102009-03-15 16:47:16 -070090
Phil Dubach699c5092009-06-09 16:32:25 -070091 <!-- view8, centered vertically within its parent and on the left of view1. -->
The Android Open Source Projectf8057102009-03-15 16:47:16 -070092 <TextView
93 android:id="@+id/relative_view8"
Phil Dubach699c5092009-06-09 16:32:25 -070094 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 Projectf8057102009-03-15 16:47:16 -0700111
112 </RelativeLayout>
113
114 <RelativeLayout
Phil Dubach699c5092009-06-09 16:32:25 -0700115 android:id="@+id/relative_sublayout_gravity"
116 android:background="@drawable/yellow"
Romain Guy0cbe49a2010-01-08 15:05:22 -0800117 android:layout_width="match_parent"
118 android:layout_height="match_parent">
The Android Open Source Projectf8057102009-03-15 16:47:16 -0700119
The Android Open Source Projectf8057102009-03-15 16:47:16 -0700120 <!-- view10 -->
121 <TextView
122 android:id="@+id/relative_view10"
The Android Open Source Projectf8057102009-03-15 16:47:16 -0700123 android:layout_width="wrap_content"
124 android:layout_height="wrap_content"
Phil Dubach699c5092009-06-09 16:32:25 -0700125 android:text="@string/relative_view10"/>
The Android Open Source Projectf8057102009-03-15 16:47:16 -0700126
127 <!-- view11 -->
128 <TextView
Phil Dubach699c5092009-06-09 16:32:25 -0700129 android:id="@+id/relative_view11"
The Android Open Source Projectf8057102009-03-15 16:47:16 -0700130 android:layout_width="wrap_content"
131 android:layout_height="wrap_content"
Phil Dubach699c5092009-06-09 16:32:25 -0700132 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 Guy0cbe49a2010-01-08 15:05:22 -0800139 android:layout_width="match_parent"
140 android:layout_height="match_parent"
Phil Dubach699c5092009-06-09 16:32:25 -0700141 android:ignoreGravity="@+id/relative_view12"
142 android:gravity="right">
The Android Open Source Projectf8057102009-03-15 16:47:16 -0700143
144 <!-- view12 -->
145 <TextView
Phil Dubach699c5092009-06-09 16:32:25 -0700146 android:id="@id/relative_view12"
The Android Open Source Projectf8057102009-03-15 16:47:16 -0700147 android:layout_width="wrap_content"
148 android:layout_height="wrap_content"
Phil Dubach699c5092009-06-09 16:32:25 -0700149 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 Projectf8057102009-03-15 16:47:16 -0700157 </RelativeLayout>
158
159 <Spinner
160 android:id="@+id/spinner1"
Romain Guy0cbe49a2010-01-08 15:05:22 -0800161 android:layout_width="match_parent"
162 android:layout_height="match_parent"
The Android Open Source Projectf8057102009-03-15 16:47:16 -0700163 android:prompt="@string/text_view_hello"/>
164
Fabrice Di Meglioddc16f22012-07-18 19:02:58 -0700165 <RelativeLayout
166 android:id="@+id/relative_sublayout_attrs_2"
167 android:background="@drawable/blue"
168 android:layout_width="match_parent"
169 android:layout_height="match_parent">
170
171 <!-- view21, centered within its parent. -->
172 <TextView
173 android:id="@+id/relative_view21"
174 android:layout_width="wrap_content"
175 android:layout_height="wrap_content"
176 android:layout_centerInParent="true"
177 android:text="@string/relative_view1"/>
178
179 <!-- view22, below view1 and has same start position with view21. -->
180 <TextView
181 android:id="@+id/relative_view22"
182 android:layout_width="wrap_content"
183 android:layout_height="wrap_content"
184 android:layout_below="@id/relative_view21"
185 android:layout_alignStart="@id/relative_view21"
186 android:text="@string/relative_view2"/>
187
188 <!-- view23, has same top position with view21 and same bottom position with view22,
189 and on the end of view1. -->
190 <TextView
191 android:id="@+id/relative_view23"
192 android:layout_width="wrap_content"
193 android:layout_height="wrap_content"
194 android:layout_alignTop="@id/relative_view21"
195 android:layout_alignBottom="@id/relative_view22"
196 android:layout_toEndOf="@id/relative_view21"
197 android:text="@string/relative_view3"/>
198
199 <!-- view24, has same end position with view23 and above view23. -->
200 <TextView
201 android:id="@+id/relative_view24"
202 android:layout_width="wrap_content"
203 android:layout_height="wrap_content"
204 android:layout_alignEnd="@id/relative_view23"
205 android:layout_above="@id/relative_view23"
206 android:text="@string/relative_view4"/>
207
208 <!-- view25 goes on the start-bottom -->
209 <TextView
210 android:id="@+id/relative_view25"
211 android:layout_width="wrap_content"
212 android:layout_height="wrap_content"
213 android:layout_alignParentBottom="true"
214 android:layout_alignParentStart="true"
215 android:text="@string/relative_view5"/>
216
217 <!-- view26 goes on the top-end -->
218 <TextView
219 android:id="@+id/relative_view26"
220 android:layout_width="wrap_content"
221 android:layout_height="wrap_content"
222 android:layout_alignParentTop="true"
223 android:layout_alignParentEnd="true"
224 android:text="@string/relative_view6"/>
225
226 <!-- view27, has same baseline with view26 and centered horizontally within its parent. -->
227 <TextView
228 android:id="@+id/relative_view27"
229 android:layout_width="wrap_content"
230 android:layout_height="wrap_content"
231 android:layout_alignBaseline="@id/relative_view26"
232 android:layout_centerHorizontal="true"
233 android:text="@string/relative_view7"/>
234
235 <!-- view28, centered vertically within its parent and on the start of view21. -->
236 <TextView
237 android:id="@+id/relative_view28"
238 android:layout_width="wrap_content"
239 android:layout_height="wrap_content"
240 android:layout_toStartOf="@id/relative_view21"
241 android:layout_centerVertical="true"
242 android:text="@string/relative_view8"/>
243
244 <!-- view29, has same top and bottom position with view23 and same start position
245 with its parent. -->
246 <TextView
247 android:id="@+id/relative_view29"
248 android:layout_width="wrap_content"
249 android:layout_height="wrap_content"
250 android:layout_alignStart="@id/gravity_bottom"
251 android:layout_alignTop="@id/relative_view23"
252 android:layout_alignBottom="@id/relative_view23"
253 android:layout_alignWithParentIfMissing="true"
254 android:text="@string/relative_view9"/>
255
256 </RelativeLayout>
257
The Android Open Source Projectf8057102009-03-15 16:47:16 -0700258</RelativeLayout>