Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 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:paddingBottom="1dp" |
| 29 | android:orientation="vertical"> |
| 30 | |
| 31 | <LinearLayout |
| 32 | android:layout_width="match_parent" |
| 33 | android:layout_height="wrap_content" |
| 34 | android:layout_marginLeft="22dp" |
| 35 | android:layout_marginRight="16dp" |
| 36 | android:orientation="horizontal"> |
| 37 | |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 38 | <View |
| 39 | android:id="@+id/contact_image" |
| 40 | android:layout_width="48dp" |
| 41 | android:layout_height="48dp" |
| 42 | android:layout_marginRight="16dp" |
| 43 | android:layout_marginTop="16dp" |
| 44 | android:layout_marginBottom="16dp" /> |
| 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 16dp, 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="14dp" |
| 73 | android:layout_marginRight="8dp" |
| 74 | android:src="@drawable/ic_badge_reply_holo_light" /> |
| 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="15dp" |
| 82 | android:layout_marginLeft="-2dp" |
| 83 | android:layout_marginRight="2dp" |
| 84 | android:src="@drawable/ic_email_caret_single" /> |
| 85 | |
| 86 | </FrameLayout> |
| 87 | |
| 88 | <TextView |
| 89 | android:id="@+id/senders" |
| 90 | android:layout_width="match_parent" |
| 91 | android:layout_height="wrap_content" |
| 92 | android:layout_toRightOf="@id/senders_decoration" |
| 93 | android:layout_marginTop="16dp" |
| 94 | android:textSize="18sp" |
| 95 | android:lines="1" |
| 96 | android:includeFontPadding="false" |
| 97 | android:text="@string/long_string" /> |
| 98 | |
Scott Kennedy | 52b280a | 2013-07-31 13:31:57 -0700 | [diff] [blame] | 99 | <ImageView |
| 100 | android:id="@+id/info_icon" |
| 101 | android:layout_width="14dp" |
| 102 | android:layout_height="14dp" |
| 103 | android:layout_alignParentRight="true" |
| 104 | android:layout_marginTop="14dp" |
| 105 | android:layout_marginLeft="4dp" /> |
| 106 | |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 107 | <TextView |
| 108 | android:id="@+id/date" |
| 109 | android:layout_width="wrap_content" |
| 110 | android:layout_height="wrap_content" |
Scott Kennedy | 52b280a | 2013-07-31 13:31:57 -0700 | [diff] [blame] | 111 | android:layout_toLeftOf="@id/info_icon" |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 112 | android:layout_marginTop="16dp" |
| 113 | android:paddingLeft="8dp" |
| 114 | android:textSize="12sp" |
| 115 | android:lines="1" |
| 116 | android:includeFontPadding="false" |
| 117 | android:text="@string/long_string" /> |
| 118 | |
| 119 | <!-- top margin should be 16dp, but the asset has 8dp built-in padding --> |
| 120 | <!-- left padding should be 8dp, but the asset has 2dp built-in padding --> |
| 121 | <ImageView |
| 122 | android:id="@+id/paperclip" |
| 123 | android:layout_width="wrap_content" |
| 124 | android:layout_height="wrap_content" |
| 125 | android:layout_toLeftOf="@id/date" |
| 126 | android:layout_marginTop="8dp" |
| 127 | android:paddingLeft="6dp" |
| 128 | android:src="@drawable/ic_attachment_holo_light" /> |
| 129 | |
| 130 | <!-- for Email --> |
| 131 | <View android:id="@+id/color_block" |
| 132 | android:layout_width="@dimen/color_block_width" |
| 133 | android:layout_height="@dimen/color_block_height" |
| 134 | android:layout_alignParentRight="true" /> |
| 135 | |
| 136 | </RelativeLayout> |
| 137 | |
| 138 | <RelativeLayout |
| 139 | android:layout_width="match_parent" |
| 140 | android:layout_height="wrap_content" |
| 141 | android:layout_marginBottom="16dp"> |
| 142 | |
| 143 | <ImageView |
| 144 | android:id="@+id/star" |
| 145 | android:layout_width="wrap_content" |
| 146 | android:layout_height="wrap_content" |
Scott Kennedy | 1fea6a3 | 2013-07-09 15:58:51 -0700 | [diff] [blame] | 147 | android:layout_alignBottom="@+id/subject" |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 148 | android:layout_alignParentRight="true" |
Vikram Aggarwal | 5b62a95 | 2013-05-09 10:30:56 -0700 | [diff] [blame] | 149 | android:layout_marginTop="-1dp" |
Scott Kennedy | 52b280a | 2013-07-31 13:31:57 -0700 | [diff] [blame] | 150 | android:layout_marginRight="-8dp" |
Scott Kennedy | 1fea6a3 | 2013-07-09 15:58:51 -0700 | [diff] [blame] | 151 | android:src="@drawable/ic_btn_star_off" /> |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 152 | |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 153 | <TextView |
| 154 | android:id="@+id/subject" |
| 155 | android:layout_width="match_parent" |
| 156 | android:layout_height="wrap_content" |
| 157 | android:layout_toLeftOf="@id/star" |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 158 | android:lines="2" |
| 159 | android:textSize="13sp" |
| 160 | android:includeFontPadding="false" |
| 161 | android:text="@string/long_string" /> |
| 162 | |
| 163 | </RelativeLayout> |
| 164 | |
| 165 | </LinearLayout> |
| 166 | |
| 167 | </LinearLayout> |
Mark Wei | 479505d | 2013-03-21 06:04:46 -0700 | [diff] [blame] | 168 | <!-- There are 16dp bottom margins here for when there are no labels --> |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 169 | |
Mark Wei | 479505d | 2013-03-21 06:04:46 -0700 | [diff] [blame] | 170 | <include |
| 171 | layout="@layout/conversation_attachment_previews" |
| 172 | android:layout_width="match_parent" |
| 173 | android:layout_height="wrap_content" |
| 174 | android:layout_marginTop="@dimen/attachment_preview_margin_top_spacious"/> |
| 175 | |
| 176 | <!-- Margin between attachment previews and folders. 16dp bottom margins match above --> |
| 177 | <View |
| 178 | android:id="@+id/attachment_previews_bottom_margin" |
| 179 | android:layout_width="0dp" |
| 180 | android:layout_height="@dimen/attachment_preview_margin_bottom" |
| 181 | android:layout_marginBottom="16dp" |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 182 | android:visibility="gone" /> |
| 183 | |
Andy Huang | 137cfb2 | 2013-08-23 18:35:12 -0700 | [diff] [blame^] | 184 | <!-- Labels should be ~7dp below the subject *baseline*, so we cancel out part of the 16dp bottom margin --> |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 185 | <TextView |
| 186 | android:id="@+id/folders" |
| 187 | android:layout_width="match_parent" |
| 188 | android:layout_height="wrap_content" |
Andy Huang | 137cfb2 | 2013-08-23 18:35:12 -0700 | [diff] [blame^] | 189 | android:layout_marginTop="-12dp" |
Andy Huang | 12b3ee4 | 2013-04-24 22:49:43 -0700 | [diff] [blame] | 190 | android:fontFamily="sans-serif-light" |
| 191 | android:includeFontPadding="false" |
| 192 | android:text="@string/long_string" |
| 193 | android:textSize="11sp" |
| 194 | android:lines="1" |
| 195 | android:minHeight="16dp" /> |
| 196 | |
| 197 | </LinearLayout> |