I've implemented a softkeyboard for android with a built in emoji keyboard.
my problem is with the backspace button , when i delete a char it's ok but when i delete an emoji it doesn't do it well. code:
final EmojiconsPopup popup = new EmojiconsPopup(kv.getRootView(), this);
popup.setSizeForSoftKeyboard();
popup.setOnEmojiconBackspaceClickedListener(new EmojiconsPopup.OnEmojiconBackspaceClickedListener() {
@Override
public void onEmojiconBackspaceClicked(View v) {
InputConnection ic = getCurrentInputConnection();
ic.deleteSurroundingText(1, 0);
}
});
If i change the line to
ic.deleteSurroundingText(2, 0);
The emojis are deleted well , but the chars will be deleted two at a time .
Any ideas on how to solve this issue ?
Update
after a little more investigating , i found out some emojis are one char (like a regular letter) and some two chars , Any ideas on how to differ between them ?