-
Notifications
You must be signed in to change notification settings - Fork 223
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
Replace emoji parser library #1442
base: master
Are you sure you want to change the base?
Conversation
@Fs00 Please give this a try as well. |
Were you following the development of that library too? 😄 Don't forget to update the used libraries in the Readme and in About screen of the app 😉 |
Rebase done.
Good point, thanks. |
emoji-java is unmaintained since 2019, so replace it with a library that receives updates.
I've played a bit with it and the emoji parsing behaves more faithfully to the GitHub website, which is a great plus. I'd suggest checking with the library author if something can be done on their side to improve the situation. |
So far, I just tested on the emulator. I now gave this a try on my phone (Pixel 8), and it looks fine there as well, taking 200ms ... but admittedly the phone is quite a bit faster than Xperia X Compact. Let's see what the author's response to this is: felldo/JEmoji#57 |
@Fs00 What does this diff do to the loading times on your device? diff --git a/app/src/main/java/com/gh4a/Gh4Application.java b/app/src/main/java/com/gh4a/Gh4Application.java
index 1f2738e8..0ab4a27c 100644
--- a/app/src/main/java/com/gh4a/Gh4Application.java
+++ b/app/src/main/java/com/gh4a/Gh4Application.java
@@ -29,6 +29,8 @@ import com.gh4a.worker.NotificationsWorker;
import com.meisolsson.githubsdk.model.User;
import com.tspoon.traceur.Traceur;
·
+import net.fellbaum.jemoji.EmojiManager;
+
import org.ocpsoft.prettytime.PrettyTime;
·
import java.util.HashSet;
@@ -67,6 +69,7 @@ public class Gh4Application extends Application implements
super.onCreate();
·
sInstance = this;
+ new Thread(() -> EmojiManager.getEmoji("")).start();
·
SharedPreferences prefs = getPrefs();
· BTW, API 24 emulator seems quite a bit slower than API 34 emulator, so the issue likely is in the optimization of the static initializer. |
@Fs00 And for another test, please try whether updating to 1.7.1 (instead of the thread approach) helps. |
1.7.1 improves loading times significantly, but not enough not to be noticeable on older devices.
However, replacing the line you suggested above with the following one: new Thread(() -> EmojiManager.replaceAliases("", (p1, p2) -> "")).start(); pretty much prevents freezes to occur even on old devices. This helps even when the app starts directly on a screen that uses |
emoji-java is unmaintained since 2019, so replace it with a library that receives updates.