Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!--
      3  * Copyright (C) 2008 The Android Open Source Project.
      4  *
      5  * Licensed under the Apache License, Version 2.0 (the "License");
      6  * you may not use this file except in compliance with the License.
      7  * You may obtain a copy of the License at
      8  *
      9  *      http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  * Unless required by applicable law or agreed to in writing, software
     12  * distributed under the License is distributed on an "AS IS" BASIS,
     13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  * See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  -->
     17 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     18                 android:layout_width="match_parent"
     19                 android:layout_height="wrap_content"
     20                 android:orientation="vertical">
     21 
     22     <LinearLayout android:id="@+id/horizontal"
     23         android:orientation="horizontal"
     24         android:layout_width="wrap_content"
     25         android:layout_height="100dip"
     26         android:background="#FF909090">
     27 
     28         <TextView android:id="@+id/gravity_top"
     29             android:background="#FF00FF00"
     30             android:layout_width="wrap_content"
     31             android:layout_height="50dip"
     32             android:layout_gravity="top"
     33             android:text="@string/horizontal_text_1"/>
     34 
     35         <TextView android:id="@+id/gravity_center_vertical"
     36             android:background="#FF00FF00"
     37             android:layout_width="wrap_content"
     38             android:layout_height="50dip"
     39             android:layout_gravity="center_vertical"
     40             android:text="@string/horizontal_text_2"/>
     41 
     42         <TextView android:id="@+id/gravity_bottom"
     43             android:background="#FF00FF00"
     44             android:layout_width="wrap_content"
     45             android:layout_height="50dip"
     46             android:layout_gravity="bottom"
     47             android:text="@string/horizontal_text_3"/>
     48     </LinearLayout>
     49 
     50     <LinearLayout android:id="@+id/vertical"
     51         android:orientation="vertical"
     52         android:layout_width="100dip"
     53         android:layout_height="wrap_content"
     54         android:background="#FFFF0909">
     55 
     56         <TextView android:id="@+id/gravity_left"
     57             android:background="#FF00FF00"
     58             android:layout_width="wrap_content"
     59             android:layout_height="20dip"
     60             android:layout_gravity="left"
     61             android:text="@string/vertical_text_1"/>
     62 
     63         <TextView android:id="@+id/gravity_center_horizontal"
     64             android:background="#FF0000FF"
     65             android:layout_width="wrap_content"
     66             android:layout_height="20dip"
     67             android:layout_gravity="center_horizontal"
     68             android:text="@string/vertical_text_2"/>
     69 
     70         <TextView android:id="@+id/gravity_right"
     71             android:background="#FF00FF00"
     72             android:layout_width="wrap_content"
     73             android:layout_height="20dip"
     74             android:layout_gravity="right"
     75             android:text="@string/vertical_text_3"/>
     76     </LinearLayout>
     77 
     78     <LinearLayout android:id="@+id/weightsum"
     79         android:orientation="horizontal"
     80         android:weightSum="1.0"
     81         android:baselineAligned="false"
     82         android:layout_width="100dip"
     83         android:layout_height="100dip"
     84         android:background="#FF909090">
     85 
     86         <TextView android:id="@+id/weight_0_2"
     87             android:background="#FF0000FF"
     88             android:layout_width="0dip"
     89             android:layout_height="wrap_content"
     90             android:layout_weight="0.2"
     91             android:text="@string/horizontal_text_1"/>
     92 
     93         <TextView android:id="@+id/weight_0_5"
     94             android:background="#FFF00F0F"
     95             android:layout_width="0dip"
     96             android:layout_height="wrap_content"
     97             android:layout_weight="0.5"
     98             android:text="@string/horizontal_text_2"/>
     99 
    100         <TextView android:id="@+id/weight_0_3"
    101             android:background="#FF0000FF"
    102             android:layout_width="0dip"
    103             android:layout_height="wrap_content"
    104             android:layout_weight="0.3"
    105             android:text="@string/horizontal_text_3"/>
    106     </LinearLayout>
    107 
    108     <LinearLayout android:id="@+id/baseline_aligned_child_index"
    109         android:orientation="vertical"
    110         android:baselineAlignedChildIndex="1"
    111         android:layout_width="wrap_content"
    112         android:layout_height="wrap_content"
    113         android:background="#FFFF0909">
    114 
    115         <TextView android:id="@+id/textview1"
    116             android:background="#FF00FF00"
    117             android:layout_width="wrap_content"
    118             android:layout_height="20dip"
    119             android:layout_gravity="left"
    120             android:text="@string/vertical_text_1"/>
    121 
    122         <TextView android:id="@+id/textview2"
    123             android:background="#FF0000FF"
    124             android:layout_width="wrap_content"
    125             android:layout_height="20dip"
    126             android:layout_gravity="center_horizontal"
    127             android:text="@string/vertical_text_2"/>
    128 
    129         <TextView android:id="@+id/textview3"
    130             android:background="#FF00FF00"
    131             android:layout_width="wrap_content"
    132             android:layout_height="20dip"
    133             android:layout_gravity="right"
    134             android:text="@string/vertical_text_3"/>
    135     </LinearLayout>
    136 
    137 </LinearLayout>
    138