Home | History | Annotate | Download | only in layout-sw580dp
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!-- Copyright (C) 2011 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 
     17 <!--
     18   This is a header entry in the contact details list for when the contact does not have social
     19   updates, which means that the contact's photo and basic info will scroll with the list of details.
     20 -->
     21 <LinearLayout
     22     xmlns:android="http://schemas.android.com/apk/res/android"
     23     xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
     24     android:layout_width="match_parent"
     25     android:layout_height="wrap_content"
     26     android:orientation="vertical">
     27 
     28     <!-- Ensure that the contact photo for a contact WITHOUT social updates is the same width and
     29     height as a contact WITH social updates (where the photo is 2/3 of the screen width). -->
     30     <view
     31         class="com.android.contacts.widget.ProportionalLayout"
     32         android:layout_width="match_parent"
     33         android:layout_height="match_parent"
     34         ex:ratio="0.66"
     35         ex:direction="widthToHeight">
     36 
     37         <LinearLayout
     38             android:layout_width="match_parent"
     39             android:layout_height="match_parent"
     40             android:orientation="horizontal">
     41 
     42             <ImageView
     43                 android:id="@+id/photo"
     44                 android:scaleType="centerCrop"
     45                 android:layout_width="0dip"
     46                 android:layout_height="match_parent"
     47                 android:layout_weight="2" />
     48 
     49             <!-- Empty view to fill the rest of the LinearLayout, so that a weight on its sibling
     50             ImageView will work.-->
     51             <View
     52                 android:layout_width="0dip"
     53                 android:layout_weight="1"
     54                 android:layout_height="match_parent" />
     55 
     56         </LinearLayout>
     57 
     58     </view>
     59 
     60     <TextView
     61         android:id="@+id/name"
     62         android:layout_width="match_parent"
     63         android:layout_height="wrap_content"
     64         android:textAppearance="?android:attr/textAppearanceLarge"
     65         android:textSize="@dimen/detail_header_name_text_size" />
     66 
     67     <TextView
     68         android:id="@+id/company"
     69         android:layout_width="match_parent"
     70         android:layout_height="wrap_content"
     71         android:textAppearance="?android:attr/textAppearanceMedium"
     72         android:textColor="?android:attr/textColorSecondary" />
     73 
     74     <CheckBox
     75         android:id="@+id/star"
     76         android:layout_width="wrap_content"
     77         android:layout_height="wrap_content"
     78         android:layout_gravity="top"
     79         android:contentDescription="@string/description_star"
     80         style="?android:attr/starStyle" />
     81 
     82 </LinearLayout>
     83