android / user-interface-samples

Multiple samples showing the best practices in the user interface on Android.
Apache License 2.0
4.41k stars 1.64k forks source link

"preloaded_fonts" are not actually preloaded #12

Open florianwalther-private opened 5 years ago

florianwalther-private commented 5 years ago
  1. Create 2 activities, set a downloadable font on a TextView in Activity2
  2. Android Studio adds this font to the "preloaded_fonts" file
  3. With active network connection, open the app, but don't open Activity2
  4. Put phone into airplane mode
  5. Open Activity2 -> custom font is not there

The font is visible only if I open Activity2 with an active network connection. I was under the impression that preloaded fonts are loaded on app startup, so why is the font not there in the first scenario?

florianwalther-private commented 5 years ago

Are preloaded fonts only loaded from the offline cache?

kaushalyap commented 5 years ago

@FlorianWalther I would suggest opening an issue in the issuetracker.

florianwalther-private commented 5 years ago

I did that 2 weeks ago, but no reaction yet

kaushalyap commented 5 years ago

@FlorianWalther IMHO best way to get attention is making a tweet with some tagging.

florianwalther-private commented 5 years ago

I actually did that, I also contacted them by other means including email, but no reaction.

kaushalyap commented 5 years ago

@FlorianWalther I actually downloaded sample repo and migrated to AndroidX. It does work fine

florianwalther-private commented 5 years ago

This means all fonts from the preloaded_fonts list were loaded and cached on app start? Did you test it by putting the device offline? What exactly do you mean by "it worked fine"? Which behavior did you get exactly?

kaushalyap commented 5 years ago

in app you can request a font, and then app updated a text view to use the fetched font. If you have fetched that particular font previously it will be available to the app for offline use. This worked for me, even tried offline.

But actually sample app have font called Lobster Two which is in pre_loaded list, I tried to use it offline, it's not pre loaded. So I think Its not the expected behavior.

But work around to execute requestDownload on app startup with pre loaded font names