神龙送财开启接口。展示直播间神龙送财点击参与的图标

This commit is contained in:
18401019693 2024-03-14 10:44:40 +08:00
parent 50b6deaf01
commit 3b6d586b58
15 changed files with 280 additions and 45 deletions

View File

@ -0,0 +1,113 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class SendMoneyLongModel extends BaseModel {
/**
* {
* "_method_": "SendMoneyLong",
* "action": "0",
* "uid": "98888",
* "user_nicename": "周末暴打小朋友",
* "user_avatar": "https://downs.yaoulive.com/mannine.png",
* "liveuid": "98889",
* "add_time": 1710318757,
* "gold_num": "5000"
* }
*/
@SerializedName("_method_")
private String method;
@SerializedName("action")
private String action;
@SerializedName("uid")
private String uid;
@SerializedName("user_nicename")
private String userNicename;
@SerializedName("user_avatar")
private String userAvatar;
@SerializedName("liveuid")
private String liveuid;
@SerializedName("add_time")
private int addTime;
@SerializedName("gold_num")
private String goldNum;
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getUserNicename() {
return userNicename;
}
public void setUserNicename(String userNicename) {
this.userNicename = userNicename;
}
public String getUserAvatar() {
return userAvatar;
}
public void setUserAvatar(String userAvatar) {
this.userAvatar = userAvatar;
}
public String getLiveuid() {
return liveuid;
}
public void setLiveuid(String liveuid) {
this.liveuid = liveuid;
}
public int getAddTime() {
return addTime;
}
public void setAddTime(int addTime) {
this.addTime = addTime;
}
public String getGoldNum() {
return goldNum;
}
public void setGoldNum(String goldNum) {
this.goldNum = goldNum;
}
@Override
public String toString() {
return "SendMoneyLongModel{" +
"method='" + method + '\'' +
", action='" + action + '\'' +
", uid='" + uid + '\'' +
", userNicename='" + userNicename + '\'' +
", userAvatar='" + userAvatar + '\'' +
", liveuid='" + liveuid + '\'' +
", addTime=" + addTime +
", goldNum='" + goldNum + '\'' +
'}';
}
}

View File

@ -0,0 +1,6 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
class DragonSendsMoneyEvent extends BaseModel {
}

View File

@ -1173,4 +1173,7 @@ public interface PDLiveApi {
@GET("/api/public/?service=Guard.openGuard")
Observable<ResponseModel<Object>> openGuard(@Query("liveuid") String liveUid, @Query("guard_type") String guardType, @Query("price_key") String priceKey);
@GET("/api/public/?service=Guard.sendMoneyLong")
Observable<ResponseModel<Object>> sendMoneyLong(@Query("liveuid") String liveUid, @Query("gold_num") String goldNum);
}

View File

@ -3005,6 +3005,30 @@ public class LiveNetManager {
}
public void sendMoneyLong(String liveUid, String goldNum, HttpCallback<String> callback) {
API.get().pdLiveApi(mContext)
.sendMoneyLong(liveUid, goldNum)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<Object>>() {
@Override
public void accept(ResponseModel<Object> stringResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(stringResponseModel.getData().getMsg());
}
}
}, 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

@ -1484,7 +1484,7 @@
<string name="congratulations_on_the_promotion">恭喜升級</string>
<string name="guard_level_has_been_reached">您的守護等級已達到123級 可以領取以下獎勵</string>
<string name="view_grade">查看等級</string>
<string name="guard_for_your_beloved_one">為心愛的TA開通守護吧</string>
<string name="guard_for_your_beloved_one">Open up guard for your beloved anchor!</string>
<string name="due_in">還有</string>
<string name="due_in_guard">天到期</string>
<string name="continuative_guardian_privilege2">保留守護等級 重享守護特權</string>

View File

@ -23,6 +23,8 @@ android.enableJetifier=true
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=7890
systemProp.http.proxyPort=7890
#systemProp.https.proxyPort=7890
#systemProp.http.proxyPort=7890
systemProp.https.proxyPort=10809
systemProp.http.proxyPort=10809
#android.enableR8.fullMode=true

View File

