Skip to content
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

Conversation

mzorz
Copy link
Contributor

@mzorz mzorz commented May 28, 2020

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:

Basically 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:

  • the certificates used for 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:

Screen Shot 2019-08-23 at 08 40 03

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:

  1. tap on the FAB button on the Me screen, then tap on Story option on the bottom sheet
  2. capture a photo
  3. tap on the stickers button, to the left of the text button
  4. observe the bottom sheet with emoji appears
  5. tap on one
  6. observe it gets added

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@mzorz mzorz added this to the 15.2 milestone May 28, 2020
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 28, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@mzorz mzorz requested a review from jd-alexander May 28, 2020 15:04
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 28, 2020

You can test the changes on this Pull Request by downloading the APK here.

Copy link
Contributor

@jd-alexander jd-alexander left a 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.

@jd-alexander jd-alexander merged commit 6e4d800 into feature/wp-stories-part8-upload-service Jun 19, 2020
@jd-alexander jd-alexander deleted the feature/wp-stories-part9-emoji-compat branch June 19, 2020 23:10
ParaskP7 added a commit that referenced this pull request Jan 26, 2023
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
ParaskP7 added a commit that referenced this pull request Jan 26, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants