From d3055d8fb21dec355787ea67476787a5bd1364d4 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 18 Jul 2024 13:25:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=E7=A4=BC=E7=89=A9?= =?UTF-8?q?=E5=A2=99=E6=B5=8B=E8=AF=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GiftWallTab2GiftInfoListItemAdapter.java | 2 +- .../yunbao/common/bean/GiftWallInfoBean.java | 10 +++++++++ .../common/dialog/GiftWallGiftInfoDialog.java | 19 ++++++++-------- .../GiftWallMainTab2ClassicInfoDialog.java | 18 ++++++++++----- .../dialog_gift_wall_tab2_classic_info.xml | 22 +++++++++---------- .../layout/item_gift_wall_man_tab2_list_2.xml | 2 +- 6 files changed, 45 insertions(+), 28 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/adapter/GiftWallTab2GiftInfoListItemAdapter.java b/common/src/main/java/com/yunbao/common/adapter/GiftWallTab2GiftInfoListItemAdapter.java index 9923669b9..50ae01937 100644 --- a/common/src/main/java/com/yunbao/common/adapter/GiftWallTab2GiftInfoListItemAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/GiftWallTab2GiftInfoListItemAdapter.java @@ -60,7 +60,7 @@ public class GiftWallTab2GiftInfoListItemAdapter extends RecyclerView.Adapter() { @@ -325,7 +326,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow { gift_progress.setVisibility(View.GONE); } } - if (!isLiveRoom) { + if (!isLiveRoom || (IMLoginManager.get(mContext).getUserInfo().getId() + "").equals(toUserId) && isAnchor) { gift_btn.setEnabled(false); btn_one.setEnabled(false); gift_btn.setBackgroundResource(R.drawable.gift_wall_gift_info_btn_un); @@ -335,7 +336,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow { time = (WordUtil.isNewZh() ? "榜單結算時間" : "Settlement time") + giftBean.getGift_info().getGift_hall_start() + " - " + giftBean.getGift_info().getGift_hall_end(); ImgLoader.display(mContext, IMLoginManager.get(mContext).getUserInfo().getAvatar(), avatar); user_name.setText(IMLoginManager.get(mContext).getUserInfo().getUserNicename()); - send_num.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getGift_hall_send_num())); + send_num.setText(String.format(Locale.getDefault(), "%s", giftBean.getGift_info().getUser_gift_hall_send_num())); String tmp = ""; if (giftBean.getGift_info().getIlluminate_status() == 0) {//未點亮 diff --git a/common/src/main/java/com/yunbao/common/dialog/GiftWallMainTab2ClassicInfoDialog.java b/common/src/main/java/com/yunbao/common/dialog/GiftWallMainTab2ClassicInfoDialog.java index c1f68d397..dacce94ac 100644 --- a/common/src/main/java/com/yunbao/common/dialog/GiftWallMainTab2ClassicInfoDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/GiftWallMainTab2ClassicInfoDialog.java @@ -32,6 +32,7 @@ import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.ScreenDimenUtil; +import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.CustomEllipsizeTextView; import com.yunbao.common.views.weight.ViewClicksAntiShake; @@ -116,7 +117,10 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow { gift_name.setText(WordUtil.isNewZh() ? data.getGiftInfo().getGiftName() : data.getGiftInfo().getGiftNameEn()); mTvUserName.setText(data.getGiftInfo().getNamingLiveNicename()); star_value.setText(String.format(Locale.getDefault(), "%d", data.getGiftInfo().getNeedcoinTotal())); - adapter.setData(data.getData()); + int max = data.getData().size() > 3 ? 3 : 0; + if (max != 0) { + adapter.setData(data.getData().subList(max, data.getData().size())); + } for (int i = 0; i < data.getData().size() && i < 3; i++) { switch (i) { case 0: @@ -165,7 +169,7 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow { recyclerView = findViewById(R.id.recycler_view); adapter = new GiftWallTab2GiftInfoListItemAdapter(); recyclerView.setAdapter(adapter); - recyclerView.addItemDecoration(new ItemDecoration(mContext, 0x000, 0, 2)); + recyclerView.addItemDecoration(new ItemDecoration(mContext, 0x000, 0, DpUtil.dp2px(2))); ViewClicksAntiShake.clicksAntiShake(mIvBack, new ViewClicksAntiShake.ViewClicksCallBack() { @Override @@ -177,16 +181,18 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow { initData(); resetWindows(); } - private void resetWindows(){ - if(isFullWindows){ + + private void resetWindows() { + if (isFullWindows) { ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.iv_back).getLayoutParams(); - params.topMargin=DpUtil.dp2px(47); + params.topMargin = DpUtil.dp2px(47); findViewById(R.id.iv_back).setLayoutParams(params); params = (ConstraintLayout.LayoutParams) findViewById(R.id.scrollView).getLayoutParams(); - params.topMargin=DpUtil.dp2px(47); + params.topMargin = DpUtil.dp2px(47); findViewById(R.id.scrollView).setLayoutParams(params); } } + @Override protected void onCreate() { super.onCreate(); diff --git a/common/src/main/res/layout/dialog_gift_wall_tab2_classic_info.xml b/common/src/main/res/layout/dialog_gift_wall_tab2_classic_info.xml index b209dd9cd..f19144b32 100644 --- a/common/src/main/res/layout/dialog_gift_wall_tab2_classic_info.xml +++ b/common/src/main/res/layout/dialog_gift_wall_tab2_classic_info.xml @@ -20,16 +20,7 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.0" /> - + - + \ No newline at end of file diff --git a/common/src/main/res/layout/item_gift_wall_man_tab2_list_2.xml b/common/src/main/res/layout/item_gift_wall_man_tab2_list_2.xml index ca625e05f..90b9e178e 100644 --- a/common/src/main/res/layout/item_gift_wall_man_tab2_list_2.xml +++ b/common/src/main/res/layout/item_gift_wall_man_tab2_list_2.xml @@ -118,7 +118,7 @@ android:layout_marginStart="20dp" android:layout_marginEnd="20dp" android:gravity="center" - android:text="@string/dialog_gift_wall_tab2_list_wait" + android:text="@string/dialog_gift_wall_classic_wait" android:textColor="#A2A2A2" android:textSize="14sp" android:visibility="gone"