1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  Copyright (C) 2013 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
18<!-- This layout is used by ContactDetailFragment to show contact details: contact photo, contact
19     display name and a dynamic number of addresses (if the contact has any) inside a ScrollView.
20-->
21
22<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
23                android:layout_width="match_parent"
24                android:layout_height="match_parent">
25
26    <LinearLayout
27            android:layout_width="match_parent"
28            android:layout_height="match_parent"
29            android:orientation="vertical"
30            android:weightSum="100">
31
32        <ImageView
33                android:id="@+id/contact_image"
34                android:layout_width="match_parent"
35                android:layout_height="0dp"
36                android:layout_weight="@integer/contact_detail_photo_percent"
37                android:scaleType="centerCrop"
38                android:src="@drawable/ic_contact_picture_180_holo_light"
39                android:contentDescription="@string/imageview_description"/>
40
41        <LinearLayout
42                android:layout_width="match_parent"
43                android:layout_height="0dp"
44                android:layout_weight="@integer/contact_detail_info_percent"
45                android:orientation="vertical">
46
47            <TextView android:id="@+id/contact_name"
48                      android:layout_width="match_parent"
49                      android:layout_height="wrap_content"
50                      android:paddingLeft="@dimen/padding"
51                      android:paddingRight="@dimen/padding"
52                      android:paddingTop="@dimen/padding"
53                      android:visibility="gone"
54                      style="@style/contactNameTitle"/>
55
56            <ScrollView
57                    android:layout_width="match_parent"
58                    android:layout_height="match_parent">
59
60                <LinearLayout
61                        android:id="@+id/contact_details_layout"
62                        android:layout_width="match_parent"
63                        android:layout_height="wrap_content"
64                        android:paddingBottom="@dimen/padding"
65                        android:orientation="vertical">
66                </LinearLayout>
67
68            </ScrollView>
69
70        </LinearLayout>
71
72    </LinearLayout>
73
74    <!-- This view will be displayed when the views above are hidden. That happens when in two-pane
75         layout mode and no contact is currently selected and therefore the this fragment will
76         simply show a text message instead of contact details. -->
77    <TextView android:id="@id/android:empty"
78              android:gravity="center"
79              android:layout_width="match_parent"
80              android:layout_height="match_parent"
81              android:text="@string/no_contact_selected"
82              android:fontFamily="sans-serif-light"
83              android:visibility="gone"
84              android:textAppearance="?android:attr/textAppearanceLarge"/>
85
86</FrameLayout>
87