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 6a4b9e1ba..d0020fde6 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -127,7 +127,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); - if(isSlideToBottom(recyclerView))return; + if (isSlideToBottom(recyclerView)) return; mRecyclerViewScrolledDy = dy; } }); @@ -390,7 +390,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { } mList.add(bean); if (isSlideToBottom(mRecyclerView) || mRecyclerViewScrolledDy == 0) { - scrollToBottom(mRecyclerView); + scrollToBottom(); } else { Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.NEW_MESSAGE_REMINDER)); @@ -401,7 +401,11 @@ public class LiveChatAdapter extends RecyclerView.Adapter { mPosition = size; } } - notifyDataSetChanged(); + if (getItemCount() == 1) { + notifyDataSetChanged(); + } else { + notifyItemInserted(getItemCount()); + } }