Prevent EmojiTextView measurement oscillation on size changes.

This commit is contained in:
Alex Hart
2026-02-25 16:27:57 -04:00
committed by Cody Henthorne
parent 3a62ad67e1
commit a8fb5f2598

View File

@@ -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();
}