-
Notifications
You must be signed in to change notification settings - Fork 31
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
refactor(neon_framework): Implement a custom emoji picker #2623
refactor(neon_framework): Implement a custom emoji picker #2623
Conversation
4095aa3
to
6c8177f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2623 +/- ##
=======================================
Coverage 28.90% 28.90%
=======================================
Files 371 372 +1
Lines 136623 136624 +1
=======================================
+ Hits 39491 39492 +1
Misses 97132 97132
*This pull request uses carry forward flags. Click here to find out more.
|
Really cool. I didn't take a look at the specific code yet but I have a few ideas:
I'll take a deeper look at thw UI part later |
I thought about this as well, but right now the code is still quite simple.
For what? I don't understand where you would want to use it. |
I assume that the emoji category names are currently hand translated.
Once we have translations and search strings for all emojis/languages the app size might increase quite significantly. Even if you we keep it in the neon_framework package, I'd like to have this separation. |
Yes
It contains translations for all the symbols, but not for the category names as they are not unicode symbols themselves.
Don't forget it's all just string data. I just did a size analysis of the APK and emojis.dart is 0.1KB and the NeonEmojiPickerDialog is 39.5KB. |
We might want to ship and use an Emoji font like https://github.com/googlefonts/noto-emoji directly, to ensure all platforms render them correctly (e.g. different Android versions support different Unicode standards) and the same way. |
I don't know if it is worth the apk size bump. It's supported since android 11 (~80% of active devices). |
Ah nice I didn't know about that. Unfortunately it says this:
And my guess would be that it won't work on devices without Google Play services (I would have to test it though). Reading through the page I'm not sure if it is also going to work with flutter, given that it doesn't use the native font rendering. I guess we just need to give it a try to see if it works (also see flutter/flutter#16660). |
Hm yeah it's 10.2 MB, that is 1/3 of our current APK size and it doesn't give us that much benefits except for less broken emojis. Maybe the better way to deal with this is to dynamically decide at runtime which emojis to keep, so checking the Android API level and then deciding which Unicode version we can assume to be available. |
We could also use https://pub.dev/packages/google_fonts and have the emoji font downloaded at runtime, but there we run into other issues again as we have to explicitly use the font everywhere (see material-foundation/flutter-packages#155) |
Found the CLDR data for the emoji groups: https://github.com/unicode-org/cldr-json/blob/main/cldr-json/cldr-misc-full/main/de/characterLabels.json. |
6c8177f
to
6919ea6
Compare
6919ea6
to
203b249
Compare
Signed-off-by: provokateurin <[email protected]>
Signed-off-by: provokateurin <[email protected]>
Signed-off-by: provokateurin <[email protected]>
203b249
to
8317e47
Compare
Fixes #2499
I thought implementing a custom emoji picker would be hard because all the existing packages suck and are unmaintained, but it turned out it was quite simple in the end.
Because the available emojis are generated from the metadata they are also more complete than what we had before, because the package was manually adding them to a list.
This picker does not support alternates (e.g. skin tones) yet, but it can be added easily.
It also does not save any recently used emojis, but we can add that as well.
Due to having all the metadata available we can now also add shortcode (e.g.
:smile:
) completion for text inputs (e.g. Talk message input) which is pretty neat.For some reason the Tabbar renders a bit weird on Android and I believe it might be connected to flutter/flutter#119623 as I was seeing that issue as well. On Linux it renders perfectly and the emojis are centered as well 🤷♀️