6.7.0用户端更新:更改数据类型

This commit is contained in:
余前卫 2024-06-11 14:18:55 +08:00
parent f59e5e527a
commit f82dbccaa5
2 changed files with 29 additions and 14 deletions

View File

@ -1,5 +1,7 @@
package com.yunbao.common.bean; package com.yunbao.common.bean;
import com.google.gson.JsonElement;
import java.util.List; import java.util.List;
public class PrankProgressBean extends BaseModel { public class PrankProgressBean extends BaseModel {
@ -7,7 +9,7 @@ public class PrankProgressBean extends BaseModel {
private int prank_turntable_status;// 转盘整蛊状态 0=关闭 1=开启 private int prank_turntable_status;// 转盘整蛊状态 0=关闭 1=开启
private int prank_type;// 整蛊类型 1.礼物整蛊 2.连击整蛊 private int prank_type;// 整蛊类型 1.礼物整蛊 2.连击整蛊
private List<PrankList> prank_list;// 整蛊进度 private List<PrankList> prank_list;// 整蛊进度
private List<PrankList> completed_list;// 待完成的整蛊 private JsonElement completed_list;// 待完成的整蛊
public PrankProgressBean(){ public PrankProgressBean(){
} }
@ -23,6 +25,26 @@ public class PrankProgressBean extends BaseModel {
private String gift_name;// 礼物名称 private String gift_name;// 礼物名称
private String gift_icon; // 礼物图片链接 private String gift_icon; // 礼物图片链接
private String gift_name_en;
private int continuous_click_num;
public int getContinuous_click_num() {
return continuous_click_num;
}
public void setContinuous_click_num(int continuous_click_num) {
this.continuous_click_num = continuous_click_num;
}
public String getGift_name_en() {
return gift_name_en;
}
public void setGift_name_en(String gift_name_en) {
this.gift_name_en = gift_name_en;
}
public int getGift_id() { public int getGift_id() {
return gift_id; return gift_id;
} }
@ -85,16 +107,6 @@ public class PrankProgressBean extends BaseModel {
return (double) send_num / gift_num; return (double) send_num / gift_num;
} }
public PrankList(int gift_id, int gift_num, String prank_content, int send_num, int completed_num, String gift_name, String gift_icon) {
this.gift_id = gift_id;
this.gift_num = gift_num;
this.prank_content = prank_content;
this.send_num = send_num;
this.completed_num = completed_num;
this.gift_name = gift_name;
this.gift_icon = gift_icon;
}
@Override @Override
public String toString() { public String toString() {
return "PrankList{" + return "PrankList{" +
@ -105,6 +117,8 @@ public class PrankProgressBean extends BaseModel {
", completed_num=" + completed_num + ", completed_num=" + completed_num +
", gift_name='" + gift_name + '\'' + ", gift_name='" + gift_name + '\'' +
", gift_icon='" + gift_icon + '\'' + ", gift_icon='" + gift_icon + '\'' +
", gift_name_en='" + gift_name_en + '\'' +
", continuous_click_num=" + continuous_click_num +
'}'; '}';
} }
} }
@ -133,11 +147,11 @@ public class PrankProgressBean extends BaseModel {
this.prank_list = prank_list; this.prank_list = prank_list;
} }
public List<PrankList> getCompleted_list() { public JsonElement getCompleted_list() {
return completed_list; return completed_list;
} }
public void setCompleted_list(List<PrankList> completed_list) { public void setCompleted_list(JsonElement completed_list) {
this.completed_list = completed_list; this.completed_list = completed_list;
} }

View File

@ -13,6 +13,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.bean.PrankProgressBean; import com.yunbao.common.bean.PrankProgressBean;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.views.LiveRoomViewHolder; import com.yunbao.live.views.LiveRoomViewHolder;
@ -47,7 +48,7 @@ public class PrankAdapter extends RecyclerView.Adapter<PrankAdapter.MyViewHolder
holder.itemView.setOnClickListener(v-> onItemClickListener.onItemClick(v,data.getGift_id())); holder.itemView.setOnClickListener(v-> onItemClickListener.onItemClick(v,data.getGift_id()));
holder.prank_item_subscript.setText(String.valueOf(data.getCompleted_num())); holder.prank_item_subscript.setText(String.valueOf(data.getCompleted_num()));
holder.prank_item_prank_name.setText(data.getPrank_content()); holder.prank_item_prank_name.setText(data.getPrank_content());
holder.prank_item_gift_name.setText(data.getGift_name()); 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())); holder.prank_item_now_progress.setText(String.valueOf(data.getSend_num()));
holder.prank_item_total_progress.setText("/"+ data.getGift_num()); holder.prank_item_total_progress.setText("/"+ data.getGift_num());
ImgLoader.display(mContext,data.getGift_icon(),holder.prank_item_icon); ImgLoader.display(mContext,data.getGift_icon(),holder.prank_item_icon);