@ -53,6 +53,7 @@ import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.bean.LiveRoomVoteModel;
import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.common.bean.LiveUserMailBoxModel;
import com.yunbao.common.bean.SendMoneyLongModel;
import com.yunbao.common.bean.SlideInfoModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.dialog.EffectsSettingsDialog;
@ -1929,6 +1930,16 @@ public class LiveAudienceActivity extends LiveActivity {
}, 3000);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSendMoneyLongModel(SendMoneyLongModel sendMoneyLongModel) {
Log.e("DateRemindModel", sendMoneyLongModel.toString());
if (manager != null) {
manager.onSendMoneyLongModel(sendMoneyLongModel);
}
}
/**

View File

@ -7,6 +7,8 @@ import androidx.fragment.app.FragmentActivity;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.dialog.DragonRulePopup;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
@ -28,4 +30,23 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow {
public int bindLayoutId() {
return R.layout.dialog_dragon_send_money_list;
}
@Override
protected void onCreate() {
super.onCreate();
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.dragon_rule), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
new XPopup.Builder(getContext())
.asCustom(new DragonRulePopup(getContext()))
.show();
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.money_back), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
}
});
}
}

View File

@ -14,6 +14,7 @@ import com.lxj.xpopup.core.CenterPopupView;
import com.yunbao.common.dialog.DragonRulePopup;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -50,7 +51,8 @@ public class DragonSendsMoneyPopup extends CenterPopupView {
public void onViewClicks() {
dismiss();
}
}); ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.dragon_rule), new ViewClicksAntiShake.ViewClicksCallBack() {
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.dragon_rule), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
new XPopup.Builder(getContext())
@ -64,19 +66,32 @@ public class DragonSendsMoneyPopup extends CenterPopupView {
String dragonMoney = dragon_money.getText().toString().trim();
if (!TextUtils.isEmpty(dragonMoney)) {
long money = Long.parseLong(dragonMoney);
if (goldMoney>money){
if (goldMoney > money) {
LiveNetManager.get(getContext())
.sendMoneyLong(mLiveUid, String.valueOf(money), new com.yunbao.common.http.base.HttpCallback<String>() {
@Override
public void onSuccess(String data) {
dismiss();
}else {
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
} else {
ToastUtil.show(WordUtil.isNewZh() ? "輸入數量不能大於自己的金豆總數量" : "The input quantity cannot be greater than the total number of gold beans");
}
}else {
ToastUtil.show(WordUtil.isNewZh() ? "輸入數量不能大於自己的金豆總數量" : "The input quantity cannot be greater than the total number of gold beans");
} else {
ToastUtil.show(WordUtil.isNewZh() ? "輸入數量不能爲空" : "The input quantity cannot be empty");
}
}
});
getCoin();
}
private void getCoin() {
@ -96,4 +111,8 @@ public class DragonSendsMoneyPopup extends CenterPopupView {
});
}
public interface DragonSendsMoneyCallBack {
void onSendMoneyLong();
}
}

View File

@ -31,6 +31,7 @@ import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.RedPacketInfoModel;
import com.yunbao.common.bean.RedPacketModel;
import com.yunbao.common.bean.SendMoneyLongModel;
import com.yunbao.common.bean.SocketModel;
import com.yunbao.common.bean.SudGameDateModel;
import com.yunbao.common.bean.UserBean;
@ -802,6 +803,10 @@ public class SocketRyClient {
GuardMaturityDateRemindModel maturityDateRemindModel = GsonUtils.fromJson(map.toString(), GuardMaturityDateRemindModel.class);
Bus.get().post(maturityDateRemindModel);
break;
case "SendMoneyLong":
SendMoneyLongModel sendMoneyLongModel = GsonUtils.fromJson(map.toString(), SendMoneyLongModel.class);
Bus.get().post(sendMoneyLongModel);
break;
}
}

View File

@ -91,6 +91,7 @@ import com.yunbao.common.bean.RankHourModel;
import com.yunbao.common.bean.RedPacketInfoModel;
import com.yunbao.common.bean.RedPacketModel;
import com.yunbao.common.bean.RewardAllModel;
import com.yunbao.common.bean.SendMoneyLongModel;
import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.SudGameDateModel;
import com.yunbao.common.bean.TaskModel;
@ -161,6 +162,7 @@ import com.yunbao.live.bean.LiveWishlistBean;
import com.yunbao.live.bean.WishlistItemModel;
import com.yunbao.live.custom.LiveLightView;
import com.yunbao.live.custom.RightGradual;
import com.yunbao.live.dialog.DragonSendMoneyListPopup;
import com.yunbao.live.dialog.DragonSendsMoneyPopup;
import com.yunbao.live.dialog.GiftWallDialog;
import com.yunbao.live.dialog.GuardUpgradePopup;
@ -1595,12 +1597,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
ViewClicksAntiShake.clicksAntiShake(dragonImmediateParticipation, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
// new DragonSendMoneyListPopup(mContext, mLiveUid).showDialog();
new XPopup.Builder(mContext)
.asCustom(new GuardUpgradePopup(mContext, mLiveUid))
.show();
new DragonSendMoneyListPopup(mContext, mLiveUid).showDialog();
// new XPopup.Builder(mContext)
// .asCustom(new GuardUpgradePopup(mContext, mLiveUid))
// .show();
}
});
dragonImmediateParticipation.setVisibility(View.GONE);
}
private LinearLayout dragonImmediateParticipation;
@ -3147,7 +3150,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
gift_svga.setVisibility(View.VISIBLE);
}
}
public void onSendMoneyLongModel(SendMoneyLongModel sendMoneyLongModel) {
dragonImmediateParticipation.setVisibility(View.VISIBLE);
}
/**
* 设置礼物墙和周星榜
*/

