From 4a7790d968d62d296f76042d9dd3d4905e9ee142 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 4 Aug 2023 10:11:03 +0800 Subject: [PATCH] =?UTF-8?q?6.5.4=E7=A4=BC=E7=89=A9=E5=86=A0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/event/GiftWallIlluminateEvent.java | 52 +++++++++++++++++++ .../live/activity/LiveAudienceActivity.java | 8 +++ .../yunbao/live/socket/SocketRyClient.java | 8 +++ .../live/views/PortraitLiveManager.java | 14 +++-- 4 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/event/GiftWallIlluminateEvent.java diff --git a/common/src/main/java/com/yunbao/common/event/GiftWallIlluminateEvent.java b/common/src/main/java/com/yunbao/common/event/GiftWallIlluminateEvent.java new file mode 100644 index 000000000..ef36b27f1 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/event/GiftWallIlluminateEvent.java @@ -0,0 +1,52 @@ +package com.yunbao.common.event; + +import com.google.gson.annotations.SerializedName; +import com.yunbao.common.bean.BaseModel; + +public class GiftWallIlluminateEvent extends BaseModel { + + @SerializedName("_method_") + private String method; + @SerializedName("action") + private String action; + @SerializedName("max_number") + private int maxNumber; + @SerializedName("new_number") + private int newNumber; + + public String getMethod() { + return method; + } + + public GiftWallIlluminateEvent setMethod(String method) { + this.method = method; + return this; + } + + public String getAction() { + return action; + } + + public GiftWallIlluminateEvent setAction(String action) { + this.action = action; + return this; + } + + public int getMaxNumber() { + return maxNumber; + } + + public GiftWallIlluminateEvent setMaxNumber(int maxNumber) { + this.maxNumber = maxNumber; + return this; + } + + public int getNewNumber() { + return newNumber; + } + + public GiftWallIlluminateEvent setNewNumber(int newNumber) { + this.newNumber = newNumber; + return this; + } +} 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 e1e3637ee..50586d85c 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -60,6 +60,7 @@ import com.yunbao.common.dialog.SlideSettingsDialog; import com.yunbao.common.dialog.YoursystemisolderDialog; import com.yunbao.common.event.CustomDrawerPopupEvent; import com.yunbao.common.event.FollowEvent; +import com.yunbao.common.event.GiftWallIlluminateEvent; import com.yunbao.common.event.JavascriptInterfaceEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; @@ -1448,6 +1449,13 @@ public class LiveAudienceActivity extends LiveActivity { } + @Subscribe(threadMode = ThreadMode.MAIN) + public void GiftWallIlluminateEvent(GiftWallIlluminateEvent event) { + if (manager != null) { + manager.setGiftWall(String.valueOf(event.getNewNumber()), String.valueOf(event.getMaxNumber())); + } + } + /** * 跳转到消息中心的系统信息web * 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 bf5362590..ae0f9eb93 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -36,6 +36,7 @@ import com.yunbao.common.bean.WishModel; import com.yunbao.common.bean.XydCompleteModel; import com.yunbao.common.event.AllServerNotifyEvent; import com.yunbao.common.event.CustomFullServiceNotifyEvent; +import com.yunbao.common.event.GiftWallIlluminateEvent; import com.yunbao.common.event.SendBlindGiftEvent; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; @@ -704,6 +705,13 @@ public class SocketRyClient { .setType(LiveAudienceEvent.LiveAudienceType.RED_PACKET_SUPER_JACKPOT) .setRedPacketInfoModel(redPacketInfoModel)); break; + case "GiftWallIlluminate": + Log.e("GiftWallIlluminate", map.toString()); + Bus.get().post(new GiftWallIlluminateEvent() + .setNewNumber(map.getInteger("new_number")) + .setMaxNumber(map.getInteger("max_number"))); + break; + } } 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 abfc9d7fb..3bf3421ec 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -49,6 +49,7 @@ import com.yunbao.common.custom.MyViewPager; import com.yunbao.common.event.AllServerNotifyEvent; import com.yunbao.common.event.FollowEvent; import com.yunbao.common.event.LiveFloatEvent; +import com.yunbao.common.event.LiveGiftDialogEvent; import com.yunbao.common.event.SendBlindGiftEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; @@ -83,7 +84,6 @@ import com.yunbao.live.dialog.BlowkissDialog; import com.yunbao.live.dialog.NewUserDialog; import com.yunbao.live.event.LinkMicTxAccEvent; import com.yunbao.live.event.LiveAudienceEvent; -import com.yunbao.common.event.LiveGiftDialogEvent; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; @@ -1912,9 +1912,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void showGiftWall(String toUid) { - if (mLiveRoomViewHolder!=null){ - mLiveRoomViewHolder.showGiftWall(toUid); - } + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.showGiftWall(toUid); + } } /** @@ -2079,4 +2079,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.setRedPacketInfoModel(redPacket); } } + + public void setGiftWall(String giftWallLightenNumber, String giftWallLightenTotal) { + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.setGiftWall(giftWallLightenNumber, giftWallLightenTotal); + } + } }