abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/EmojiGridView.java
diff options
context:
space:
mode:
authorJules Aguillon2025-12-13 22:12:36 +0100
committerGitHub2025-12-13 22:12:36 +0100
commit5fc1da0a2e5c05b97d587a9844e578c1f0b76685 (patch)
tree4ef6ed10eb25177fc6ed196436f53507c4b6fce2 /srcs/juloo.keyboard2/EmojiGridView.java
parentf834b2a82a54573d9cc52414fa876dfdab66f718 (diff)
downloadunexpected-keyboard-5fc1da0a2e5c05b97d587a9844e578c1f0b76685.tar.gz
unexpected-keyboard-5fc1da0a2e5c05b97d587a9844e578c1f0b76685.zip
Remove emoji history migration function (#1139)
This function was used to migrate the representation of the emoji history and needed a very large table. This reduces the app size by 22KB.
Diffstat (limited to 'srcs/juloo.keyboard2/EmojiGridView.java')
-rw-r--r--srcs/juloo.keyboard2/EmojiGridView.java32
1 files changed, 0 insertions, 32 deletions
diff --git a/srcs/juloo.keyboard2/EmojiGridView.java b/srcs/juloo.keyboard2/EmojiGridView.java
index db95f1c..3b0939b 100644
--- a/srcs/juloo.keyboard2/EmojiGridView.java
+++ b/srcs/juloo.keyboard2/EmojiGridView.java
@@ -36,7 +36,6 @@ public class EmojiGridView extends GridView
{
super(context, attrs);
Emoji.init(context.getResources());
- migrateOldPrefs(); // TODO: Remove at some point in future
setOnItemClickListener(this);
loadLastUsed();
setEmojiGroup((_lastUsed.size() == 0) ? 0 : GROUP_LAST_USE);
@@ -110,37 +109,6 @@ public class EmojiGridView extends GridView
return getContext().getSharedPreferences("emoji_last_use", Context.MODE_PRIVATE);
}
- private void migrateOldPrefs()
- {
- final String MIGRATION_CHECK_KEY = "MIGRATION_COMPLETE";
-
- SharedPreferences prefs;
- try { prefs = emojiSharedPreferences(); }
- catch (Exception e) { return; }
-
- Set<String> lastUsed = prefs.getStringSet(LAST_USE_PREF, null);
- if (lastUsed != null && !prefs.getBoolean(MIGRATION_CHECK_KEY, false))
- {
- SharedPreferences.Editor edit = prefs.edit();
- edit.clear();
-
- Set<String> lastUsedNew = new HashSet<>();
- for (String entry : lastUsed)
- {
- String[] data = entry.split("-", 2);
- try
- {
- lastUsedNew.add(Integer.parseInt(data[0]) + "-" + Emoji.mapOldNameToValue(data[1]));
- }
- catch (IllegalArgumentException ignored) {}
- }
- edit.putStringSet(LAST_USE_PREF, lastUsedNew);
-
- edit.putBoolean(MIGRATION_CHECK_KEY, true);
- edit.apply();
- }
- }
-
static class EmojiView extends TextView
{
public EmojiView(Context context)