Use HYPHENATION_FREQUENCY_FULL_FAST

Usage BREAK_STRATEGY_HIGH_QUALITY and HYPHENATION_FREQUENCY_FULL penaltised 2.5 times in Text calculations.
HYPHENATION_FREQUENCY_FULL should resolve bad performance.

TLDR; a combination of {highQuality, Balanced}x{HyhpnationNormal, HyphnationFull}  causes a bad performance on Text.

Bug: 269125657
Test: Code Review & checking stacktrace.
Change-Id: I07be68508145b87598ad2408e697e1f6c6edfd8f
This commit is contained in:
Ibrahim Yilmaz
2023-05-24 09:09:37 +00:00
parent 7cfd239b42
commit 636c5cbdab

View File

@@ -82,7 +82,7 @@ public class ImageFloatingTextView extends TextView {
.setIncludePad(getIncludeFontPadding())
.setUseLineSpacingFromFallbacks(true)
.setBreakStrategy(Layout.BREAK_STRATEGY_HIGH_QUALITY)
.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL_FAST);
int maxLines;
if (mMaxLinesForHeight > 0) {
maxLines = mMaxLinesForHeight;