From a8fb5f2598c24445e837b9e9975a33b200ce8c23 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Wed, 25 Feb 2026 16:27:57 -0400 Subject: [PATCH] Prevent EmojiTextView measurement oscillation on size changes. --- .../securesms/components/emoji/EmojiTextView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiTextView.java b/app/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiTextView.java index 74a1c42f5e..af8c7fb00d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiTextView.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiTextView.java @@ -264,6 +264,8 @@ public class EmojiTextView extends AppCompatTextView { previousOverflowText = overflowText; useSystemEmoji = useSystemEmoji(); previousTransformationMethod = getTransformationMethod(); + lastSizeChangedWidth = -1; + lastSizeChangedHeight = -1; // Android fails to ellipsize spannable strings. (https://issuetracker.google.com/issues/36991688) // We ellipsize them ourselves by manually truncating the appropriate section. @@ -590,7 +592,7 @@ public class EmojiTextView extends AppCompatTextView { lastSizeChangedWidth = w; lastSizeChangedHeight = h; - if (!sizeChangeInProgress) { + if (!sizeChangeInProgress && getMaxLines() > 0 && getMaxLines() < Integer.MAX_VALUE) { sizeChangeInProgress = true; resetText(); }