Fix re-measure of text

Summary: This diff fixes re-measures of a text component result of a change of state. For details of the bug see: T36838266

Reviewed By: shergin

Differential Revision: D13188601

fbshipit-source-id: ea9a889540f600d4e4e788105d5fa22e6cd5448c
This commit is contained in:
David Vacca 2018-11-25 17:18:12 -08:00 committed by Facebook Github Bot
parent eec9e4a2f9
commit 5be17c01a1
1 changed files with 1 additions and 5 deletions

View File

@ -204,16 +204,12 @@ public class TextLayoutManager {
TextPaint textPaint = sTextPaintInstance;
Layout layout;
Spannable preparedSpannableText = view == null ? null : view.getSpanned();
Spannable preparedSpannableText = spannedFromTextFragments(context, attributedString.getArray("fragments"), attributedString.getString("string"));
// TODO add these props to paragraph attributes
int textBreakStrategy = Layout.BREAK_STRATEGY_HIGH_QUALITY;
boolean includeFontPadding = true;
if (preparedSpannableText == null) {
preparedSpannableText = spannedFromTextFragments(context, attributedString.getArray("fragments"), attributedString.getString("string"));
}
if (preparedSpannableText == null) {
throw new IllegalStateException("Spannable element has not been prepared in onBeforeLayout");
}