From 5fc1da0a2e5c05b97d587a9844e578c1f0b76685 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 13 Dec 2025 22:12:36 +0100 Subject: 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.--- srcs/juloo.keyboard2/EmojiGridView.java | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'srcs/juloo.keyboard2/EmojiGridView.java') 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 lastUsed = prefs.getStringSet(LAST_USE_PREF, null); - if (lastUsed != null && !prefs.getBoolean(MIGRATION_CHECK_KEY, false)) - { - SharedPreferences.Editor edit = prefs.edit(); - edit.clear(); - - Set 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) -- cgit v1.2.3