简体   繁体   中英

Resize the keyboard or hide the virtual keyboard when the emoji keyboard shows

I am using the SuperNova-Emoji library. I tried many solutions to resize the Emoji keyboard or hide the virtual keyboard when the emoji keyboard shows, but nothing has worked.

键盘表情符号

This is the library link in GitHub:
https://github.com/hani-momanii/SuperNova-Emoji

UPDATE 1 :

this is my code ; and the probleme now is a infinie loop ; the keyboard show and hide all time , no stope

SendMessageBox = (EmojiconEditText)findViewById(R.id.txtSendMsg);
    emojiIcon = (ImageView)findViewById(R.id.btn_icon);
    SendMessageButton = (Button)findViewById(R.id.btnSendMsg);
    rootView = (RelativeLayout)findViewById(R.id.layoutbackgrounde);
    EmojIconActions emojiAction = new EmojIconActions(getApplicationContext(),rootView,emojiIcon,SendMessageBox);
    emojiAction.ShowEmojicon();

    emojiAction.setKeyboardListener(new EmojIconActions.KeyboardListener() {
        @Override
        public void onKeyboardOpen() {
            Log.e("Keyboard","open");
            InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(rootView.getWindowToken(), 0);
        }

        @Override
        public void onKeyboardClose() {
            Log.e("Keyboard","close");
            //maybe re-appear the input keyboard if you have to on emojikeyboardclose
            //InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            //imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
        }
    });

You could hide the original keyboard on emojikeyboardopen:

emojIcon.setKeyboardListener(new EmojIconActions.KeyboardListener() {
    @Override
    public void onKeyboardOpen() {
        Log.e("Keyboard","open");
        InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
    }

    @Override
    public void onKeyboardClose() {
        Log.e("Keyboard","close");
        //maybe re-appear the input keyboard if you have to on emojikeyboardclose
        //InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        //imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
    }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM