From bf3ebfedbd5cf6e6e2f49d59a6c46d2329f3b60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=89=8D=E5=8D=AB?= <2298122580@qq.com> Date: Mon, 17 Jun 2024 10:59:47 +0800 Subject: [PATCH] =?UTF-8?q?6.7.0=E7=94=A8=E6=88=B7=E7=AB=AF=E6=9B=B4?= =?UTF-8?q?=E6=96=B0:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/adapter/PrankAdapter.java | 7 ++++++- .../yunbao/live/views/LiveRoomViewHolder.java | 10 ++++++++-- .../src/main/res/layout/item_prank_progress.xml | 4 ++-- live/src/main/res/layout/view_live_room.xml | 17 +++++++++-------- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/adapter/PrankAdapter.java b/live/src/main/java/com/yunbao/live/adapter/PrankAdapter.java index c6421f3a7..22fe4598f 100644 --- a/live/src/main/java/com/yunbao/live/adapter/PrankAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/PrankAdapter.java @@ -71,7 +71,12 @@ public class PrankAdapter extends RecyclerView.Adapter if(viewHolder instanceof MyViewHolder){ MyViewHolder holder = (MyViewHolder) viewHolder; holder.itemView.setOnClickListener(v-> onItemClickListener.onItemClick(v,data.getGift_id())); - holder.prank_item_subscript.setText(String.valueOf(data.getCompleted_num())); + int completedNum = data.getCompleted_num(); + if (completedNum>99){ + holder.prank_item_subscript.setText("99+"); + }else { + holder.prank_item_subscript.setText(String.valueOf(data.getCompleted_num())); + } holder.prank_item_prank_name.setText(data.getPrank_content()); holder.prank_item_gift_name.setText(WordUtil.isNewZh() ? data.getGift_name() : data.getGift_name_en()); holder.prank_item_now_progress.setText(String.valueOf(data.getSend_num())); 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 0c622695b..ce0cc5831 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1717,13 +1717,19 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } if(prankAnisShow){ prankAdapter.showAnView(completedList,prankAnisShow); - prank_group_turntable.setText(WordUtil.isNewZh()?"整蠱進度":"progress"); + prank_group_turntable.setText(R.string.prank_progress); prank_group_title.setText(WordUtil.isNewZh()?"待完成整蠱":"To do"); - + if (!completedList.isEmpty()){ + limitItem(1,Math.min(completedList.size(), 4)); + }else { + recycler_prank.setVisibility(View.GONE); + } }else{ prankAdapter.showAnView(prankAndComboList,prankAnisShow); prank_group_turntable.setText(WordUtil.isNewZh()?"待完成整蠱":"To do"); prank_group_title.setText(WordUtil.isNewZh()?"整蠱進度":"To do"); + recycler_prank.setVisibility(View.VISIBLE); + limitItem(1,Math.min(prankAndComboList.size(), 4)); } }); diff --git a/live/src/main/res/layout/item_prank_progress.xml b/live/src/main/res/layout/item_prank_progress.xml index eb97fc70b..ed81e4fa7 100644 --- a/live/src/main/res/layout/item_prank_progress.xml +++ b/live/src/main/res/layout/item_prank_progress.xml @@ -10,12 +10,12 @@ diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index d0bd9e291..52cce3093 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -1502,14 +1502,6 @@ android:background="@color/white" android:visibility="invisible" /> - - + + +