-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WP Stories integration: add EmojiCompat library for stories emoji support #12045
WP Stories integration: add EmojiCompat library for stories emoji support #12045
Conversation
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
You can test the changes on this Pull Request by downloading the APK here. |
…p-stories-part9-emoji-compat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these changes @mzorz works well! LGTM 🚢
The only thing I noticed here was when I opened the emoji drawer, the background was white but I think that is unrelated to these changes. Here it is below.
Since this project is now on 'Appcompat' version '1.4.2', there is no need for custom emoji support anymore. Using 'Appcompat' version '1.4.0' and above automatically adds support for latest emoji. For more info see: - Use AppCompat to support the latest emoji (Doc): https://developer.android.com/develop/ui/views/text-and-emoji/ emoji2#appcompat This change effectively reverts this PR below: #12045 For more specific on this change see GitHub discussion below: https://github.com/wordpress-mobile/WordPress-Android/issues/ 17565#issuecomment-1403805689
Since this project is now on 'Appcompat' version '1.4.2', there is no need for custom emoji support anymore. Using 'Appcompat' version '1.4.0' and above automatically adds support for latest emoji. For more info see: - Use AppCompat to support the latest emoji (Doc): https://developer.android.com/develop/ui/views/text-and-emoji/ emoji2#appcompat This change effectively reverts this PR below: #12045 For more specifics on this change see GitHub discussion below: https://github.com/wordpress-mobile/WordPress-Android/issues/ 17565#issuecomment-1403805689
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.