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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danbrun
Copy link

@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
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

@danbrun danbrun force-pushed the use-system-emoji branch 2 times, most recently from 03166a8 to 5cbbabb Compare January 29, 2024 07:51
@danbrun danbrun force-pushed the use-system-emoji branch 2 times, most recently from 4c85b31 to 8a36eeb Compare February 21, 2024 06:46
@danbrun danbrun force-pushed the use-system-emoji branch 2 times, most recently from 8631e8c to 94a330d Compare April 1, 2024 02:48
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

2 participants