View File

@ -43,6 +43,7 @@ import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.bean.RedPacketInfoModel;
import com.yunbao.common.bean.RedPacketModel;
import com.yunbao.common.bean.SendMoneyLongModel;
import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.SudGameDateModel;
import com.yunbao.common.bean.UserBean;
@ -2204,4 +2205,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
public boolean isEnterRoom() {
return isEnterRoom;
}
public void onSendMoneyLongModel(SendMoneyLongModel sendMoneyLongModel) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.onSendMoneyLongModel(sendMoneyLongModel);
}
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:layout_width="match_parent"
android:layout_height="450dp"
@ -8,36 +8,55 @@
android:orientation="vertical">
<FrameLayout
android:id="@+id/money_back"
android:layout_width="50dp"
android:layout_height="50dp" />
<FrameLayout
android:id="@+id/dragon_rule"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="end" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="15dp">
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@mipmap/icon_live_dragon_money_back" />
<ImageView
android:id="@+id/dragon_rule"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="end"
android:src="@mipmap/icon_dragon_rule" />
<com.flyjingfish.gradienttextviewlib.GradientTextView
android:id="@+id/title"
android:layout_width="wrap_content"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:letterSpacing="0.1"
android:text="@string/dragon_sends_money"
android:textSize="18sp"
android:textStyle="bold"
app:gradient_angle="45"
app:gradient_endColor="#F9D78F"
app:gradient_startColor="#E59F1F" />
</FrameLayout>
android:layout_marginStart="15dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="15dp">
</LinearLayout>
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@mipmap/icon_live_dragon_money_back" />
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="end"
android:src="@mipmap/icon_dragon_rule" />
<com.flyjingfish.gradienttextviewlib.GradientTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:letterSpacing="0.1"
android:text="@string/dragon_sends_money"
android:textSize="18sp"
android:textStyle="bold"
app:gradient_angle="45"
app:gradient_endColor="#F9D78F"
app:gradient_startColor="#E59F1F" />
</FrameLayout>
</LinearLayout>
</FrameLayout>

View File

@ -2550,6 +2550,7 @@
android:id="@+id/dragon_immediate_participation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginStart="10dp"
android:layout_marginTop="180dp"
android:gravity="center"
@ -2579,6 +2580,7 @@
android:layout_marginStart="10dp"
android:layout_marginTop="120dp"
android:gravity="center"
android:visibility="gone"
android:orientation="vertical">
<ImageView

View File

@ -535,7 +535,6 @@
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center|left"
android:orientation="vertical"
android:paddingLeft="18dp"
android:paddingRight="6dp">
@ -613,7 +612,6 @@
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center|left"
android:orientation="vertical"
android:paddingLeft="18dp"
android:paddingRight="6dp">