From 52440e988c27741f97c5a4b945c6d5ba401097a7 Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Thu, 19 Mar 2020 15:18:58 -0400 Subject: [PATCH] Add application name to expanded conversation view Bug: 150905003 Test: manual Change-Id: Ibb16717028498c508beda423a76375499a6f6ad9 --- .../internal/widget/ConversationLayout.java | 7 ++++ ...ication_template_material_conversation.xml | 11 +++++++ ...ficationConversationTemplateViewWrapper.kt | 32 ++++++++----------- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/core/java/com/android/internal/widget/ConversationLayout.java b/core/java/com/android/internal/widget/ConversationLayout.java index f9aae0fe48be7..49cf3e099c55b 100644 --- a/core/java/com/android/internal/widget/ConversationLayout.java +++ b/core/java/com/android/internal/widget/ConversationLayout.java @@ -133,6 +133,7 @@ public class ConversationLayout extends FrameLayout private boolean mExpandable = true; private int mContentMarginEnd; private Rect mMessagingClipRect; + private TextView mAppName; public ConversationLayout(@NonNull Context context) { super(context); @@ -202,6 +203,7 @@ public class ConversationLayout extends FrameLayout R.string.conversation_title_fallback_one_to_one); mFallbackGroupChatName = getResources().getString( R.string.conversation_title_fallback_group_chat); + mAppName = findViewById(R.id.app_name_text); } @RemotableViewMethod @@ -384,6 +386,7 @@ public class ConversationLayout extends FrameLayout } updateIconPositionAndSize(); updateImageMessages(); + updateAppName(); } private void updateImageMessages() { @@ -462,6 +465,10 @@ public class ConversationLayout extends FrameLayout topView.setImageIcon(secondLastIcon); } + private void updateAppName() { + mAppName.setVisibility(mIsCollapsed ? GONE : VISIBLE); + } + /** * update the icon position and sizing */ diff --git a/core/res/res/layout/notification_template_material_conversation.xml b/core/res/res/layout/notification_template_material_conversation.xml index f79ea6282c619..0c4be1a91a04f 100644 --- a/core/res/res/layout/notification_template_material_conversation.xml +++ b/core/res/res/layout/notification_template_material_conversation.xml @@ -174,6 +174,17 @@ /> + + +