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

Update to Unicode Emoji v15.1 #583

Merged
merged 1 commit into from
Mar 9, 2024
Merged

Update to Unicode Emoji v15.1 #583

merged 1 commit into from
Mar 9, 2024

Conversation

tmqCypher
Copy link
Contributor

Resolves #572

Copy link
Owner

@Julow Julow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks!

@@ -1,54 +1,62 @@
156
:grinning: 😀 grinning face
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first part was used to name emojis internally and was used when saving the most commonly used emojis. This will make some of the saved emojis disappear.

Though, I don't want to slow this down, instead I'd prefer to improve the way emojis are handled internally.
Here's my idea:

  • The emoji names would be extracted from the previous version of this file and would be saved a new file. This will be used to migrate the saved information.
  • The "last used emojis" feature would save the emojis characters directly and not their names.
  • This file is kept as it is for easier upgrade in the future (or changed to be easier to upgrade) but is no longer embedded in the app. A smaller file is generated at test-time containing the data that should be embedded in the app (the grouped emojis without name and description). This should make the app slightly smaller and faster.
  • The names and descriptions of emojis are otherwise not needed internally and should not be loaded by the app. srcs/juloo.keyboard2/Emoji.java is removed, KeyValue is used instead.
    The emoji descriptions could be added to the app later if they are needed.

What do you think ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching to a more compact emoji implementation should be pretty straightforward. I'll review Unicode's documentation to make sure it's reasonably future proof.

As for the recent emojis, I think it would suffice to hardcode a map from the old names to the characters and remove it at a later date when most users' SharedPreferences have been updated.

Thanks for the insight! It might be a week or two until I can get around to it, but I'll open a new PR when I have something to show.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into it :)

As for the recent emojis, I think it would suffice to hardcode a map from the old names to the characters and remove it at a later date when most users' SharedPreferences have been updated.

Yes!

Copy link
Owner

@Julow Julow Mar 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the old names might be useful data for future features.

My preferred way to build a map in Java is to use a case when the same key is accessed infrequently. Similarly to KeyValue: https://github.com/Julow/Unexpected-Keyboard/blob/master/srcs/juloo.keyboard2/KeyValue.java#L345

@Julow Julow merged commit 8cd868b into Julow:master Mar 9, 2024
4 checks passed
@tmqCypher
Copy link
Contributor Author

Many thanks!

No, thank you! This app and your work on it have been indispensable to me for years now. I'm just happy to finally make a small contribution.

@tmqCypher tmqCypher mentioned this pull request Apr 18, 2024
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.

Missing emojis
2 participants