From dcfa46c5cacd137c7e95e8b9a86e5bf348cef6e0 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 3 Apr 2020 16:58:12 -0700 Subject: [PATCH 1/2] Fixed an issue where the conversation title was showing doubled For conversations, it's not necessary anymore to extract the conversation title into the heads up layout. Fixes: 152655946 Test: add conversation group, observe no double text Change-Id: I99594ae9e503cf8589603899e0053793be96958a --- core/java/android/app/Notification.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index f461a1708373e..7a593498e9671 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -7158,7 +7158,8 @@ public class Notification implements Parcelable CharSequence conversationTitle = !TextUtils.isEmpty(super.mBigContentTitle) ? super.mBigContentTitle : mConversationTitle; - if (!TextUtils.isEmpty(conversationTitle) && !hasOnlyWhiteSpaceSenders()) { + if (mConversationType == CONVERSATION_TYPE_LEGACY + && !TextUtils.isEmpty(conversationTitle) && !hasOnlyWhiteSpaceSenders()) { return conversationTitle; } return null; From 28db07e902398e236783aac805171158ae953dd8 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 3 Apr 2020 17:33:24 -0700 Subject: [PATCH 2/2] Fixed the heads up layout of conversations Previously the expand button layout was always at 80dp which made the collapsed size increase. we now measure it at match_parent instead and just internally use another layout to position it properly. Fixes: 153204251 Test: add heads up notification, observe normal padding Change-Id: I76df6529c1a24808bce54ed0d04230cddf7a0c8c --- .../internal/widget/ConversationLayout.java | 6 +- ...ication_template_material_conversation.xml | 99 +++++++++++-------- core/res/res/values/symbols.xml | 1 + 3 files changed, 61 insertions(+), 45 deletions(-) diff --git a/core/java/com/android/internal/widget/ConversationLayout.java b/core/java/com/android/internal/widget/ConversationLayout.java index 523c7493420b4..5a979ac97c54c 100644 --- a/core/java/com/android/internal/widget/ConversationLayout.java +++ b/core/java/com/android/internal/widget/ConversationLayout.java @@ -121,6 +121,7 @@ public class ConversationLayout extends FrameLayout private CachingIconView mConversationIconBadgeBg; private Icon mLargeIcon; private View mExpandButtonContainer; + private View mExpandButtonInnerContainer; private ViewGroup mExpandButtonAndContentContainer; private NotificationExpandButton mExpandButton; private MessagingLinearLayout mImageMessageContainer; @@ -242,6 +243,7 @@ public class ConversationLayout extends FrameLayout mConversationHeader = findViewById(R.id.conversation_header); mContentContainer = findViewById(R.id.notification_action_list_margin_target); mExpandButtonAndContentContainer = findViewById(R.id.expand_button_and_content_container); + mExpandButtonInnerContainer = findViewById(R.id.expand_button_inner_container); mExpandButton = findViewById(R.id.expand_button); mExpandButtonExpandedTopMargin = getResources().getDimensionPixelSize( R.dimen.conversation_expand_button_top_margin_expanded); @@ -1169,7 +1171,7 @@ public class ConversationLayout extends FrameLayout layoutParams.topMargin = topMargin; mExpandButton.setLayoutParams(layoutParams); - mExpandButtonContainer.setContentDescription(mContext.getText(contentDescriptionId)); + mExpandButtonInnerContainer.setContentDescription(mContext.getText(contentDescriptionId)); } private void updateContentEndPaddings() { @@ -1213,7 +1215,7 @@ public class ConversationLayout extends FrameLayout mExpandable = expandable; if (expandable) { mExpandButtonContainer.setVisibility(VISIBLE); - mExpandButtonContainer.setOnClickListener(onClickListener); + mExpandButtonInnerContainer.setOnClickListener(onClickListener); } else { // TODO: handle content paddings to end of layout mExpandButtonContainer.setVisibility(GONE); diff --git a/core/res/res/layout/notification_template_material_conversation.xml b/core/res/res/layout/notification_template_material_conversation.xml index b9ca29276cf00..e986b1886abf8 100644 --- a/core/res/res/layout/notification_template_material_conversation.xml +++ b/core/res/res/layout/notification_template_material_conversation.xml @@ -245,6 +245,7 @@ android:id="@+id/notification_messaging" android:layout_width="match_parent" android:layout_height="wrap_content" + android:minHeight="@dimen/notification_text_size" android:spacing="@dimen/notification_messaging_spacing" android:clipToPadding="false" android:clipChildren="false" @@ -263,53 +264,65 @@ - - + - - + + - - - - + > + + + + + + + diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 42718cba0fc99..d35a1cb05bddb 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3865,6 +3865,7 @@ +