From 5572657366ff5e624d3ecd5a7ca4e1d087019aaf Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Wed, 2 May 2018 17:22:20 -0700 Subject: [PATCH] Fixes a visual issue with the Messaging Layout A messaging group would still look visible if all of its children were hidden, which is incorrect. We instead regard it as measured too small. Test: add message notification with smart reply, click on smart reply Change-Id: If5174f95038bf16022d935fd05f337969984f0c2 Fixes: 78214933 --- .../java/com/android/internal/widget/MessagingGroup.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/java/com/android/internal/widget/MessagingGroup.java b/core/java/com/android/internal/widget/MessagingGroup.java index 4104b6ca9d2a7..15b2718bea421 100644 --- a/core/java/com/android/internal/widget/MessagingGroup.java +++ b/core/java/com/android/internal/widget/MessagingGroup.java @@ -276,9 +276,16 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou boolean hasNormal = false; for (int i = mMessageContainer.getChildCount() - 1; i >= 0; i--) { View child = mMessageContainer.getChildAt(i); + if (child.getVisibility() == GONE) { + continue; + } if (child instanceof MessagingLinearLayout.MessagingChild) { int type = ((MessagingLinearLayout.MessagingChild) child).getMeasuredType(); - if (type == MEASURED_TOO_SMALL) { + boolean tooSmall = type == MEASURED_TOO_SMALL; + final MessagingLinearLayout.LayoutParams lp = + (MessagingLinearLayout.LayoutParams) child.getLayoutParams(); + tooSmall |= lp.hide; + if (tooSmall) { if (hasNormal) { return MEASURED_SHORTENED; } else {