We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How can I determine if an integer represents a legal Emojicon? I'm trying to dynamically add an Emoji key, and then detect it when its pressed.
This is my key addition snippet
private void registerEmoji (Keyboard keyboard, @DrawableRes int emojiRes) { List<Keyboard.Key> keys = keyboard.getKeys(); Keyboard.Row row = new Keyboard.Row(keyboard); Drawable emoji = getResources().getDrawable(emojiRes); Emojicon emojicon = Emojicon.fromResource(emojiRes, 0); Keyboard.Key key = new Keyboard.Key(row); key.codes = new int[]{emojiRes}; key.gap = 10; key.height = emoji.getMinimumWidth(); key.width = emoji.getMinimumWidth(); key.icon = emoji; keys.add(key); }
And here I'm trying to detect it
public void onKey(int primaryCode, int[] keyCodes) { InputConnection ic = getCurrentInputConnection(); playClick(primaryCode); switch (primaryCode) { ... default: { if (isEmoji(primaryCode)) { ... } else { char c = (char) primaryCode; ic.commitText(String.valueOf(Character.isLetter(c) && capsLock ? c : Character.toUpperCase(c)), 1); } } }
How can I implement the isEmoji method?
isEmoji
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How can I determine if an integer represents a legal Emojicon?
I'm trying to dynamically add an Emoji key, and then detect it when its pressed.
This is my key addition snippet
And here I'm trying to detect it
How can I implement the
isEmoji
method?The text was updated successfully, but these errors were encountered: