From 8aefa10ef84a6024aa85cf1e29b3dfc6cdbc62ae Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 10 Oct 2022 18:03:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/manager/IMLoginManager.java | 2 +- .../com/yunbao/live/adapter/LiveChatAdapter.java | 12 +++++++----- .../yunbao/live/dialog/LiveInputDialogFragment.java | 8 +++++++- live/src/main/res/layout/view_live_room.xml | 3 ++- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index 62a343db3..ef6fc179c 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -54,7 +54,7 @@ public class IMLoginManager extends BaseCacheManager { * @return */ public boolean isSlide() { - return getBoolean(IS_SLIDE, false); + return getBoolean(IS_SLIDE, true); } /** diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java index ac1402fa3..49161eb03 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -387,12 +387,14 @@ public class LiveChatAdapter extends RecyclerView.Adapter { } else { Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.NEW_MESSAGE_REMINDER)); + + if (bean.getAtUserID()!=null&&bean.getAtUserID().contains(String.valueOf(model.getId()))) { + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.AT_MESSAGE)); + mPosition = size + 1; + } } - if (bean.getAtUserID()!=null&&bean.getAtUserID().contains(String.valueOf(model.getId()))) { - Bus.get().post(new LiveAudienceEvent() - .setType(LiveAudienceEvent.LiveAudienceType.AT_MESSAGE)); - mPosition = size + 1; - } + } /** diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java index 6d79a9ab0..b17edacc4 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java @@ -236,7 +236,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O ((LiveActivity) mContext).sendDanmuMessage(content); break; case GENERALMESSAGE: - ((LiveActivity) mContext).sendChatMessage(content, atTextWatcher.getAtUserID(),atTextWatcher.getAtUserName() ); + ((LiveActivity) mContext).sendChatMessage(content, atTextWatcher.getAtUserID(), atTextWatcher.getAtUserName()); atTextWatcher.clearMsg(); dismiss(); break; @@ -370,6 +370,12 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O @Subscribe(threadMode = ThreadMode.MAIN) public void onLiveInputEvent(LiveInputEvent event) { atTextWatcher.insertTextForAt(event.getModel(), mInput); + new Handler().postDelayed(() -> { + + mInput.requestFocus(); + //软键盘弹出 + imm.showSoftInput(mInput, InputMethodManager.SHOW_FORCED); + }, 600); } diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 86080e552..916aaa0eb 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -2003,11 +2003,12 @@ android:layout_height="27.33dp" android:layout_alignParentBottom="true" android:layout_marginStart="10dp" + android:visibility="gone" />