Skip to content

Commit

Permalink
[TextAppearance] Added a TextAppearanceConfig.shouldLoadFontSynchrono…
Browse files Browse the repository at this point in the history
…usly() check to allow forcing synchronous font loading for edge cases

PiperOrigin-RevId: 374702022
(cherry picked from commit 9b92fd8)
  • Loading branch information
dsn5ft committed Jun 2, 2021
1 parent d78235f commit 4e45c2c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ public void updateTextPaintMeasureState(
}

private boolean shouldLoadFontSynchronously(Context context) {
if (TextAppearanceConfig.shouldLoadFontSynchronously()) {
return true;
}
Typeface typeface =
(fontFamilyResourceId != 0)
? ResourcesCompat.getCachedFont(context, fontFamilyResourceId)
Expand Down

0 comments on commit 4e45c2c

Please sign in to comment.