神龙列表接口对接,神龙送财活动参加接口对接,ui更新

This commit is contained in:
18401019693 2024-03-14 16:39:04 +08:00
parent 3b6d586b58
commit 1981fb553a
21 changed files with 730 additions and 4 deletions

View File

@ -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<sendMoneyLongListModel> moneyLongListModels = new ArrayList<>();
DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack callBack;
public void setCallBack(DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack callBack) {
this.callBack = callBack;
}
public void setMoneyLongListModels(List<sendMoneyLongListModel> 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);
}
}

View File

@ -43,6 +43,17 @@ public class EnterRoomNewModel extends BaseModel {
private int quickGiftRemainingQuantity;//剩余的小PD礼物数量 private int quickGiftRemainingQuantity;//剩余的小PD礼物数量
@SerializedName("if_viewing_duration_complete") @SerializedName("if_viewing_duration_complete")
private int ifViewingDurationComplete;//通过观看时间获取小PD礼物的次数 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() { public int getQuickGiftRemainingQuantity() {
return quickGiftRemainingQuantity; return quickGiftRemainingQuantity;

View File

@ -29,7 +29,7 @@ public class SendMoneyLongModel extends BaseModel {
@SerializedName("liveuid") @SerializedName("liveuid")
private String liveuid; private String liveuid;
@SerializedName("add_time") @SerializedName("add_time")
private int addTime; private String addTime;
@SerializedName("gold_num") @SerializedName("gold_num")
private String goldNum; private String goldNum;
@ -81,11 +81,11 @@ public class SendMoneyLongModel extends BaseModel {
this.liveuid = liveuid; this.liveuid = liveuid;
} }
public int getAddTime() { public String getAddTime() {
return addTime; return addTime;
} }
public void setAddTime(int addTime) { public void setAddTime(String addTime) {
this.addTime = addTime; this.addTime = addTime;
} }

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -73,6 +73,7 @@ import com.yunbao.common.bean.UserAvatarSelectBean;
import com.yunbao.common.bean.VipModel; import com.yunbao.common.bean.VipModel;
import com.yunbao.common.bean.WishListGiftConfModel; import com.yunbao.common.bean.WishListGiftConfModel;
import com.yunbao.common.bean.WishListModel; import com.yunbao.common.bean.WishListModel;
import com.yunbao.common.bean.sendMoneyLongListModel;
import com.yunbao.common.event.CheckCurrencyModel; import com.yunbao.common.event.CheckCurrencyModel;
import java.util.List; import java.util.List;
@ -1176,4 +1177,10 @@ public interface PDLiveApi {
@GET("/api/public/?service=Guard.sendMoneyLong") @GET("/api/public/?service=Guard.sendMoneyLong")
Observable<ResponseModel<Object>> sendMoneyLong(@Query("liveuid") String liveUid, @Query("gold_num") String goldNum); Observable<ResponseModel<Object>> sendMoneyLong(@Query("liveuid") String liveUid, @Query("gold_num") String goldNum);
@GET("/api/public/?service=Guard.sendMoneyLongList")
Observable<ResponseModel<List<sendMoneyLongListModel>>> sendMoneyLongList(@Query("liveuid") String liveUid);
@GET("/api/public/?service=Guard.participateMoneyLong")
Observable<ResponseModel<String>> participateMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
} }

View File

