简体   繁体   English

当表情符号键盘显示时,调整键盘大小或隐藏虚拟键盘

[英]Resize the keyboard or hide the virtual keyboard when the emoji keyboard shows

I am using the SuperNova-Emoji library. 我正在使用SuperNova-Emoji库。 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: 这是GitHub中的库链接:
https://github.com/hani-momanii/SuperNova-Emoji https://github.com/hani-momanii/SuperNova-Emoji

UPDATE 1 : 更新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: 您可以在emojikeyboardboardopen上隐藏原始键盘:

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);
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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