fix 修复礼物墙测试问题

This commit is contained in:
zlzw 2024-07-18 13:25:42 +08:00
parent b9164b6a08
commit d3055d8fb2
6 changed files with 45 additions and 28 deletions

View File

@ -60,7 +60,7 @@ public class GiftWallTab2GiftInfoListItemAdapter extends RecyclerView.Adapter<Gi
} }
public void setData(GiftWallMainTab2ClassicInfoBean.GiftData data, int position) { public void setData(GiftWallMainTab2ClassicInfoBean.GiftData data, int position) {
tv_rank.setText(String.format(Locale.getDefault(), "%d", (position + 1))); tv_rank.setText(String.format(Locale.getDefault(), "%d", (position + 4)));
tv_rank.setTextColor(Color.parseColor("#FCC755")); tv_rank.setTextColor(Color.parseColor("#FCC755"));
tv_rank.setTextSize(20); tv_rank.setTextSize(20);
tv_rename.setText(String.format(Locale.getDefault(), "%d", (data.getGiftHallSendNum()))); tv_rename.setText(String.format(Locale.getDefault(), "%d", (data.getGiftHallSendNum())));

View File

@ -86,6 +86,16 @@ public class GiftWallInfoBean extends BaseModel {
private String gift_hall_start; // 使用Java 8的LocalDate来处理日期 private String gift_hall_start; // 使用Java 8的LocalDate来处理日期
@SerializedName("gift_hall_end_date") @SerializedName("gift_hall_end_date")
private String gift_hall_end; private String gift_hall_end;
@SerializedName("user_gift_hall_send_num")
private int user_gift_hall_send_num;
public int getUser_gift_hall_send_num() {
return user_gift_hall_send_num;
}
public void setUser_gift_hall_send_num(int user_gift_hall_send_num) {
this.user_gift_hall_send_num = user_gift_hall_send_num;
}
@JSONField(name = "gift_hall_start_date") @JSONField(name = "gift_hall_start_date")
public void setGift_hall_start(String gift_hall_start) { public void setGift_hall_start(String gift_hall_start) {

View File

@ -247,6 +247,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss); ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss);
resetWindows(); resetWindows();
} }
private void resetWindows() { private void resetWindows() {
if (isFullWindows) { if (isFullWindows) {
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.gift_name).getLayoutParams(); ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.gift_name).getLayoutParams();
@ -325,7 +326,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
gift_progress.setVisibility(View.GONE); gift_progress.setVisibility(View.GONE);
} }
} }
if (!isLiveRoom) { if (!isLiveRoom || (IMLoginManager.get(mContext).getUserInfo().getId() + "").equals(toUserId) && isAnchor) {
gift_btn.setEnabled(false); gift_btn.setEnabled(false);
btn_one.setEnabled(false); btn_one.setEnabled(false);
gift_btn.setBackgroundResource(R.drawable.gift_wall_gift_info_btn_un); 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(); 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); ImgLoader.display(mContext, IMLoginManager.get(mContext).getUserInfo().getAvatar(), avatar);
user_name.setText(IMLoginManager.get(mContext).getUserInfo().getUserNicename()); 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 = ""; String tmp = "";
if (giftBean.getGift_info().getIlluminate_status() == 0) {//未點亮 if (giftBean.getGift_info().getIlluminate_status() == 0) {//未點亮

View File

@ -32,6 +32,7 @@ import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.ScreenDimenUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.CustomEllipsizeTextView; import com.yunbao.common.views.CustomEllipsizeTextView;
import com.yunbao.common.views.weight.ViewClicksAntiShake; 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()); gift_name.setText(WordUtil.isNewZh() ? data.getGiftInfo().getGiftName() : data.getGiftInfo().getGiftNameEn());
mTvUserName.setText(data.getGiftInfo().getNamingLiveNicename()); mTvUserName.setText(data.getGiftInfo().getNamingLiveNicename());
star_value.setText(String.format(Locale.getDefault(), "%d", data.getGiftInfo().getNeedcoinTotal())); 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++) { for (int i = 0; i < data.getData().size() && i < 3; i++) {
switch (i) { switch (i) {
case 0: case 0:
@ -165,7 +169,7 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
recyclerView = findViewById(R.id.recycler_view); recyclerView = findViewById(R.id.recycler_view);
adapter = new GiftWallTab2GiftInfoListItemAdapter(); adapter = new GiftWallTab2GiftInfoListItemAdapter();
recyclerView.setAdapter(adapter); 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() { ViewClicksAntiShake.clicksAntiShake(mIvBack, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
@ -177,6 +181,7 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
initData(); initData();
resetWindows(); resetWindows();
} }
private void resetWindows() { private void resetWindows() {
if (isFullWindows) { if (isFullWindows) {
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.iv_back).getLayoutParams(); ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.iv_back).getLayoutParams();
@ -187,6 +192,7 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
findViewById(R.id.scrollView).setLayoutParams(params); findViewById(R.id.scrollView).setLayoutParams(params);
} }
} }
@Override @Override
protected void onCreate() { protected void onCreate() {
super.onCreate(); super.onCreate();

View File

@ -20,16 +20,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" /> app:layout_constraintVertical_bias="0.0" />
<ImageView
android:id="@+id/iv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="21dp"
android:src="@mipmap/icon_sud_rule_close_bottom"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/scrollView" android:id="@+id/scrollView"
@ -483,6 +474,15 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
<ImageView
android:id="@+id/iv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="21dp"
android:src="@mipmap/icon_sud_rule_close_bottom"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -118,7 +118,7 @@
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
android:gravity="center" android:gravity="center"
android:text="@string/dialog_gift_wall_tab2_list_wait" android:text="@string/dialog_gift_wall_classic_wait"
android:textColor="#A2A2A2" android:textColor="#A2A2A2"
android:textSize="14sp" android:textSize="14sp"
android:visibility="gone" android:visibility="gone"