修改直播间聊天删除问题

This commit is contained in:
18401019693 2023-01-09 10:23:21 +08:00
parent b3083cdd18
commit 13146595bf
3 changed files with 48 additions and 45 deletions

View File

@ -10,9 +10,9 @@ ext {
manifestPlaceholders = [
//
serverHost : "https://napi.yaoulive.com",
// serverHost : "https://napi.yaoulive.com",
//
// serverHost : "https://ceshi.yaoulive.com",
serverHost : "https://ceshi.yaoulive.com",
//
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -463,9 +463,12 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
if (bean == null) {
return;
}
mList.remove(bean.getHeart());
notifyItemRemoved(bean.getHeart());
notifyItemRangeChanged(bean.getHeart(), getItemCount());
}
public void scrollToBottom() {

View File

@ -884,49 +884,49 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mChatRecyclerView.setLayoutManager(layoutManager);
mChatRecyclerView.addItemDecoration(new TopGradual());
mChatRecyclerView.setItemViewCacheSize(10);
mChatRecyclerView.setItemAnimator(new SimpleItemAnimator() {
@Override
public boolean animateRemove(RecyclerView.ViewHolder holder) {
return false;
}
@Override
public boolean animateAdd(RecyclerView.ViewHolder holder) {
Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.live_chat_msg_in);
holder.itemView.startAnimation(animation);
return false;
}
@Override
public boolean animateMove(RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY) {
return false;
}
@Override
public boolean animateChange(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder, int fromLeft, int fromTop, int toLeft, int toTop) {
return false;
}
@Override
public void runPendingAnimations() {
}
@Override
public void endAnimation(@NonNull RecyclerView.ViewHolder item) {
}
@Override
public void endAnimations() {
}
@Override
public boolean isRunning() {
return false;
}
});
// mChatRecyclerView.setItemAnimator(new SimpleItemAnimator() {
// @Override
// public boolean animateRemove(RecyclerView.ViewHolder holder) {
// return false;
// }
//
// @Override
// public boolean animateAdd(RecyclerView.ViewHolder holder) {
// Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.live_chat_msg_in);
// holder.itemView.startAnimation(animation);
// return false;
// }
//
// @Override
// public boolean animateMove(RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY) {
// return false;
// }
//
// @Override
// public boolean animateChange(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder, int fromLeft, int fromTop, int toLeft, int toTop) {
// return false;
// }
//
// @Override
// public void runPendingAnimations() {
//
// }
//
// @Override
// public void endAnimation(@NonNull RecyclerView.ViewHolder item) {
//
// }
//
// @Override
// public void endAnimations() {
//
// }
//
// @Override
// public boolean isRunning() {
// return false;
// }
// });
mLiveChatAdapter = new LiveChatAdapter(mContext);
mChatRecyclerView.setAdapter(mLiveChatAdapter);
mLiveChatAdapter.setOnItemClickListener(new OnItemClickListener<LiveChatBean>() {