From ab987c776c7ddc0fab594f20f4ddf49d98848ccd Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Fri, 24 Jun 2022 20:26:27 +0200 Subject: Fix localized key not in predefined position The "loc " prefix for predefining a place for an "extra key" was broken since 31d6a70. The FLAG_LOCALIZED flag cannot be used anymore, as adding it to any key would turn it into a different key that wouldn't be recognized by parts of the code comparing the keys (placing the extra keys). Add an other layer in KeyboardData to store such informations. --- srcs/juloo.keyboard2/EmojiKeyButton.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'srcs/juloo.keyboard2/EmojiKeyButton.java') diff --git a/srcs/juloo.keyboard2/EmojiKeyButton.java b/srcs/juloo.keyboard2/EmojiKeyButton.java index d551ac5..7fd3583 100644 --- a/srcs/juloo.keyboard2/EmojiKeyButton.java +++ b/srcs/juloo.keyboard2/EmojiKeyButton.java @@ -14,7 +14,8 @@ public class EmojiKeyButton extends Button { super(context, attrs); setOnClickListener(this); - _key = KeyValue.getKeyByName(attrs.getAttributeValue(null, "key")); + String key_name = attrs.getAttributeValue(null, "key"); + _key = (key_name == null) ? null : KeyValue.getKeyByName(key_name); setText(_key.getString()); if (_key.hasFlags(KeyValue.FLAG_KEY_FONT)) setTypeface(Theme.getSpecialKeyFont(context)); -- cgit v1.2.3