我正在使用SuperNova-Emoji库。我尝试了许多解决方案来调整表情符号键盘的大小,或者在表情符号键盘显示时隐藏虚拟键盘,但没有任何效果。
这是GitHub中的库链接:
https://github.com/hani-momanii/SuperNova-Emoji
更新1:
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);
}
});
答案 0 :(得分:1)
您可以在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);
}
});