Skip to content

Commit 48ddc98

Browse files
committed
fix #4
1 parent 52019ed commit 48ddc98

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

android/chatinput/src/main/java/cn/jiguang/imui/chatinput/ChatInputView.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ void switchVoiceOrInput() {
427427
}
428428
showInputMethod();
429429
}
430-
dismissMenuLayout();
430+
dismissMenuLayout(100);
431431
}
432432

433433
private void hideInputMethod() {
@@ -455,18 +455,14 @@ public void setSoftInput(boolean resize) {
455455

456456
public void dismissMenuAndResetSoftMode() {
457457
mWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN
458-
| WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
458+
| WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
459459
// try {
460460
// Thread.sleep(140);
461461
// } catch (InterruptedException e) {
462462
// e.printStackTrace();
463463
// }
464-
postDelayed(new Runnable() {
465-
@Override
466-
public void run() {
467-
dismissMenuLayout();
468-
}
469-
}, 100);
464+
465+
dismissMenuLayout(1);
470466
showInputMethod();
471467

472468
mChatInput.requestFocus();
@@ -488,8 +484,14 @@ public void dismissSoftInputAndShowMenu() {
488484
mShowSoftInput = false;
489485
}
490486

491-
public void dismissMenuLayout() {
492-
mMenuContainer.setVisibility(INVISIBLE);
487+
public void dismissMenuLayout(int t) {
488+
postDelayed(new Runnable() {
489+
@Override
490+
public void run() {
491+
mMenuContainer.setVisibility(INVISIBLE);
492+
}
493+
}, t);
494+
493495
if (showType == 1) {
494496
showType = 0;
495497
mEmojiBtn.setImageResource(R.drawable.nim_message_button_bottom_emoji_selector);

android/src/main/java/cn/jiguang/imui/messagelist/ReactChatInputManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public void setMenuContainerHeight(ChatInputView chatInputView, int height) {
277277
public void dismissMenuContainer(ChatInputView chatInputView, boolean isDismiss) {
278278
Log.w(TAG, "dismissMenuContainer: " + isDismiss);
279279
if (isDismiss) {
280-
chatInputView.dismissMenuLayout();
280+
chatInputView.dismissMenuLayout(1);
281281
}
282282
}
283283

0 commit comments

Comments
 (0)