1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 Copyright (C) 2013 Google Inc. 4 Licensed to The Android Open Source Project. 5 6 Licensed under the Apache License, Version 2.0 (the "License"); 7 you may not use this file except in compliance with the License. 8 You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 See the License for the specific language governing permissions and 16 limitations under the License. 17--> 18 19<!-- This layout is used as a template to create custom view CanvasConversationHeaderView 20 in normal mode. To be able to get the correct measurements, every source field should 21 be populated with data here. E.g: 22 - Text View should set text to a random long string (android:text="@string/long_string") 23 - Image View should set source to a specific asset --> 24<LinearLayout 25 xmlns:android="http://schemas.android.com/apk/res/android" 26 android:layout_width="match_parent" 27 android:layout_height="wrap_content" 28 android:minHeight="88dp" 29 android:orientation="vertical"> 30 31 <LinearLayout 32 android:id="@+id/conversation_item_frame" 33 android:layout_width="match_parent" 34 android:layout_height="wrap_content" 35 android:layout_marginLeft="@dimen/conv_list_padding" 36 android:layout_marginRight="@dimen/conv_list_padding" 37 android:orientation="horizontal"> 38 39 <View 40 android:id="@+id/contact_image" 41 android:layout_width="@dimen/contact_image_width" 42 android:layout_height="@dimen/contact_image_height" 43 android:layout_marginTop="@dimen/conv_list_padding" 44 style="@style/ConversationListContactImageStyle" /> 45 46 <LinearLayout 47 android:layout_width="0dp" 48 android:layout_height="wrap_content" 49 android:layout_weight="1" 50 android:orientation="vertical"> 51 52 <RelativeLayout 53 android:layout_width="match_parent" 54 android:layout_height="wrap_content"> 55 56 <!-- these views overlap horizontally, that's okay. --> 57 <!-- we are only interested in the left edge of senders and the right edge --> 58 <!-- of the date. --> 59 <!-- sendersWidth, clipX, and dateX are dynamically determined later. --> 60 61 <FrameLayout 62 android:id="@+id/senders_decoration" 63 android:layout_width="wrap_content" 64 android:layout_height="wrap_content"> 65 66 <!-- for Email --> 67 <!-- top margin should be 12dp, but the asset has 2dp built-in padding --> 68 <ImageView 69 android:id="@+id/reply_state" 70 android:layout_width="wrap_content" 71 android:layout_height="wrap_content" 72 android:layout_marginTop="@dimen/conv_list_padding" 73 android:src="@drawable/ic_badge_reply_holo_light" 74 style="@style/ConversationListReplyStateStyle" /> 75 76 <!-- for Gmail --> 77 <ImageView 78 android:id="@+id/personal_indicator" 79 android:layout_width="wrap_content" 80 android:layout_height="wrap_content" 81 android:layout_marginTop="@dimen/conv_list_padding" 82 android:src="@drawable/ic_email_caret_single" 83 style="@style/ConversationListPersonalIndicatorStyle" /> 84 85 </FrameLayout> 86 87 <TextView 88 android:id="@+id/senders" 89 android:layout_width="match_parent" 90 android:layout_height="wrap_content" 91 android:layout_marginTop="@dimen/conv_list_padding" 92 android:textSize="16sp" 93 android:lines="1" 94 android:includeFontPadding="false" 95 android:text="@string/long_string" 96 style="@style/ConversationListSendersStyle" /> 97 98 <ImageView 99 android:id="@+id/info_icon" 100 android:layout_width="14dp" 101 android:layout_height="14dp" 102 android:layout_marginTop="@dimen/conv_list_padding" 103 style="@style/ConversationListInfoIconStyle" /> 104 105 <TextView 106 android:id="@+id/date" 107 android:layout_width="wrap_content" 108 android:layout_height="wrap_content" 109 android:layout_marginTop="@dimen/conv_list_padding" 110 android:layout_alignBaseline="@id/senders" 111 android:textSize="12sp" 112 android:lines="1" 113 android:includeFontPadding="false" 114 android:text="@string/long_string" 115 style="@style/ConversationListDateStyle" /> 116 117 <ImageView 118 android:id="@+id/paperclip" 119 android:layout_width="wrap_content" 120 android:layout_height="wrap_content" 121 android:layout_marginTop="20dp" 122 android:src="@drawable/ic_attach_file_18dp" 123 style="@style/ConversationListPaperclipStyle" /> 124 125 <!-- for Email --> 126 <View android:id="@+id/color_block" 127 android:layout_width="@dimen/color_block_width" 128 android:layout_height="@dimen/color_block_height" 129 style="@style/ConversationListColorBlockStyle" /> 130 131 </RelativeLayout> 132 133 <RelativeLayout 134 android:layout_width="match_parent" 135 android:layout_height="wrap_content" 136 android:layout_marginBottom="@dimen/conv_list_padding"> 137 138 <ImageView 139 android:id="@+id/star" 140 android:layout_width="wrap_content" 141 android:layout_height="wrap_content" 142 android:paddingBottom="3dp" 143 android:src="@drawable/ic_star_outline_20dp" 144 style="@style/ConversationListStarStyle"/> 145 146 <TextView 147 android:id="@+id/subject" 148 android:layout_width="match_parent" 149 android:layout_height="wrap_content" 150 android:layout_marginTop="3dp" 151 android:includeFontPadding="false" 152 android:textSize="14sp" 153 style="@style/ConversationListSubjectStyle"/> 154 155 <!-- snippet overlaps folders completely in the layout; 156 code will later remove the overlap --> 157 <TextView 158 android:id="@+id/snippet" 159 android:layout_width="match_parent" 160 android:layout_height="wrap_content" 161 android:layout_marginTop="3dp" 162 android:includeFontPadding="false" 163 android:textSize="14sp" 164 style="@style/ConversationListSnippetAndFoldersStyle"/> 165 166 <!-- folders overlap snippet completely in the layout; 167 code will later remove the overlap --> 168 <TextView 169 android:id="@+id/folders" 170 android:layout_width="match_parent" 171 android:layout_height="wrap_content" 172 android:textSize="@dimen/folder_tl_font_size" 173 style="@style/ConversationListSnippetAndFoldersStyle"/> 174 175 </RelativeLayout> 176 177 </LinearLayout> 178 179 </LinearLayout> 180 181</LinearLayout> 182