@ -69,6 +69,7 @@ import com.yunbao.common.bean.UserAvatarSelectBean;
import com.yunbao.common.bean.VipModel; import com.yunbao.common.bean.VipModel;
import com.yunbao.common.bean.WishListGiftConfModel; import com.yunbao.common.bean.WishListGiftConfModel;
import com.yunbao.common.bean.WishListModel; import com.yunbao.common.bean.WishListModel;
import com.yunbao.common.bean.sendMoneyLongListModel;
import com.yunbao.common.event.CheckCurrencyModel; import com.yunbao.common.event.CheckCurrencyModel;
import com.yunbao.common.http.API; import com.yunbao.common.http.API;
import com.yunbao.common.http.ResponseModel; import com.yunbao.common.http.ResponseModel;
@ -3029,6 +3030,54 @@ public class LiveNetManager {
} }
public void participateMoneyLong(String liveUid, String sendMoneyLongKey, HttpCallback<String> callback) {
API.get().pdLiveApi(mContext)
.participateMoneyLong(liveUid, sendMoneyLongKey)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<String>>() {
@Override
public void accept(ResponseModel<String> stringResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(stringResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@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<List<sendMoneyLongListModel>> callback) {
API.get().pdLiveApi(mContext)
.sendMoneyLongList(liveUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<sendMoneyLongListModel>>>() {
@Override
public void accept(ResponseModel<List<sendMoneyLongListModel>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
/** /**
* 直播间取消网络请求 * 直播间取消网络请求
*/ */

View File

@ -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);
}
}

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_marginStart="15dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="15dp"
android:background="@mipmap/background_view_dragon_send_money_list"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.9"
android:gravity="center_vertical">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/live_avatar"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="12dp"
android:scaleType="centerCrop"
android:src="@mipmap/icon_male_default"
app:riv_oval="true" />
<TextView
android:id="@+id/user_nicename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:ellipsize="end"
android:maxEms="7"
android:maxLines="1"
android:text="465464654654654654564654654654564564654654654564564564654654654654654"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical">
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@mipmap/gold_coin" />
<TextView
android:id="@+id/gold_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:ellipsize="end"
android:maxEms="4"
android:maxLines="1"
android:text="465464654654654654564654654654564564654654654564564564654654654654654"
android:textColor="@color/white"
android:textSize="14sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<LinearLayout
android:id="@+id/button_participate"
android:layout_width="85dp"
android:layout_height="47dp"
android:layout_marginEnd="10dp"
android:background="@mipmap/icon_participate"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/participate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/participate"
android:textColor="@color/white"
android:textSize="11sp"
android:visibility="gone" />
<TextView
android:id="@+id/send_benefits_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="03:20"
android:textColor="#31261F"
android:textSize="14sp" />
<TextView
android:id="@+id/send_benefits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_benefits"
android:textColor="#31261F"
android:textSize="11sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -1491,4 +1491,6 @@ Limited ride And limited avatar frame</string>
<string name="due_in_guard">Expired</string> <string name="due_in_guard">Expired</string>
<string name="continuative_guardian_privilege2">"Now renew and enjoy guardian privileges again "</string> <string name="continuative_guardian_privilege2">"Now renew and enjoy guardian privileges again "</string>
<string name="renewal_guardian">Renewal Guardian</string> <string name="renewal_guardian">Renewal Guardian</string>
<string name="participate">Participate</string>
<string name="send_benefits">Send benefits</string>
</resources> </resources>

View File

@ -1490,4 +1490,6 @@
<string name="due_in_guard">天到期</string> <string name="due_in_guard">天到期</string>
<string name="continuative_guardian_privilege2">保留守護等級 重享守護特權</string> <string name="continuative_guardian_privilege2">保留守護等級 重享守護特權</string>
<string name="renewal_guardian">續費守護</string> <string name="renewal_guardian">續費守護</string>
<string name="participate">點擊參加</string>
<string name="send_benefits">發放福利</string>
</resources> </resources>

View File

@ -1489,5 +1489,7 @@
<string name="due_in_guard">天到期</string> <string name="due_in_guard">天到期</string>
<string name="continuative_guardian_privilege2">保留守護等級 重享守護特權</string> <string name="continuative_guardian_privilege2">保留守護等級 重享守護特權</string>
<string name="renewal_guardian">續費守護</string> <string name="renewal_guardian">續費守護</string>
<string name="participate">點擊參加</string>
<string name="send_benefits">發放福利</string>
</resources> </resources>

View File

@ -1486,5 +1486,7 @@
<string name="due_in_guard">天到期</string> <string name="due_in_guard">天到期</string>
<string name="continuative_guardian_privilege2">保留守護等級 重享守護特權</string> <string name="continuative_guardian_privilege2">保留守護等級 重享守護特權</string>
<string name="renewal_guardian">續費守護</string> <string name="renewal_guardian">續費守護</string>
<string name="participate">點擊參加</string>
<string name="send_benefits">發放福利</string>
</resources> </resources>

View File

@ -1495,5 +1495,7 @@ Limited ride And limited avatar frame</string>
<string name="due_in_guard">Expired</string> <string name="due_in_guard">Expired</string>
<string name="renewal_guardian">Renewal Guardian</string> <string name="renewal_guardian">Renewal Guardian</string>
<string name="guard_buy_tips_1">You will spend %s diamonds for the anchor</string> <string name="guard_buy_tips_1">You will spend %s diamonds for the anchor</string>
<string name="participate">Participate</string>
<string name="send_benefits">Send benefits</string>
</resources> </resources>

View File

@ -4,16 +4,28 @@ import android.content.Context;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup; 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.AbsDialogPopupWindow;
import com.yunbao.common.dialog.DragonRulePopup; 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.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R; import com.yunbao.live.R;
import java.util.List;
public class DragonSendMoneyListPopup extends AbsDialogPopupWindow { public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
FragmentActivity activity; FragmentActivity activity;
String mLiveUid; String mLiveUid;
DragonSendMoneyListAdapter dragonSendMoneyListAdapter;
RecyclerView send_money_list;
public DragonSendMoneyListPopup(@NonNull Context context, String liveUid) { public DragonSendMoneyListPopup(@NonNull Context context, String liveUid) {
super(context); super(context);
@ -34,6 +46,56 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
@Override @Override
protected void onCreate() { protected void onCreate() {
super.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<String>() {
@Override
public void onSuccess(String data) {
ToastUtil.show(data);
LiveNetManager.get(mContext)
.sendMoneyLongList(mLiveUid, new HttpCallback<List<sendMoneyLongListModel>>() {
@Override
public void onSuccess(List<sendMoneyLongListModel> 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<List<sendMoneyLongListModel>>() {
@Override
public void onSuccess(List<sendMoneyLongListModel> 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() { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.dragon_rule), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {

View File

@ -1603,7 +1603,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
// .show(); // .show();
} }
}); });
dragonImmediateParticipation.setVisibility(View.GONE); // dragonImmediateParticipation.setVisibility(View.GONE);
} }
private LinearLayout dragonImmediateParticipation; private LinearLayout dragonImmediateParticipation;
@ -3153,6 +3153,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void onSendMoneyLongModel(SendMoneyLongModel sendMoneyLongModel) { public void onSendMoneyLongModel(SendMoneyLongModel sendMoneyLongModel) {
dragonImmediateParticipation.setVisibility(View.VISIBLE); dragonImmediateParticipation.setVisibility(View.VISIBLE);
} }
public void onSendMoneyLong() {
dragonImmediateParticipation.setVisibility(View.VISIBLE);
}
/** /**
* 设置礼物墙和周星榜 * 设置礼物墙和周星榜
*/ */

View File

@ -763,6 +763,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
} }
mLiveAudienceViewHolder.upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete()); mLiveAudienceViewHolder.upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
if (!TextUtils.isEmpty(data.getModel().getSendMoneyLongKey())){
mLiveRoomViewHolder.onSendMoneyLong();
}
} }

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="450dp" android:layout_height="450dp"
android:layout_gravity="bottom" android:layout_gravity="bottom"
@ -56,6 +57,16 @@
app:gradient_endColor="#F9D78F" app:gradient_endColor="#F9D78F"
app:gradient_startColor="#E59F1F" /> app:gradient_startColor="#E59F1F" />
</FrameLayout> </FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/send_money_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="4"
android:paddingBottom="12dp"
tools:listitem="@layout/view_dragon_send_money_list" />
</LinearLayout> </LinearLayout>