WP Stories integration: add EmojiCompat library for stories emoji support #12045
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR builds on top of #12031
This PR implements the EmojiCompat library for support of emoji in the Stories library.
What / Why / How
This PR implements
EmojiCompat
so to be able to have emojis on devices that may not have support for them on their installed Fonts.This PR uses the latest
EmojiCompat
library which is supposed to encapsulate the problems we'd otherwise need to tackle separately (downloading the fonts, then using them).Resources:
androidx
package now, but the core mechanism still is the same) https://developer.android.com/guide/topics/ui/look-and-feel/emoji-compat#using-widgets-with-appcompatBasically followed the sample app https://github.com/googlesamples/android-EmojiCompat and implemented the core parts here.
On downloadable fonts
For more information on how downloadable fonts work, read here and here (see the part titled "Download fonts as XML resources") and then this article by Google's font engineering lead
(tl;dr: it can all be done through XML for the platform to perform automatically on first app run, and Android Studio sets up everything for you, as done with the EmojiCompat library in particular).
Notes:
FontRequest
are borrowed from Google's EmojiCompat sample app, I haven't found anywhere in the docs that these should (or should not) be the ones to be used, but judging from the package names it looks like these certs should correspond to Google's, as this is how the call looks like:
Also, if you add a reference to EmojiCompat these are indeed the same ones that Android Studio adds to your project. - the requested Font is as per the sample app `Noto Color Emoji Compat`, the information on which can be found here: https://www.google.com/get/noto/help/emoji/To test:
PR submission checklist:
RELEASE-NOTES.txt
if necessary.