修改直播间聊天记录重叠问题

This commit is contained in:
18401019693 2023-01-08 14:42:01 +08:00
parent a1f07b8c20
commit 9fcc04cef2

View File

@ -402,7 +402,8 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
// Log.i(TAG, "insertItem: " + bean.getContent()+" size = "+(mList.size()+1)); // Log.i(TAG, "insertItem: " + bean.getContent()+" size = "+(mList.size()+1));
int size = mList.size(); int size = mList.size();
//设置最大展示99条消息 //设置最大展示99条消息
if (size == 100) { if (size >= 100 && (isBottom || mRecyclerViewScrolledDy == 0)) {
mList.subList(0, 50).clear(); mList.subList(0, 50).clear();
notifyItemRangeRemoved(0, 50); notifyItemRangeRemoved(0, 50);
} }
@ -414,7 +415,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
} }
// size = mList.size(); // size = mList.size();
if (isBottom || mRecyclerViewScrolledDy == 0) { if (isBottom || mRecyclerViewScrolledDy == 0) {
scrollToBottom(); scrollToBottom();
} else { } else {
Bus.get().post(new LiveAudienceEvent() Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.NEW_MESSAGE_REMINDER)); .setType(LiveAudienceEvent.LiveAudienceType.NEW_MESSAGE_REMINDER));