-
Notifications
You must be signed in to change notification settings - Fork 41
Bugfix: Font Family resolving in Release Builds #57
Bugfix: Font Family resolving in Release Builds #57
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
43f2e86
to
313887b
Compare
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
Thanks for the contribution! In addition to the sample, would it be possible to also add a font family to resources used by cc @chrisbanes as this might need to also be done in Accompanist AppCompat Theme Adapter |
lib/src/main/java/com/google/android/material/composethemeadapter/TypedArrayUtils.kt
Show resolved
Hide resolved
@ricknout Good point to actually test the XML font family parsing aswell. I adjusted the existing tests accordingly. |
Issue
MdcTheme
does not pick up a font family which is specified in the Android Resource XML when using therelease
build type of the App.MdcTheme
expects the font file path in the APK to beres/font*<filename>
. Optimizations to the App APK inrelease
build types changes them to beres/[A-Z]{2}.<fileending>
.As the font family does not gets recognized in this situation the theme uses the current font family of
MaterialTheme
.Fix
This PR changes the exptected APK font file path to
res/*<filename>
.How to Test
The issue can be reproduced when building the sample app with the
release
build type from commit ba80854 . The Headline 3 does not get styled with Dancing Script as font family here.Building the sample app with the
release
build type from the PR head commit will style the headline 3 with the Dancing Script font family.