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

Use system emoji uniformly accross app when system emoji option is enabled #13327

Closed
wants to merge 2 commits into from

Conversation

danbrun
Copy link
Contributor

@danbrun danbrun commented Dec 21, 2023

First time contributor checklist

Contributor checklist

  • Pixel 8 Pro running Android 14
  • Emulator running Android 10
  • Emulator running Android 5.0
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

Hi! I'm a long time Signal user and fan! However, there is one thing that has bugged me about the app, and that's the inconsistency of emoji when using the system emoji option. I've found some others have the same sentiment on the forum and in Github issues.

The comments from the Signal team I've seen didn't specify what the blocking technical issues were so I took a look at the code base and found this solution. I created an alternate drawable that leverages StaticLayout and the EmojiCompat library to draw the system emoji directly, and have the emoji provider return these drawables when the system emoji option is enabled. This should behave consistently with emoji in TextViews because AppCompat uses EmojiCompat under the hood to render glyphs with the system font where possible, while falling back to a font provided by Google Play Services for missing glyphs.

I tested this on my Pixel 8 Pro as well as on an Android 10 emulator and an Android 5.0 emulator (to demonstrate that EmojiCompat works and cover the SDK_INT check around the StaticLayout constructor). One thing to note when testing on an emulator is that there seems to be a known issue with EmojiCompat not pulling the fallback font on emulators, so to test those I used the EmojiCompat bundled configuration in my use-system-emoji-bundled branch. Below are some screenshots of the reactions picker to show the emojis working across Android versions and demonstrate that the EmojiCompat fallback works so outdated Android devices will not be missing any glyphs.

Android 14
Android 10 with EmojiCompat
Android 10 without EmojiCompat
Android 5 with EmojiCompat
Android 5 without EmojiCompat

Thanks for your consideration!

@farewelltospring
Copy link

I like this PR a lot. Can you add a screenshot of a message with an emoji reaction on Android 5? I have no ability to merge it in but I am just curious how it looks. :)

@danbrun
Copy link
Contributor Author

danbrun commented Jan 9, 2024

I like this PR a lot. Can you add a screenshot of a message with an emoji reaction on Android 5? I have no ability to merge it in but I am just curious how it looks. :)

Sure thing! Here is a screenshot of Android 5 reactions on messages

Copy link

stale bot commented Jun 14, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 14, 2024
@danbrun
Copy link
Contributor Author

danbrun commented Jun 14, 2024

Please keep this open, I'd still like to merge this if possible!

@farewelltospring
Copy link

I hope to see this merged too :)

@greyson-signal
Copy link
Contributor

Hi there! So sorry for not seeing this PR earlier, that is one benefit of the stale bot :) Thank you so much for building this! This is great and super clever. One of my favorite public PR's I've seen, where it fixes a long-running issue with very little code :) The plan is for this to go out in 7.10 unless we run into any unforeseen issues, but everything seems to be working for me! Thanks again!

@danbrun
Copy link
Contributor Author

danbrun commented Jun 18, 2024

That's awesome, I'm super excited to see this land, thank you for reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants