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" />