diff options
author | Paul Westbrook <pwestbro@google.com> | 2013-07-13 06:49:38 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-07-13 06:49:39 +0000 |
commit | ef506c7033a3074e1d9c96dca702cd44761aafad (patch) | |
tree | 589a5e374ca688af0691a04b40e4e97c21618aa3 | |
parent | dc1b797ec35692c256293701cec58a8f4e0d45b6 (diff) | |
parent | 6a187d5113518435d13c60e2f1cabc418238c600 (diff) | |
download | android_packages_apps_UnifiedEmail-ef506c7033a3074e1d9c96dca702cd44761aafad.tar.gz android_packages_apps_UnifiedEmail-ef506c7033a3074e1d9c96dca702cd44761aafad.tar.bz2 android_packages_apps_UnifiedEmail-ef506c7033a3074e1d9c96dca702cd44761aafad.zip |
Merge "Conversation View UI Refresh: More message header." into jb-ub-mail-ur10
-rw-r--r-- | res/drawable/message_header_top_border_color.xml | 25 | ||||
-rw-r--r-- | res/layout/conversation_message_details_header.xml | 10 | ||||
-rw-r--r-- | res/layout/conversation_message_details_header_expanded.xml | 113 | ||||
-rw-r--r-- | res/layout/conversation_message_footer.xml | 4 | ||||
-rw-r--r-- | res/layout/conversation_message_header.xml | 17 | ||||
-rw-r--r-- | res/layout/conversation_message_show_pics.xml | 4 | ||||
-rw-r--r-- | res/layout/conversation_message_spam_warning.xml | 4 | ||||
-rw-r--r-- | res/layout/conversation_message_upper_header.xml | 8 | ||||
-rw-r--r-- | res/layout/super_collapsed_block.xml | 20 | ||||
-rw-r--r-- | res/values-sw600dp/dimen.xml | 4 | ||||
-rw-r--r-- | res/values/colors.xml | 2 | ||||
-rw-r--r-- | res/values/dimen.xml | 9 | ||||
-rw-r--r-- | res/values/strings.xml | 13 | ||||
-rw-r--r-- | res/values/styles.xml | 25 | ||||
-rw-r--r-- | src/com/android/mail/browse/MessageHeaderView.java | 41 |
15 files changed, 169 insertions, 130 deletions
diff --git a/res/drawable/message_header_top_border_color.xml b/res/drawable/message_header_top_border_color.xml deleted file mode 100644 index 443d1c5de..000000000 --- a/res/drawable/message_header_top_border_color.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2013 Google Inc. - Licensed to 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. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> - <item app:state_draft="true" android:state_activated="true" - android:drawable="@android:color/white" /> - <item android:state_activated="true" android:drawable="@color/conv_subject_border" /> - <item android:drawable="@android:color/white" /> -</selector> diff --git a/res/layout/conversation_message_details_header.xml b/res/layout/conversation_message_details_header.xml index 63154ffaf..505f24f91 100644 --- a/res/layout/conversation_message_details_header.xml +++ b/res/layout/conversation_message_details_header.xml @@ -20,9 +20,9 @@ android:layout_width="match_parent" android:layout_height="@dimen/message_details_header_collapsed_height" android:background="?android:attr/selectableItemBackground" - android:paddingStart="@dimen/message_details_header_padding_start" + android:paddingStart="@dimen/message_details_header_padding_start_collapsed" android:paddingEnd="@dimen/message_details_header_padding_end" - android:paddingLeft="@dimen/message_details_header_padding_start" + android:paddingLeft="@dimen/message_details_header_padding_start_collapsed" android:paddingRight="@dimen/message_details_header_padding_end" > <TextView android:id="@+id/recipients_summary" @@ -33,6 +33,8 @@ android:bufferType="spannable" style="@style/MessageHeaderSmallStyle" /> <ImageView - android:layout_gravity="end|right" - style="@style/MessageHeaderExpanderMinimizedStyle" /> + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:contentDescription="@string/expand_recipient_details" + android:src="@drawable/ic_menu_expander_minimized_holo_light" /> </GridLayout> diff --git a/res/layout/conversation_message_details_header_expanded.xml b/res/layout/conversation_message_details_header_expanded.xml index 1d2986a1d..8381edfcd 100644 --- a/res/layout/conversation_message_details_header_expanded.xml +++ b/res/layout/conversation_message_details_header_expanded.xml @@ -24,62 +24,133 @@ android:paddingEnd="@dimen/message_details_header_padding_end" android:paddingLeft="@dimen/message_details_header_padding_start" android:paddingRight="@dimen/message_details_header_padding_end" - android:columnCount="2" + android:columnCount="3" android:rowCount="5" > + + <TextView + android:id="@+id/from_heading" + android:layout_width="@dimen/message_header_contact_photo_width" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/message_header_inner_side_padding" + android:layout_marginRight="@dimen/message_header_inner_side_padding" + android:layout_column="0" + android:layout_row="0" + android:gravity="end|right" + android:text="@string/from_heading" + android:visibility="gone" + style="@style/MessageHeaderSmallStyle" /> <TextView - android:id="@+id/from" + android:id="@+id/from_details" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" - android:layout_column="0" + android:layout_marginBottom="4dp" + android:layout_column="1" android:layout_row="0" android:autoLink="email" android:visibility="gone" - style="@style/MessageDetailsItemStyle" /> + style="@style/MessageDetailsValueStyle" /> + <ImageView + android:id="@+id/details_expander" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/message_header_inner_side_padding" + android:layout_marginLeft="@dimen/message_header_inner_side_padding" + android:layout_column="2" + android:layout_row="0" + android:contentDescription="@string/collapse_recipient_details" + android:src="@drawable/ic_menu_expander_maximized_holo_light" /> + <TextView + android:id="@+id/replyto_heading" + android:layout_width="@dimen/message_header_contact_photo_width" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/message_header_inner_side_padding" + android:layout_marginRight="@dimen/message_header_inner_side_padding" + android:layout_column="0" + android:layout_row="1" + android:gravity="end|right" + android:text="@string/replyto_heading" + android:visibility="gone" + style="@style/MessageHeaderSmallStyle" /> <TextView - android:id="@+id/replyto" + android:id="@+id/replyto_details" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" - android:layout_column="0" + android:layout_marginBottom="4dp" + android:layout_column="1" android:layout_row="1" android:autoLink="email" android:visibility="gone" - style="@style/MessageDetailsItemStyle" /> + style="@style/MessageDetailsValueStyle" /> + <TextView + android:id="@+id/to_heading" + android:layout_width="@dimen/message_header_contact_photo_width" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/message_header_inner_side_padding" + android:layout_marginRight="@dimen/message_header_inner_side_padding" + android:layout_column="0" + android:layout_row="2" + android:gravity="end|right" + android:text="@string/to_heading" + android:visibility="gone" + style="@style/MessageHeaderSmallStyle" /> <TextView - android:id="@+id/to" + android:id="@+id/to_details" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" - android:layout_column="0" + android:layout_marginBottom="4dp" + android:layout_column="1" android:layout_row="2" android:autoLink="email" android:visibility="gone" - style="@style/MessageDetailsItemStyle" /> + style="@style/MessageDetailsValueStyle" /> <TextView - android:id="@+id/cc" + android:id="@+id/cc_heading" + android:layout_width="@dimen/message_header_contact_photo_width" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/message_header_inner_side_padding" + android:layout_marginRight="@dimen/message_header_inner_side_padding" + android:layout_column="0" + android:layout_row="3" + android:gravity="end|right" + android:text="@string/cc_heading" + android:visibility="gone" + style="@style/MessageHeaderSmallStyle" /> + <TextView + android:id="@+id/cc_details" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" - android:layout_column="0" + android:layout_marginBottom="4dp" + android:layout_column="1" android:layout_row="3" android:autoLink="email" android:visibility="gone" - style="@style/MessageDetailsItemStyle" /> + style="@style/MessageDetailsValueStyle" /> <TextView - android:id="@+id/bcc" + android:id="@+id/bcc_heading" + android:layout_width="@dimen/message_header_contact_photo_width" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/message_header_inner_side_padding" + android:layout_marginRight="@dimen/message_header_inner_side_padding" + android:layout_column="0" + android:layout_row="4" + android:gravity="end|right" + android:text="@string/bcc_heading" + android:visibility="gone" + style="@style/MessageHeaderSmallStyle" /> + <TextView + android:id="@+id/bcc_details" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" - android:layout_column="0" + android:layout_marginBottom="4dp" + android:layout_column="1" android:layout_row="4" android:autoLink="email" android:visibility="gone" - style="@style/MessageDetailsItemStyle" /> - <ImageView - android:id="@+id/details_expander" - android:layout_column="1" - android:layout_row="0" - style="@style/MessageHeaderExpanderMaximizedStyle" /> + style="@style/MessageDetailsValueStyle" /> </GridLayout> diff --git a/res/layout/conversation_message_footer.xml b/res/layout/conversation_message_footer.xml index 8f1c951af..04a1e113e 100644 --- a/res/layout/conversation_message_footer.xml +++ b/res/layout/conversation_message_footer.xml @@ -37,9 +37,9 @@ <View android:id="@+id/attachments_header_bar" android:layout_width="match_parent" - android:layout_height="@dimen/message_details_header_bottom_border_height" + android:layout_height="@dimen/message_details_header_border_height" android:visibility="gone" - android:background="@color/conv_subject_border" + android:background="@color/conversation_border_color" android:layout_marginBottom="8dp" /> <com.android.mail.ui.AttachmentTileGrid android:id="@+id/attachment_tile_grid" diff --git a/res/layout/conversation_message_header.xml b/res/layout/conversation_message_header.xml index 7242529c7..c0c1c63f2 100644 --- a/res/layout/conversation_message_header.xml +++ b/res/layout/conversation_message_header.xml @@ -22,12 +22,23 @@ android:visibility="visible" android:background="@android:color/white" android:orientation="vertical" - android:layout_marginLeft="@dimen/conversation_view_margin_side" - android:layout_marginRight="@dimen/conversation_view_margin_side" android:layout_marginStart="@dimen/conversation_view_margin_side" - android:layout_marginEnd="@dimen/conversation_view_margin_side" > + android:layout_marginEnd="@dimen/conversation_view_margin_side" + android:layout_marginLeft="@dimen/conversation_view_margin_side" + android:layout_marginRight="@dimen/conversation_view_margin_side" > + + <View + android:layout_width="match_parent" + android:layout_height="@dimen/message_details_header_border_height" + android:background="@color/conversation_border_color" /> <include layout="@layout/conversation_message_upper_header" android:id="@+id/upper_header" /> + <View + android:id="@+id/snap_header_bottom_border" + android:layout_width="match_parent" + android:layout_height="@dimen/message_details_header_border_height" + android:background="@color/conversation_border_color" + android:visibility="gone" /> </com.android.mail.browse.MessageHeaderView> diff --git a/res/layout/conversation_message_show_pics.xml b/res/layout/conversation_message_show_pics.xml index bdb0377f6..7ef2c2266 100644 --- a/res/layout/conversation_message_show_pics.xml +++ b/res/layout/conversation_message_show_pics.xml @@ -48,7 +48,7 @@ <View android:id="@+id/show_pics_bottom_border" android:layout_width="match_parent" - android:layout_height="@dimen/message_details_header_bottom_border_height" + android:layout_height="@dimen/message_details_header_border_height" android:layout_below="@id/show_pictures_text" - android:background="@color/conv_subject_border" /> + android:background="@color/conversation_border_color" /> </RelativeLayout> diff --git a/res/layout/conversation_message_spam_warning.xml b/res/layout/conversation_message_spam_warning.xml index 848411edf..f59b224c5 100644 --- a/res/layout/conversation_message_spam_warning.xml +++ b/res/layout/conversation_message_spam_warning.xml @@ -59,8 +59,8 @@ <View android:id="@+id/spam_warning_bottom_border" android:layout_width="match_parent" - android:layout_height="@dimen/message_details_header_bottom_border_height" + android:layout_height="@dimen/message_details_header_border_height" android:layout_alignParentBottom="true" - android:background="@color/conv_subject_border" /> + android:background="@color/conversation_border_color" /> </com.android.mail.browse.SpamWarningView> diff --git a/res/layout/conversation_message_upper_header.xml b/res/layout/conversation_message_upper_header.xml index 79e832d65..5a842736f 100644 --- a/res/layout/conversation_message_upper_header.xml +++ b/res/layout/conversation_message_upper_header.xml @@ -33,16 +33,16 @@ <QuickContactBadge android:id="@+id/photo" - android:layout_width="@dimen/contact_photo_width" - android:layout_height="@dimen/contact_photo_height" + android:layout_width="@dimen/message_header_contact_photo_width" + android:layout_height="@dimen/message_header_contact_photo_height" android:layout_gravity="center_vertical" android:scaleType="centerCrop" android:contentDescription="@string/contact_info_string" /> <!-- draft should match photo in dimensions --> <ImageView android:id="@+id/draft" - android:layout_width="@dimen/contact_photo_width" - android:layout_height="@dimen/contact_photo_height" + android:layout_width="@dimen/message_header_contact_photo_width" + android:layout_height="@dimen/message_header_contact_photo_height" android:layout_gravity="center_vertical" android:visibility="gone" android:scaleType="center" diff --git a/res/layout/super_collapsed_block.xml b/res/layout/super_collapsed_block.xml index 1875dfa2c..38b74348c 100644 --- a/res/layout/super_collapsed_block.xml +++ b/res/layout/super_collapsed_block.xml @@ -20,22 +20,22 @@ android:id="@+id/super_collapsed_block" android:layout_width="match_parent" android:layout_height="@dimen/super_collapsed_height" - android:layout_marginLeft="@dimen/conversation_view_margin_side" - android:layout_marginRight="@dimen/conversation_view_margin_side" android:layout_marginStart="@dimen/conversation_view_margin_side" android:layout_marginEnd="@dimen/conversation_view_margin_side" + android:layout_marginLeft="@dimen/conversation_view_margin_side" + android:layout_marginRight="@dimen/conversation_view_margin_side" android:layout_marginBottom="@dimen/message_header_vertical_margin" android:background="@color/collapsed_message_header_background_color" - android:gravity="center" - android:orientation="horizontal" - android:paddingLeft="@dimen/message_header_padding" - android:paddingRight="@dimen/message_header_padding" - android:paddingStart="@dimen/message_header_padding" - android:paddingEnd="@dimen/message_header_padding"> + android:orientation="vertical" > + <View + android:layout_width="match_parent" + android:layout_height="@dimen/message_details_header_border_height" + android:background="@color/conversation_border_color" /> <TextView android:id="@+id/super_collapsed_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" android:textSize="14sp" android:textColor="@color/dark_gray_text_color" /> </com.android.mail.browse.SuperCollapsedBlock> diff --git a/res/values-sw600dp/dimen.xml b/res/values-sw600dp/dimen.xml index 6e25e58aa..9bb262e0e 100644 --- a/res/values-sw600dp/dimen.xml +++ b/res/values-sw600dp/dimen.xml @@ -24,8 +24,8 @@ <dimen name="conversation_page_gutter">0dip</dimen> <dimen name="conversation_side_padding">16dip</dimen> <dimen name="message_header_inner_side_padding">16dip</dimen> - <dimen name="contact_photo_width">64dp</dimen> - <dimen name="contact_photo_height">64dp</dimen> + <dimen name="message_header_contact_photo_width">64dp</dimen> + <dimen name="message_header_contact_photo_height">64dp</dimen> <dimen name="message_details_header_padding_start">14dip</dimen> <dimen name="message_details_header_padding_end">4dip</dimen> <dimen name="message_header_height">64sp</dimen> diff --git a/res/values/colors.xml b/res/values/colors.xml index 3f6ccffb0..21197aa2d 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -72,7 +72,7 @@ <color name="conv_header_add_label_background">#eeeeee</color> <!-- Conversation message header colors --> - <color name="conv_subject_border">#c0c0c0</color> + <color name="conversation_border_color">#c0c0c0</color> <color name="conv_header_text_light">#a6a8ab</color> <color name="conv_header_text_dark">@color/dark_gray_text_color</color> <color name="conv_header_text_link_blue">#35b4e3</color> diff --git a/res/values/dimen.xml b/res/values/dimen.xml index d4e337212..12ec0840d 100644 --- a/res/values/dimen.xml +++ b/res/values/dimen.xml @@ -53,10 +53,11 @@ <dimen name="conversation_folder_padding_before">8dip</dimen> <dimen name="conversation_folder_padding_above">4dip</dimen> <dimen name="message_details_header_collapsed_height">48sp</dimen> - <dimen name="message_details_header_bottom_border_height">1dip</dimen> + <dimen name="message_details_header_border_height">1dip</dimen> <dimen name="message_details_header_date_margin_right">4dip</dimen> <dimen name="message_header_vertical_margin">1dip</dimen> - <dimen name="message_details_header_padding_start">76dip</dimen> + <dimen name="message_details_header_padding_start">16dip</dimen> + <dimen name="message_details_header_padding_start_collapsed">76dip</dimen> <dimen name="message_details_header_padding_end">16dip</dimen> <dimen name="message_header_height">48sp</dimen> <dimen name="message_header_presence_top_margin">-4dp</dimen> @@ -67,8 +68,8 @@ <dimen name="message_header_title_container_margin_end_collapsed">12dp</dimen> <dimen name="super_collapsed_height">34sp</dimen> <dimen name="notification_view_height">36dip</dimen> - <dimen name="contact_photo_width">48dp</dimen> - <dimen name="contact_photo_height">48dp</dimen> + <dimen name="message_header_contact_photo_width">48dp</dimen> + <dimen name="message_header_contact_photo_height">48dp</dimen> <dimen name="message_header_inner_side_padding">12dp</dimen> <dimen name="attachment_toast_yoffset">-100dip</dimen> <dimen name="spinner_frame_width">196dip</dimen> diff --git a/res/values/strings.xml b/res/values/strings.xml index 0bd8e4591..14263b24f 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -524,6 +524,10 @@ <item quantity="other"><xliff:g id="count" example="4">%1$d</xliff:g> older messages</item> </plurals> + <string name="from_heading">From:</string> + <!-- Shown to display the reply to address of the message [CHAR LIMIT=20] --> + <string name="replyto_heading">Reply-to:</string> + <!-- Shown to display the recipient(s) of the message [CHAR LIMIT=10] --> <!-- Shown in HTML to display the recipient(s) of the message [CHAR LIMIT=10] --> <string name="to_heading">To:</string> <!-- Shown in HTML to display the recipient(s) of the message [CHAR LIMIT=10] --> @@ -531,15 +535,6 @@ <!-- Shown in HTML to display the recipient(s) of the message [CHAR LIMIT=10] --> <string name="bcc_heading">Bcc:</string> <!-- Shown to display the from address of the message [CHAR LIMIT=10] --> - <string name="from_details">From: <xliff:g id="display_address" example="John Doe jdoe@example.com">%1$s</xliff:g></string> - <!-- Shown to display the reply to address of the message [CHAR LIMIT=20] --> - <string name="replyto_details">Reply-to: <xliff:g id="display_address" example="John Doe jdoe@example.com">%1$s</xliff:g></string> - <!-- Shown to display the recipient(s) of the message [CHAR LIMIT=10] --> - <string name="to_details">To: <xliff:g id="display_address(es)" example="John Doe jdoe@example.com">%1$s</xliff:g></string> - <!-- Shown to display the recipient(s) of the message [CHAR LIMIT=10] --> - <string name="cc_details">Cc: <xliff:g id="display_address(es)" example="John Doe jdoe@example.com">%1$s</xliff:g></string> - <!-- Shown to display the recipient(s) of the message [CHAR LIMIT=10] --> - <string name="bcc_details">Bcc: <xliff:g id="display_address(es)" example="John Doe jdoe@example.com">%1$s</xliff:g></string> <!-- Displayed above an HTML message to show the images in that message [CHAR LIMIT=40] --> <string name="show_images">Show pictures</string> <!-- Displayed above an HTML message to always show images in messages from that sender [CHAR LIMIT=40] --> diff --git a/res/values/styles.xml b/res/values/styles.xml index 1fc1d1021..c57900e05 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -282,16 +282,10 @@ <item name="android:textAllCaps">true</item> </style> - <style name="MessageDetailsItemStyle" parent="MessageHeaderSmallStyle"> - <item name="android:lineSpacingMultiplier">1.5</item> - </style> - - <style name="MessageDetailsValueStyle" parent="MessageDetailsItemStyle"> - <item name="android:textColor">@color/conv_header_text_light</item> - </style> - - <style name="MessageDetailsValueSelectableStyle" parent="MessageDetailsValueStyle"> + <style name="MessageDetailsValueStyle" parent="MessageHeaderSmallStyle"> <item name="android:textIsSelectable">true</item> + <item name="android:textColor">@color/conv_header_text_light</item> + <item name="android:textColorLink">@color/conv_header_text_link_blue</item> </style> <style name="MessageHeaderActionButtonStyle" parent="android:Widget.Holo.Button.Borderless"> @@ -300,19 +294,6 @@ <item name="android:scaleType">center</item> </style> - <style name="MessageHeaderExpanderMinimizedStyle"> - <item name="android:layout_width">wrap_content</item> - <item name="android:layout_height">wrap_content</item> - <item name="android:src">@drawable/ic_menu_expander_minimized_holo_light</item> - <item name="android:contentDescription">@string/expand_recipient_details</item> - </style> - - <style name="MessageHeaderExpanderMaximizedStyle"> - <item name="android:layout_width">wrap_content</item> - <item name="android:layout_height">wrap_content</item> - <item name="android:src">@drawable/ic_menu_expander_maximized_holo_light</item> - <item name="android:contentDescription">@string/collapse_recipient_details</item> - </style> <style name="MessageAttachmentButtonBaseStyle" parent="@android:style/Widget.Holo.Button.Borderless"> <item name="android:layout_width">wrap_content</item> <item name="android:minHeight">0dip</item> diff --git a/src/com/android/mail/browse/MessageHeaderView.java b/src/com/android/mail/browse/MessageHeaderView.java index a13339640..72987d318 100644 --- a/src/com/android/mail/browse/MessageHeaderView.java +++ b/src/com/android/mail/browse/MessageHeaderView.java @@ -106,6 +106,7 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, private MessageHeaderViewCallbacks mCallbacks; private ViewGroup mUpperHeaderView; + private View mSnapHeaderBottomBorder; private TextView mSenderNameView; private TextView mSenderEmailView; private TextView mDateView; @@ -251,8 +252,10 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, mMyName = context.getString(R.string.me_object_pronun); final Resources resources = getResources(); - mContactPhotoWidth = resources.getDimensionPixelSize(R.dimen.contact_photo_width); - mContactPhotoHeight = resources.getDimensionPixelSize(R.dimen.contact_photo_height); + mContactPhotoWidth = resources.getDimensionPixelSize( + R.dimen.message_header_contact_photo_width); + mContactPhotoHeight = resources.getDimensionPixelSize( + R.dimen.message_header_contact_photo_height); } /** @@ -266,6 +269,7 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, protected void onFinishInflate() { super.onFinishInflate(); mUpperHeaderView = (ViewGroup) findViewById(R.id.upper_header); + mSnapHeaderBottomBorder = findViewById(R.id.snap_header_bottom_border); mSenderNameView = (TextView) findViewById(R.id.sender_name); mSenderEmailView = (TextView) findViewById(R.id.sender_email); mDateView = (TextView) findViewById(R.id.send_date); @@ -588,8 +592,7 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, * Return the address, if a name is present, or null if not. */ private static CharSequence getSenderAddress(Address sender) { - String displayName = sender == null ? "" : sender.getName(); - return TextUtils.isEmpty(displayName) ? null : sender.getAddress(); + return sender.getAddress(); } private static void setChildVisibility(int visibility, View... children) { @@ -618,7 +621,7 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, if (mIsViewOnlyMode) { setMessageDetailsVisibility(VISIBLE); - + setChildVisibility(GONE, mSnapHeaderBottomBorder); setChildVisibility(GONE, mReplyButton, mReplyAllButton, mForwardButton, mOverflowButton, mDraftIcon, mEditDraftButton, mStarView, @@ -630,6 +633,7 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, int normalVis, draftVis; setMessageDetailsVisibility((mIsSnappy) ? GONE : VISIBLE); + setChildVisibility(mIsSnappy ? VISIBLE : GONE, mSnapHeaderBottomBorder); if (mIsDraft) { normalVis = GONE; @@ -652,6 +656,7 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, } else { setMessageDetailsVisibility(GONE); + setChildVisibility(GONE, mSnapHeaderBottomBorder); setChildVisibility(VISIBLE, mSnippetView, mUpperDateView); setChildVisibility(GONE, mEditDraftButton, mReplyButton, mReplyAllButton, @@ -678,7 +683,6 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, } } - } /** @@ -716,13 +720,13 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, /** * Render an email list for the expanded message details view. - * @param textViewId - * @param strRes + * @param headerId + * @param detailsId * @param emails * @param showViaDomain * @param rootView */ - private void renderEmailList(int textViewId, int strRes, String[] emails, + private void renderEmailList(int headerId, int detailsId, String[] emails, boolean showViaDomain, View rootView) { if (emails == null || emails.length == 0) { return; @@ -769,11 +773,10 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, } } - final String finalFormattedString = - res.getString(strRes, TextUtils.join("\n", formattedEmails)); - final TextView textView = (TextView) rootView.findViewById(textViewId); - textView.setText(finalFormattedString); - textView.setVisibility(VISIBLE); + rootView.findViewById(headerId).setVisibility(VISIBLE); + final TextView detailsText = (TextView) rootView.findViewById(detailsId); + detailsText.setText(TextUtils.join("\n", formattedEmails)); + detailsText.setVisibility(VISIBLE); } /** @@ -1325,13 +1328,13 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, viewCreated = true; } if (!mExpandedDetailsValid) { - renderEmailList(R.id.from, R.string.from_details, mFrom, mMessage.viaDomain != null, + renderEmailList(R.id.from_heading, R.id.from_details, mFrom, mMessage.viaDomain != null, mExpandedDetailsView); - renderEmailList(R.id.replyto, R.string.replyto_details, mReplyTo, false, + renderEmailList(R.id.replyto_heading, R.id.replyto_details, mReplyTo, false, mExpandedDetailsView); - renderEmailList(R.id.to, R.string.to_details, mTo, false, mExpandedDetailsView); - renderEmailList(R.id.cc, R.string.cc_details, mCc, false, mExpandedDetailsView); - renderEmailList(R.id.bcc, R.string.bcc_details, mBcc, false, mExpandedDetailsView); + renderEmailList(R.id.to_heading, R.id.to_details, mTo, false, mExpandedDetailsView); + renderEmailList(R.id.cc_heading, R.id.cc_details, mCc, false, mExpandedDetailsView); + renderEmailList(R.id.bcc_heading, R.id.bcc_details, mBcc, false, mExpandedDetailsView); mExpandedDetailsValid = true; } |