diff --git a/common/src/main/java/com/yunbao/common/bean/SendMoneyLongModel.java b/common/src/main/java/com/yunbao/common/bean/SendMoneyLongModel.java new file mode 100644 index 000000000..dfefefeb8 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/SendMoneyLongModel.java @@ -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 + '\'' + + '}'; + } +} diff --git a/common/src/main/java/com/yunbao/common/event/DragonSendsMoneyEvent.java b/common/src/main/java/com/yunbao/common/event/DragonSendsMoneyEvent.java new file mode 100644 index 000000000..ce83aa267 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/event/DragonSendsMoneyEvent.java @@ -0,0 +1,6 @@ +package com.yunbao.common.event; + +import com.yunbao.common.bean.BaseModel; + +class DragonSendsMoneyEvent extends BaseModel { +} 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 73f59bc8b..69c087c74 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -1173,4 +1173,7 @@ public interface PDLiveApi { @GET("/api/public/?service=Guard.openGuard") Observable> openGuard(@Query("liveuid") String liveUid, @Query("guard_type") String guardType, @Query("price_key") String priceKey); + + @GET("/api/public/?service=Guard.sendMoneyLong") + Observable> sendMoneyLong(@Query("liveuid") String liveUid, @Query("gold_num") String goldNum); } 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 4b032373d..df579e1e7 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 @@ -3005,6 +3005,30 @@ public class LiveNetManager { } + public void sendMoneyLong(String liveUid, String goldNum, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .sendMoneyLong(liveUid, goldNum) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel stringResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(stringResponseModel.getData().getMsg()); + } + } + }, 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/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 6cc9102c7..8846a8bd7 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1484,7 +1484,7 @@ 恭喜升級 您的守護等級已達到123級 可以領取以下獎勵 查看等級 - 為心愛的TA開通守護吧! + Open up guard for your beloved anchor! 還有 天到期 保留守護等級 重享守護特權 diff --git a/gradle.properties b/gradle.properties index 4659a6458..35e9eefed 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index bd9de8ec4..f16a24013 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -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); + } + + } /** 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 4a6d1b10b..e6ca3ec9c 100644 --- a/live/src/main/java/com/yunbao/live/dialog/DragonSendMoneyListPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/DragonSendMoneyListPopup.java @@ -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(); + } + }); + } } diff --git a/live/src/main/java/com/yunbao/live/dialog/DragonSendsMoneyPopup.java b/live/src/main/java/com/yunbao/live/dialog/DragonSendsMoneyPopup.java index 2fd06884a..1c4566119 100644 --- a/live/src/main/java/com/yunbao/live/dialog/DragonSendsMoneyPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/DragonSendsMoneyPopup.java @@ -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() { + @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(); + } } diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 9d84eba61..8bc7d7a82 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -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; } } 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 0d8856ab0..330751474 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -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); + } /** * 设置礼物墙和周星榜 */ 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 a901eee52..977fa1fb6 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -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); + } + } } 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 7bc1da83e..9265a5dab 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,5 +1,5 @@ - + + + + + android:layout_height="match_parent" + android:orientation="vertical"> - - - - - - + android:layout_marginStart="15dp" + android:layout_marginTop="20dp" + android:layout_marginEnd="15dp"> - \ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 6e8108b84..624c49422 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -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"> @@ -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">