Fixed an issue where the bubble badge was visible independent of the icon
Bug: 150905003
Test: add messaging notification in a group, observe no icon backgrounds
Change-Id: Id06f1a261223f1a5cc67c9657a17c73844aba55c
diff --git a/core/java/com/android/internal/widget/ConversationLayout.java b/core/java/com/android/internal/widget/ConversationLayout.java
index 545c8a6..b38092d 100644
--- a/core/java/com/android/internal/widget/ConversationLayout.java
+++ b/core/java/com/android/internal/widget/ConversationLayout.java
@@ -113,7 +113,7 @@
private int mBadgedSideMargins;
private int mIconSizeBadged;
private int mIconSizeCentered;
- private View mIcon;
+ private CachingIconView mIcon;
private int mExpandedGroupTopMargin;
private int mExpandButtonExpandedSize;
@@ -153,6 +153,11 @@
mConversationIcon = findViewById(R.id.conversation_icon);
mIcon = findViewById(R.id.icon);
mConversationIconBadge = findViewById(R.id.conversation_icon_badge);
+ mIcon.setOnVisibilityChangedListener((visibility) -> {
+ // Always keep the badge visibility in sync with the icon. This is necessary in cases
+ // Where the icon is being hidden externally like in group children.
+ mConversationIconBadge.setVisibility(visibility);
+ });
mHeaderText = findViewById(R.id.header_text);
mExpandButtonContainer = findViewById(R.id.expand_button_container);
mExpandButtonAndContentContainer = findViewById(R.id.expand_button_and_content_container);