From 3e91068866324d0ce0480eda1846f1394b1c5b97 Mon Sep 17 00:00:00 2001
From: zlzw <583819556@qq.com>
Date: Thu, 6 Jul 2023 15:13:33 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E6=B5=8B=E8=AF=95=E5=8F=8D=E9=A6=88?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BA=A2=E5=8C=85=E8=AF=A6=E6=83=85UI?=
=?UTF-8?q?=E9=80=BB=E8=BE=91=E5=92=8C=E6=96=B0=E5=A2=9E=E7=A4=BC=E7=89=A9?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../common/bean/RedPacketDetailsBean.java | 22 +++++++++++++++++++
.../main/activity/RedPacketInfoActivity.java | 8 +++++--
.../main/activity/RedPacketUsersActivity.java | 4 ++--
.../adapter/RedPacketUserRecyclerAdapter.java | 14 ++++++++++--
.../res/layout/activity_red_packet_info.xml | 2 +-
.../res/layout/activity_red_packet_users.xml | 2 +-
6 files changed, 44 insertions(+), 8 deletions(-)
diff --git a/common/src/main/java/com/yunbao/common/bean/RedPacketDetailsBean.java b/common/src/main/java/com/yunbao/common/bean/RedPacketDetailsBean.java
index 671b61313..5b54d44c8 100644
--- a/common/src/main/java/com/yunbao/common/bean/RedPacketDetailsBean.java
+++ b/common/src/main/java/com/yunbao/common/bean/RedPacketDetailsBean.java
@@ -14,6 +14,8 @@ public class RedPacketDetailsBean extends BaseModel {
private String avatar;
@SerializedName("red_packet_money")
private long money;// 红包金豆总数量
+ @SerializedName("amount_diamond")
+ private long diamond;// 红包价值钻石
@SerializedName("red_packet_quantity")
private int quantity; // 领取的红包总数量
@SerializedName("red_packet_quantity_already")
@@ -81,6 +83,14 @@ public class RedPacketDetailsBean extends BaseModel {
this.details = details;
}
+ public long getDiamond() {
+ return diamond;
+ }
+
+ public void setDiamond(long diamond) {
+ this.diamond = diamond;
+ }
+
@Override
public String toString() {
return "RedPacketDetailsBean{" +
@@ -88,6 +98,7 @@ public class RedPacketDetailsBean extends BaseModel {
", avatarThumb='" + avatarThumb + '\'' +
", avatar='" + avatar + '\'' +
", money=" + money +
+ ", diamond=" + diamond +
", quantity=" + quantity +
", already=" + already +
", details=" + details +
@@ -105,6 +116,8 @@ public class RedPacketDetailsBean extends BaseModel {
private String avatarThumb;
@SerializedName("avatar")
private String avatar;
+ @SerializedName("gifticon")
+ private String gifticon;
public long getMoney() {
@@ -151,6 +164,14 @@ public class RedPacketDetailsBean extends BaseModel {
this.avatar = avatar;
}
+ public String getGifticon() {
+ return gifticon;
+ }
+
+ public void setGifticon(String gifticon) {
+ this.gifticon = gifticon;
+ }
+
@Override
public String toString() {
return "Detail{" +
@@ -159,6 +180,7 @@ public class RedPacketDetailsBean extends BaseModel {
", time='" + time + '\'' +
", avatarThumb='" + avatarThumb + '\'' +
", avatar='" + avatar + '\'' +
+ ", gifticon='" + gifticon + '\'' +
'}';
}
}
diff --git a/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java b/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java
index 68271b00e..7bc0bb365 100644
--- a/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java
@@ -61,11 +61,15 @@ public class RedPacketInfoActivity extends AbsActivity implements View.OnClickLi
} else {
status.setText(R.string.red_packet_info_status_timeout);
}
- if (bean.getAmountRefund() == 0) {
+ if (bean.getRedPacketStatus() == 1 && bean.getAmountRefund() == 0){
gold.setVisibility(View.GONE);
backAccountText.setText(R.string.red_packet_info_residue_none);
- } else {
+ } else{
gold.setVisibility(View.VISIBLE);
+ backAccountText.setText(mContext.getString(R.string.red_packet_info_residue_back) + " +" + bean.getAmountDiamond());
+ }
+ if (bean.getRedPacketStatus() == 2 && bean.getAmountRefund() == 0) {
+ icon.setImageResource(R.mipmap.gold_coin);
backAccountText.setText(mContext.getString(R.string.red_packet_info_residue_back) + " +" + bean.getAmountRefund());
}
}
diff --git a/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java b/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java
index 083a4f309..aeb850cf7 100644
--- a/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java
@@ -45,7 +45,7 @@ public class RedPacketUsersActivity extends AbsActivity implements View.OnClickL
avatar = findViewById(R.id.avatar);
title = findViewById(R.id.title);
money = findViewById(R.id.money);
- icon = findViewById(R.id.avatar);
+ icon = findViewById(R.id.icon);
open = findViewById(R.id.open_packet);
redPacketId=getIntent().getIntExtra("id",0);
adapter = new RedPacketUserRecyclerAdapter(this);
@@ -81,7 +81,7 @@ public class RedPacketUsersActivity extends AbsActivity implements View.OnClickL
private void setData(RedPacketDetailsBean bean){
ImgLoader.display(mContext,bean.getAvatarThumb(),avatar);
title.setText(bean.getNiceName());
- money.setText(bean.getMoney()+"");
+ money.setText(bean.getDiamond()+"");
open.setText(mContext.getString(R.string.red_packet_user_tips)+" "+bean.getAlready()+"/"+bean.getQuantity());
}
diff --git a/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java b/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java
index ddd7b1dbf..1cb2f276a 100644
--- a/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java
+++ b/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java
@@ -5,6 +5,7 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
@@ -13,6 +14,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.bean.RedPacketDetailsBean;
import com.yunbao.common.glide.ImgLoader;
+import com.yunbao.common.utils.StringUtil;
import com.yunbao.main.R;
import java.util.ArrayList;
@@ -53,6 +55,7 @@ public class RedPacketUserRecyclerAdapter extends RecyclerView.Adapter
+ app:srcCompat="@mipmap/diamond" />
+ app:srcCompat="@mipmap/diamond" />