<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2013 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!-- This layout is used by ContactDetailFragment to show contact details: contact photo, contact
     display name and a dynamic number of addresses (if the contact has any) inside a ScrollView.
-->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

    <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:weightSum="100">

        <ImageView
                android:id="@+id/contact_image"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="@integer/contact_detail_photo_percent"
                android:scaleType="centerCrop"
                android:src="@drawable/ic_contact_picture_180_holo_light"
                android:contentDescription="@string/imageview_description"/>

        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="@integer/contact_detail_info_percent"
                android:orientation="vertical">

            <TextView android:id="@+id/contact_name"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:paddingLeft="@dimen/padding"
                      android:paddingRight="@dimen/padding"
                      android:paddingTop="@dimen/padding"
                      android:visibility="gone"
                      style="@style/contactNameTitle"/>

            <ScrollView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                <LinearLayout
                        android:id="@+id/contact_details_layout"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:paddingBottom="@dimen/padding"
                        android:orientation="vertical">
                </LinearLayout>

            </ScrollView>

        </LinearLayout>

    </LinearLayout>

    <!-- This view will be displayed when the views above are hidden. That happens when in two-pane
         layout mode and no contact is currently selected and therefore the this fragment will
         simply show a text message instead of contact details. -->
    <TextView android:id="@id/android:empty"
              android:gravity="center"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:text="@string/no_contact_selected"
              android:fontFamily="sans-serif-light"
              android:visibility="gone"
              android:textAppearance="?android:attr/textAppearanceLarge"/>

</FrameLayout>
