Skip to content

Commit 4e45c2c

Browse files
committed
[TextAppearance] Added a TextAppearanceConfig.shouldLoadFontSynchronously() check to allow forcing synchronous font loading for edge cases
PiperOrigin-RevId: 374702022 (cherry picked from commit 9b92fd8)
1 parent d78235f commit 4e45c2c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/java/com/google/android/material/resources/TextAppearance.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ public void updateTextPaintMeasureState(
354354
}
355355

356356
private boolean shouldLoadFontSynchronously(Context context) {
357+
if (TextAppearanceConfig.shouldLoadFontSynchronously()) {
358+
return true;
359+
}
357360
Typeface typeface =
358361
(fontFamilyResourceId != 0)
359362
? ResourcesCompat.getCachedFont(context, fontFamilyResourceId)

0 commit comments

Comments
 (0)