Blankj / AndroidUtilCode

:fire: Android developers should collect the following utils(updating).

Home Page:https://blankj.com/2016/07/31/android-utils-code/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

软键盘收起后又弹出了

Pinggo opened this issue · comments

commented

在业务中使用 showSoftInput(@nonnull final View view),切换键盘代码

            if (!isShowEmojiPanel) {
                KeyboardUtils.hideSoftInput(etMsgSend)
                showEmojiFragment()
            } else {
                KeyboardUtils.showSoftInput(etMsgSend)
                hideEmojiFragment()
            }
            isShowEmojiPanel = !isShowEmojiPanel

有一条路径必现软键盘收起后又弹出,查找是 imm.toggleSoftInput 导致,删除 imm.toggleSoftInput 这个代码后没问题了

同上,如果bottomsheetdialog里有个edittext,弹起键盘后再关闭弹框,键盘又会弹起来。
dismiss里已经做了处理,依然不行