From d1eab086f17fe7a1d4cbd2768b8f7b465fce5d72 Mon Sep 17 00:00:00 2001 From: Rashad Sookram Date: Mon, 3 Jan 2022 10:14:02 -0500 Subject: [PATCH] Constrain ConversationItem's width to AudioView. When text was also shown, the text's width was used when it was wider than the AudioView. --- .../securesms/conversation/ConversationItem.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java index a1635bffc1..2269cee0c9 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationItem.java @@ -468,6 +468,12 @@ public final class ConversationItem extends RelativeLayout implements BindableCo activeFooter.getLayoutParams().width = availableWidth; needsMeasure = true; } + + int desiredWidth = audioViewStub.get().getMeasuredWidth() + ViewUtil.getLeftMargin(audioViewStub.get()) + ViewUtil.getRightMargin(audioViewStub.get()); + if (bodyBubble.getMeasuredWidth() != desiredWidth) { + bodyBubble.getLayoutParams().width = desiredWidth; + needsMeasure = true; + } } if (needsMeasure) {