From 13146595bfef891ecbde2ed368c07bf886b9fd2d Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 9 Jan 2023 10:23:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B4=E6=92=AD=E9=97=B4?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=88=A0=E9=99=A4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 4 +- .../yunbao/live/adapter/LiveChatAdapter.java | 3 + .../yunbao/live/views/LiveRoomViewHolder.java | 86 +++++++++---------- 3 files changed, 48 insertions(+), 45 deletions(-) diff --git a/config.gradle b/config.gradle index b123cc49e..7bd22a5fb 100644 --- a/config.gradle +++ b/config.gradle @@ -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", 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 ac142a8e4..ea7b6c472 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -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() { 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 720e608c2..cf87b203e 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -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() {