diff --git a/common/src/main/java/com/yunbao/common/adapter/DragonSendMoneyListAdapter.java b/common/src/main/java/com/yunbao/common/adapter/DragonSendMoneyListAdapter.java new file mode 100644 index 000000000..7278307bc --- /dev/null +++ b/common/src/main/java/com/yunbao/common/adapter/DragonSendMoneyListAdapter.java @@ -0,0 +1,64 @@ +package com.yunbao.common.adapter; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.R; +import com.yunbao.common.bean.sendMoneyLongListModel; +import com.yunbao.common.views.DragonSendMoneyListViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class DragonSendMoneyListAdapter extends RecyclerView.Adapter { + RecyclerView send_money_list; + + public DragonSendMoneyListAdapter(RecyclerView send_money_list) { + this.send_money_list = send_money_list; + } + + List moneyLongListModels = new ArrayList<>(); + DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack callBack; + + public void setCallBack(DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack callBack) { + this.callBack = callBack; + } + + public void setMoneyLongListModels(List models) { + + moneyLongListModels.clear(); + moneyLongListModels.addAll(models); + notifyDataSetChanged(); + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + + View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_dragon_send_money_list, parent, false); + + return new DragonSendMoneyListViewHolder(goodGiftsView); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + DragonSendMoneyListViewHolder sendMoneyListViewHolder = (DragonSendMoneyListViewHolder) holder; + sendMoneyListViewHolder.setData(moneyLongListModels.get(position), callBack); + + + } + + @Override + public int getItemCount() { + return moneyLongListModels.size(); + } + + @Override + public int getItemViewType(int position) { + return super.getItemViewType(position); + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java b/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java index 049be7908..7ecda8f0f 100644 --- a/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java +++ b/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java @@ -43,6 +43,17 @@ public class EnterRoomNewModel extends BaseModel { private int quickGiftRemainingQuantity;//剩余的小PD礼物数量 @SerializedName("if_viewing_duration_complete") private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数 + @SerializedName("sendMoneyLongStatus") + private SendMoneyLongStatusModel model; + + public SendMoneyLongStatusModel getModel() { + return model; + } + + public EnterRoomNewModel setModel(SendMoneyLongStatusModel model) { + this.model = model; + return this; + } public int getQuickGiftRemainingQuantity() { return quickGiftRemainingQuantity; diff --git a/common/src/main/java/com/yunbao/common/bean/SendMoneyLongModel.java b/common/src/main/java/com/yunbao/common/bean/SendMoneyLongModel.java index dfefefeb8..b296923e4 100644 --- a/common/src/main/java/com/yunbao/common/bean/SendMoneyLongModel.java +++ b/common/src/main/java/com/yunbao/common/bean/SendMoneyLongModel.java @@ -29,7 +29,7 @@ public class SendMoneyLongModel extends BaseModel { @SerializedName("liveuid") private String liveuid; @SerializedName("add_time") - private int addTime; + private String addTime; @SerializedName("gold_num") private String goldNum; @@ -81,11 +81,11 @@ public class SendMoneyLongModel extends BaseModel { this.liveuid = liveuid; } - public int getAddTime() { + public String getAddTime() { return addTime; } - public void setAddTime(int addTime) { + public void setAddTime(String addTime) { this.addTime = addTime; } diff --git a/common/src/main/java/com/yunbao/common/bean/SendMoneyLongStatusModel.java b/common/src/main/java/com/yunbao/common/bean/SendMoneyLongStatusModel.java new file mode 100644 index 000000000..6c0b00918 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/SendMoneyLongStatusModel.java @@ -0,0 +1,154 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +public class SendMoneyLongStatusModel extends BaseModel { + /** + * "sendMoneyLongStatus": { // 未查询到数据时为空数组 + * "liveuid": "98889", // 主播ID + * "uid": "98888", // 发起用户ID + * "addtime": "1710384258446", // 开始时间 毫秒时间戳 + * "gold_num": "5000", // 金豆数量 + * "user_nicename": "周末暴打小朋友", // 用户昵称 + * "user_avatar": "https://downs.yaoulive.com/mannine.png", // 用户头像链接 + * "countdown": 300 // 倒计时 + * "start_status": false, + * "start_time": "", + * "send_money_long_key": "1710397575473", + * "participate": 0, + * "add_time": "1710397575473" + * } + */ + @SerializedName("liveuid") + private String liveuid; + @SerializedName("uid") + private String uid; + @SerializedName("addtime") + private String addtime; + @SerializedName("gold_num") + private String goldNum; + @SerializedName("user_nicename") + private String userNicename; + @SerializedName("user_avatar") + private String userAvatar; + @SerializedName("countdown") + private String countdown; + @SerializedName("start_status") + private String startStatus; + @SerializedName("start_time") + private String startTime; + @SerializedName("send_money_long_key") + private String sendMoneyLongKey; + @SerializedName("participate") + private String participate; + @SerializedName("add_time") + private String addTime; + + public String getLiveuid() { + return liveuid; + } + + public SendMoneyLongStatusModel setLiveuid(String liveuid) { + this.liveuid = liveuid; + return this; + } + + public String getUid() { + return uid; + } + + public SendMoneyLongStatusModel setUid(String uid) { + this.uid = uid; + return this; + } + + public String getAddtime() { + return addtime; + } + + public SendMoneyLongStatusModel setAddtime(String addtime) { + this.addtime = addtime; + return this; + } + + public String getGoldNum() { + return goldNum; + } + + public SendMoneyLongStatusModel setGoldNum(String goldNum) { + this.goldNum = goldNum; + return this; + } + + public String getUserNicename() { + return userNicename; + } + + public SendMoneyLongStatusModel setUserNicename(String userNicename) { + this.userNicename = userNicename; + return this; + } + + public String getUserAvatar() { + return userAvatar; + } + + public SendMoneyLongStatusModel setUserAvatar(String userAvatar) { + this.userAvatar = userAvatar; + return this; + } + + public String getCountdown() { + return countdown; + } + + public SendMoneyLongStatusModel setCountdown(String countdown) { + this.countdown = countdown; + return this; + } + + public String getStartStatus() { + return startStatus; + } + + public SendMoneyLongStatusModel setStartStatus(String startStatus) { + this.startStatus = startStatus; + return this; + } + + public String getStartTime() { + return startTime; + } + + public SendMoneyLongStatusModel setStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + public String getSendMoneyLongKey() { + return sendMoneyLongKey; + } + + public SendMoneyLongStatusModel setSendMoneyLongKey(String sendMoneyLongKey) { + this.sendMoneyLongKey = sendMoneyLongKey; + return this; + } + + public String getParticipate() { + return participate; + } + + public SendMoneyLongStatusModel setParticipate(String participate) { + this.participate = participate; + return this; + } + + public String getAddTime() { + return addTime; + } + + public SendMoneyLongStatusModel setAddTime(String addTime) { + this.addTime = addTime; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/sendMoneyLongListModel.java b/common/src/main/java/com/yunbao/common/bean/sendMoneyLongListModel.java new file mode 100644 index 000000000..743d1ad8b --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/sendMoneyLongListModel.java @@ -0,0 +1,154 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +public class sendMoneyLongListModel extends BaseModel { + /** + * { + * "liveuid": "98889", // 主播ID + * "uid": "98888", // 用户ID + * "addtime": "1710397350011", // 创建时间 毫秒时间戳 + * "gold_num": "5000", // 金豆数量 + * "user_nicename": "周末暴打小朋友", // 用户昵称 + * "user_avatar": "https://downs.yaoulive.com/mannine.png", // 用户头像 + * "countdown": 300, // 倒计时 + * "start_status": false, + * "start_time": "", + * "send_money_long_key": "1710397485729", + * "participate": 0, // 是否参与活动 0.未参与 1.已参与 + * "add_time": "1710397485729" + * } + */ + @SerializedName("liveuid") + private String liveuid; + @SerializedName("uid") + private String uid; + @SerializedName("addtime") + private String addtime; + @SerializedName("gold_num") + private String goldNum; + @SerializedName("user_nicename") + private String userNicename; + @SerializedName("user_avatar") + private String userAvatar; + @SerializedName("countdown") + private String countdown; + @SerializedName("start_status") + private boolean startStatus; + @SerializedName("start_time") + private String startTime; + @SerializedName("send_money_long_key") + private String sendMoneyLongKey; + @SerializedName("participate") + private String participate; + @SerializedName("add_time") + private String addTime; + + public String getLiveuid() { + return liveuid; + } + + public sendMoneyLongListModel setLiveuid(String liveuid) { + this.liveuid = liveuid; + return this; + } + + public String getUid() { + return uid; + } + + public sendMoneyLongListModel setUid(String uid) { + this.uid = uid; + return this; + } + + public String getAddtime() { + return addtime; + } + + public sendMoneyLongListModel setAddtime(String addtime) { + this.addtime = addtime; + return this; + } + + public String getGoldNum() { + return goldNum; + } + + public sendMoneyLongListModel setGoldNum(String goldNum) { + this.goldNum = goldNum; + return this; + } + + public String getUserNicename() { + return userNicename; + } + + public sendMoneyLongListModel setUserNicename(String userNicename) { + this.userNicename = userNicename; + return this; + } + + public String getUserAvatar() { + return userAvatar; + } + + public sendMoneyLongListModel setUserAvatar(String userAvatar) { + this.userAvatar = userAvatar; + return this; + } + + public String getCountdown() { + return countdown; + } + + public sendMoneyLongListModel setCountdown(String countdown) { + this.countdown = countdown; + return this; + } + + public boolean isStartStatus() { + return startStatus; + } + + public sendMoneyLongListModel setStartStatus(boolean startStatus) { + this.startStatus = startStatus; + return this; + } + + public String getStartTime() { + return startTime; + } + + public sendMoneyLongListModel setStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + public String getSendMoneyLongKey() { + return sendMoneyLongKey; + } + + public sendMoneyLongListModel setSendMoneyLongKey(String sendMoneyLongKey) { + this.sendMoneyLongKey = sendMoneyLongKey; + return this; + } + + public String getParticipate() { + return participate; + } + + public sendMoneyLongListModel setParticipate(String participate) { + this.participate = participate; + return this; + } + + public String getAddTime() { + return addTime; + } + + public sendMoneyLongListModel setAddTime(String addTime) { + this.addTime = addTime; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 69c087c74..a10ae2ae5 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -73,6 +73,7 @@ import com.yunbao.common.bean.UserAvatarSelectBean; import com.yunbao.common.bean.VipModel; import com.yunbao.common.bean.WishListGiftConfModel; import com.yunbao.common.bean.WishListModel; +import com.yunbao.common.bean.sendMoneyLongListModel; import com.yunbao.common.event.CheckCurrencyModel; import java.util.List; @@ -1176,4 +1177,10 @@ public interface PDLiveApi { @GET("/api/public/?service=Guard.sendMoneyLong") Observable> sendMoneyLong(@Query("liveuid") String liveUid, @Query("gold_num") String goldNum); + + @GET("/api/public/?service=Guard.sendMoneyLongList") + Observable>> sendMoneyLongList(@Query("liveuid") String liveUid); + + @GET("/api/public/?service=Guard.participateMoneyLong") + Observable> participateMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey); } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index df579e1e7..b5c93ac16 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -69,6 +69,7 @@ import com.yunbao.common.bean.UserAvatarSelectBean; import com.yunbao.common.bean.VipModel; import com.yunbao.common.bean.WishListGiftConfModel; import com.yunbao.common.bean.WishListModel; +import com.yunbao.common.bean.sendMoneyLongListModel; import com.yunbao.common.event.CheckCurrencyModel; import com.yunbao.common.http.API; import com.yunbao.common.http.ResponseModel; @@ -3029,6 +3030,54 @@ public class LiveNetManager { } + public void participateMoneyLong(String liveUid, String sendMoneyLongKey, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .participateMoneyLong(liveUid, sendMoneyLongKey) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel stringResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(stringResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + + } + + public void sendMoneyLongList(String liveUid, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .sendMoneyLongList(liveUid) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>>() { + @Override + public void accept(ResponseModel> listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + throwable.printStackTrace(); + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + + } + /** * 直播间取消网络请求 */ diff --git a/common/src/main/java/com/yunbao/common/views/DragonSendMoneyListViewHolder.java b/common/src/main/java/com/yunbao/common/views/DragonSendMoneyListViewHolder.java new file mode 100644 index 000000000..adbe6137b --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/DragonSendMoneyListViewHolder.java @@ -0,0 +1,93 @@ +package com.yunbao.common.views; + +import android.os.Handler; +import android.text.TextUtils; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.makeramen.roundedimageview.RoundedImageView; +import com.yunbao.common.R; +import com.yunbao.common.bean.sendMoneyLongListModel; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.utils.StringUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class DragonSendMoneyListViewHolder extends RecyclerView.ViewHolder { + RoundedImageView live_avatar; + TextView user_nicename; + TextView gold_num; + TextView participate; + TextView send_benefits_time; + TextView send_benefits; + LinearLayout button_participate; + long mPkTimeCount2; + + public DragonSendMoneyListViewHolder(@NonNull View itemView) { + super(itemView); + live_avatar = itemView.findViewById(R.id.live_avatar); + user_nicename = itemView.findViewById(R.id.user_nicename); + gold_num = itemView.findViewById(R.id.gold_num); + button_participate = itemView.findViewById(R.id.button_participate); + participate = itemView.findViewById(R.id.participate); + send_benefits_time = itemView.findViewById(R.id.send_benefits_time); + send_benefits = itemView.findViewById(R.id.send_benefits); + } + + public void setData(sendMoneyLongListModel model, DragonSendMoneyListClicksCallBack callBack) { + ImgLoader.display(itemView.getContext(), model.getUserAvatar(), live_avatar); + user_nicename.setText(String.valueOf(model.getUserNicename())); + gold_num.setText(String.valueOf(model.getGoldNum())); + if (TextUtils.equals("0", model.getParticipate())) { + participate.setVisibility(View.VISIBLE); + send_benefits_time.setVisibility(View.GONE); + send_benefits.setVisibility(View.GONE); + button_participate.setBackgroundResource(R.mipmap.icon_participate); + } else { + participate.setVisibility(View.GONE); + send_benefits_time.setVisibility(View.VISIBLE); + send_benefits.setVisibility(View.VISIBLE); + button_participate.setBackgroundResource(R.mipmap.icon_send_benefits); + } + if (send_benefits_time.getVisibility() == View.VISIBLE) { + handler.removeCallbacks(runnable); + String s1 = StringUtil.getDurationText(mPkTimeCount2 * 1000); + send_benefits_time.setText(s1); + mPkTimeCount2 = Long.parseLong(model.getCountdown()); + handler.postDelayed(runnable, 1000); + } + ViewClicksAntiShake.clicksAntiShake(button_participate, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + if (callBack != null && TextUtils.equals("0", model.getParticipate())) { + callBack.onParticipate(model); + handler.removeCallbacks(runnable); + } + } + }); + + } + + Handler handler = new Handler(); + Runnable runnable = new Runnable() { + @Override + public void run() { + mPkTimeCount2--; + if (mPkTimeCount2 > 0) { + String s1 = StringUtil.getDurationText(mPkTimeCount2 * 1000); + send_benefits_time.setText(s1); + handler.postDelayed(runnable, 1000); + } else { + handler.removeCallbacks(runnable); + } + + } + }; + + public interface DragonSendMoneyListClicksCallBack { + void onParticipate(sendMoneyLongListModel moneyLongListModel); + } +} diff --git a/common/src/main/res/layout/view_dragon_send_money_list.xml b/common/src/main/res/layout/view_dragon_send_money_list.xml new file mode 100644 index 000000000..93ba79c73 --- /dev/null +++ b/common/src/main/res/layout/view_dragon_send_money_list.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xxhdpi/background_view_dragon_send_money_list.png b/common/src/main/res/mipmap-xxhdpi/background_view_dragon_send_money_list.png new file mode 100644 index 000000000..e2f7a78f6 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/background_view_dragon_send_money_list.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_participate.png b/common/src/main/res/mipmap-xxhdpi/icon_participate.png new file mode 100644 index 000000000..10f63b315 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_participate.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_send_benefits.png b/common/src/main/res/mipmap-xxhdpi/icon_send_benefits.png new file mode 100644 index 000000000..424718bdc Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_send_benefits.png differ diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index aa1c349ab..8cd4aac34 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1491,4 +1491,6 @@ Limited ride And limited avatar frame Expired "Now renew and enjoy guardian privileges again " Renewal Guardian + Participate + Send benefits diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index fbfdd2604..aa2432aa9 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1490,4 +1490,6 @@ 天到期 保留守護等級 重享守護特權 續費守護 + 點擊參加 + 發放福利 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 8846a8bd7..263d3e343 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1489,5 +1489,7 @@ 天到期 保留守護等級 重享守護特權 續費守護 + 點擊參加 + 發放福利 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index f4d4dc4ca..b9e367a1d 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1486,5 +1486,7 @@ 天到期 保留守護等級 重享守護特權 續費守護 + 點擊參加 + 發放福利 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 29a018b34..efa60f439 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1495,5 +1495,7 @@ Limited ride And limited avatar frame Expired Renewal Guardian You will spend %s diamonds for the anchor + Participate + Send benefits diff --git a/live/src/main/java/com/yunbao/live/dialog/DragonSendMoneyListPopup.java b/live/src/main/java/com/yunbao/live/dialog/DragonSendMoneyListPopup.java index e6ca3ec9c..40bcf57fa 100644 --- a/live/src/main/java/com/yunbao/live/dialog/DragonSendMoneyListPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/DragonSendMoneyListPopup.java @@ -4,16 +4,28 @@ import android.content.Context; import androidx.annotation.NonNull; import androidx.fragment.app.FragmentActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import com.lxj.xpopup.XPopup; +import com.yunbao.common.adapter.DragonSendMoneyListAdapter; +import com.yunbao.common.bean.sendMoneyLongListModel; import com.yunbao.common.dialog.AbsDialogPopupWindow; import com.yunbao.common.dialog.DragonRulePopup; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.views.DragonSendMoneyListViewHolder; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; +import java.util.List; + public class DragonSendMoneyListPopup extends AbsDialogPopupWindow { FragmentActivity activity; String mLiveUid; + DragonSendMoneyListAdapter dragonSendMoneyListAdapter; + RecyclerView send_money_list; public DragonSendMoneyListPopup(@NonNull Context context, String liveUid) { super(context); @@ -34,6 +46,56 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow { @Override protected void onCreate() { super.onCreate(); + send_money_list = findViewById(R.id.send_money_list); + + send_money_list.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); + dragonSendMoneyListAdapter = new DragonSendMoneyListAdapter(send_money_list); + + send_money_list.setAdapter(dragonSendMoneyListAdapter); + + dragonSendMoneyListAdapter.setCallBack(new DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack() { + @Override + public void onParticipate(sendMoneyLongListModel moneyLongListModel) { + LiveNetManager.get(mContext) + .participateMoneyLong(mLiveUid, moneyLongListModel.getSendMoneyLongKey(), new HttpCallback() { + @Override + public void onSuccess(String data) { + ToastUtil.show(data); + LiveNetManager.get(mContext) + .sendMoneyLongList(mLiveUid, new HttpCallback>() { + @Override + public void onSuccess(List data) { + dragonSendMoneyListAdapter.setMoneyLongListModels(data); + send_money_list.getRecycledViewPool().setMaxRecycledViews(0, data.size()); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + } + }); + LiveNetManager.get(mContext) + .sendMoneyLongList(mLiveUid, new HttpCallback>() { + @Override + public void onSuccess(List data) { + dragonSendMoneyListAdapter.setMoneyLongListModels(data); + send_money_list.getRecycledViewPool().setMaxRecycledViews(0, data.size()); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.dragon_rule), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 330751474..ff55970d7 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1603,7 +1603,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis // .show(); } }); - dragonImmediateParticipation.setVisibility(View.GONE); +// dragonImmediateParticipation.setVisibility(View.GONE); } private LinearLayout dragonImmediateParticipation; @@ -3153,6 +3153,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void onSendMoneyLongModel(SendMoneyLongModel sendMoneyLongModel) { dragonImmediateParticipation.setVisibility(View.VISIBLE); } + public void onSendMoneyLong() { + dragonImmediateParticipation.setVisibility(View.VISIBLE); + } /** * 设置礼物墙和周星榜 */ diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 977fa1fb6..15010da59 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -763,6 +763,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } } mLiveAudienceViewHolder.upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete()); + if (!TextUtils.isEmpty(data.getModel().getSendMoneyLongKey())){ + mLiveRoomViewHolder.onSendMoneyLong(); + } } diff --git a/live/src/main/res/layout/dialog_dragon_send_money_list.xml b/live/src/main/res/layout/dialog_dragon_send_money_list.xml index 9265a5dab..326e8215d 100644 --- a/live/src/main/res/layout/dialog_dragon_send_money_list.xml +++ b/live/src/main/res/layout/dialog_dragon_send_money_list.xml @@ -1,6 +1,7 @@ + +