From f43db8ace00a3be7f11dc50c12ac6f0432a6dc5d Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Mon, 18 May 2026 11:37:53 -0400 Subject: [PATCH] Fix chat bubbles not rendering due to ConstraintLayout bug. Resolves signalapp/Signal-Android#14774 --- .../securesms/conversation/v2/ConversationFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt index 36da02c4d1..46291b0498 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationFragment.kt @@ -761,11 +761,14 @@ class ConversationFragment : split.second } - binding.conversationItemRecycler.addOnLayoutChangeListener { v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom -> + binding.conversationItemRecycler.addOnLayoutChangeListener { _, left, top, right, bottom, _, _, _, _ -> viewModel.onChatBoundsChanged(Rect(left, top, right, bottom)) } binding.toolbar.addOnLayoutChangeListener { _, _, _, _, bottom, _, _, _, oldBottom -> + // Bug: ConstraintLayout's solver can transiently place the toolbar at a negative position during the very first layout, preventing future RV layouts + if (bottom < 0) return@addOnLayoutChangeListener + binding.conversationItemRecycler.padding(top = bottom) if (bottom != oldBottom && ::conversationHeaderPositionDecoration.isInitialized) { val newMargin = bottom + 16.dp