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 0f1d43d2c..a410ef698 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -106,7 +106,6 @@ public class LiveChatAdapter extends RecyclerView.Adapter { @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) { if (vh instanceof Vh) { - vh.setIsRecyclable(false); ((Vh) vh).setData(mList.get(position), position); } else if (vh instanceof RedPackVh) { ((RedPackVh) vh).setData(mList.get(position)); @@ -382,7 +381,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { mList.add(bean); if (isSlideToBottom(mRecyclerView)) { - mRecyclerView.scrollToPosition(getItemCount() - 1); + mRecyclerView.smoothScrollToPosition(getItemCount() - 1); } else { Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.NEW_MESSAGE_REMINDER)); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 4e3e557c3..9a312895c 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -853,6 +853,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis layoutManager.setStackFromEnd(true); mChatRecyclerView.setLayoutManager(layoutManager); mChatRecyclerView.addItemDecoration(new TopGradual()); + mChatRecyclerView.setItemViewCacheSize(8); mLiveChatAdapter = new LiveChatAdapter(mContext); mChatRecyclerView.setAdapter(mLiveChatAdapter); mLiveChatAdapter.setOnItemClickListener(new OnItemClickListener() { diff --git a/live/src/main/res/layout/dialog_live_role.xml b/live/src/main/res/layout/dialog_live_role.xml index 75187a2e4..bb2a3d80f 100644 --- a/live/src/main/res/layout/dialog_live_role.xml +++ b/live/src/main/res/layout/dialog_live_role.xml @@ -1,7 +1,7 @@