From 11d0afde56bf850652870ac06138ec2462b6aeb6 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 11 Oct 2022 10:59:19 +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 --- .../main/java/com/yunbao/live/adapter/LiveChatAdapter.java | 5 +++-- live/src/main/res/layout/view_live_room.xml | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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 8ee8974e4..17c3656d7 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -349,7 +349,8 @@ public class LiveChatAdapter extends RecyclerView.Adapter { } } - public synchronized void insertItem(LiveChatBean bean) { + @SuppressLint("NotifyDataSetChanged") + public void insertItem(LiveChatBean bean) { if (bean == null) { return; @@ -373,7 +374,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { mPosition = size; } } - notifyItemChanged(getItemCount() - 1); + notifyDataSetChanged(); } diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 916aaa0eb..0cb734178 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -290,7 +290,7 @@ @@ -298,7 +298,7 @@