hani-momanii/SuperNova-Emoji

Emojis showing first, instead of keyboard when calling ShowEmjoIcon

daerimin opened this issue · 2 comments

Thanks for building this lib - I really like it, it works and was easy to implement.

My only issue is that users must turn off emojis initially to use the keyboard, instead of the regular keyboard showing up first. Is there a way around this?

Thanks

You can call closeEmojIcon() any time u want to close the emojis. And you can also set KeyBoard Listener to mange what happen when the keyboard open or close,

I think this may work with you:

emojIcon.setKeyboardListener(new EmojIconActions.KeyboardListener() {
@Override
public void onKeyboardOpen() {
    Log.e("Keyboard","open");
    emojIcon.closeEmojIcon();
  }

@Override
public void onKeyboardClose() {
  Log.e("Keyboard","close");
}
});

I had the same problem, unfortunately the suggested fix didn't work for me.

The way I fixed it for me was to call the ShowEmojIcon() method in an onTouchListener on my ImageView (in the example app that would be emojiButton) as follows.

emojiButton.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View view, MotionEvent motionEvent) {
        // Open and show the SuperNova-Emoji keyboard.
        emojIcon.ShowEmojIcon();
        return false;
    }
});

I used onTouch as the EmojIconEditText has focus so any onClickListener on the emojiButton would need to be clicked twice to fire as it needs focus first.

Hope this helps