blob: 669e86e8c7f0e7cb7f99d5df8531e62a0352b3f8 [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
165</RelativeLayout>