You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Older Android devices are missing newer Unicode emoji; they just show up as empty squares. I'm mostly sure this is the same issue as #3181, but that one is mostly screenshots, and I'd like to start fresh with some (hopefully clear) steps to a solution at the top.
To use the Android EmojiCompat library would be the best solution if React Native supported it. Without support, we'd be left to do a lot of imperative string processing to get it to work, and probably make our own wrapper of Android's native TextView component, and we'd get in the way of the React Native layer by doing this. See the React Native feature request here.
So, without that, we can ask the app to use an emoji font of our choosing for all of its Unicode emoji. We considered using it as a fallback font, just to fill in what's missing, but the inconsistency in style between the system font and the new font would be jarring, so it's preferable to use the new font for all Unicode emojis. We'd like to try using the Noto Color Emoji font, as mentioned by @raphlinus (thanks Raph!) in the RC realm (link accessible only to users in that realm). Since it's a large font (around 9 MB), we'd like to load it dynamically instead of shipping it with the app.
We've found a way to do that, which should work with compatibility back to Android API version 14, inclusive, using Downloadable Fonts.
We can then change the CSS in the MessageList WebView to use the font. Since it's an emoji font, we expect that it only has glyphs for emojis themselves, and that regular text will still be rendered with the system font. (@WesleyAC)
And we can style the React Native components that use emoji (the emoji picker and reactions list, possibly others) to also use the font.
Then: 🪀🧱🦙🦞🪗!
The text was updated successfully, but these errors were encountered:
chrisbobbe
changed the title
Solution found: Android Unicode emoji not up-to-date on older devices
Solution found: Newer Unicode emojis don't render on older Android devices
Feb 7, 2020
Older Android devices are missing newer Unicode emoji; they just show up as empty squares. I'm mostly sure this is the same issue as #3181, but that one is mostly screenshots, and I'd like to start fresh with some (hopefully clear) steps to a solution at the top.
To use the Android EmojiCompat library would be the best solution if React Native supported it. Without support, we'd be left to do a lot of imperative string processing to get it to work, and probably make our own wrapper of Android's native TextView component, and we'd get in the way of the React Native layer by doing this. See the React Native feature request here.
So, without that, we can ask the app to use an emoji font of our choosing for all of its Unicode emoji. We considered using it as a fallback font, just to fill in what's missing, but the inconsistency in style between the system font and the new font would be jarring, so it's preferable to use the new font for all Unicode emojis. We'd like to try using the Noto Color Emoji font, as mentioned by @raphlinus (thanks Raph!) in the RC realm (link accessible only to users in that realm). Since it's a large font (around 9 MB), we'd like to load it dynamically instead of shipping it with the app.
We've found a way to do that, which should work with compatibility back to Android API version 14, inclusive, using Downloadable Fonts.
We don't see documentation in React Native about its support for Downloadable Fonts, so I'll refer directly to the commit (facebook/react-native@fd6386a on PR facebook/react-native#24595) that introduced it, included in React Native versions 0.60.0 and above. (This is a second attempt; the history shows a first attempt in facebook/react-native@f01c4e2 on PR facebook/react-native#23865, but that was reverted in facebook/react-native@eb40b09.)
So, let's try:
2.a. It shows that we need the Android Support Library 26; we don't have to do anything here because we're using 28.
2.b. We can optionally pre-declare the font in the manifest to mitigate delays in the initial load of the font.
ReactFontManager.getInstance().addCustomFont(this, "NotoColorEmoji", R.font.NotoColorEmoji);
inpublic void onCreate
in /android/app/src/main/java/com/zulipmobile/MainApplication.java.Then: 🪀🧱🦙🦞🪗!
The text was updated successfully, but these errors were encountered: