From 49810407ce13e2a7822452935296c0bc029656f5 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 4 Aug 2023 09:47:42 +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 --- .../utils/JavascriptInterfaceUtils.java | 2 +- common/src/main/res/values/strings.xml | 1 + .../yunbao/live/bean/LiveReceiveGiftBean.java | 81 +++++++++++++++++++ .../yunbao/live/socket/SocketRyClient.java | 4 + .../yunbao/live/views/LiveGiftViewHolder.java | 12 ++- .../main/res/drawable/background_naming.xml | 9 +++ .../res/drawable/background_naming_icon.xml | 9 +++ live/src/main/res/layout/view_live_gift.xml | 12 +++ 8 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 live/src/main/res/drawable/background_naming.xml create mode 100644 live/src/main/res/drawable/background_naming_icon.xml diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 271b7c43a..41f967ed3 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -550,7 +550,7 @@ public class JavascriptInterfaceUtils { } @JavascriptInterface - public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl,String toUid) { + public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl) { RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0); } } diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 14234c036..46c21fc10 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1298,5 +1298,6 @@ Limited ride And limited avatar frame 成就詳情 冠名主播: 冠名金主: + 冠名 diff --git a/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java b/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java index af542556d..e505b5fc9 100644 --- a/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java +++ b/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java @@ -54,6 +54,87 @@ public class LiveReceiveGiftBean extends BaseModel { private String opentype; private String anchorUid; private boolean isBlindBox = false; + private String namingLiveuid; + private String namingUid; + private String namingLiveName; + private String namingUserName; + private String namingLiveAvatar; + private String namingUserAvatar; + private String namingStatus; + private String namingCoin; + + public String getNamingLiveuid() { + return namingLiveuid; + } + + public LiveReceiveGiftBean setNamingLiveuid(String namingLiveuid) { + this.namingLiveuid = namingLiveuid; + return this; + } + + public String getNamingUid() { + return namingUid; + } + + public LiveReceiveGiftBean setNamingUid(String namingUid) { + this.namingUid = namingUid; + return this; + } + + public String getNamingLiveName() { + return namingLiveName; + } + + public LiveReceiveGiftBean setNamingLiveName(String namingLiveName) { + this.namingLiveName = namingLiveName; + return this; + } + + public String getNamingUserName() { + return namingUserName; + } + + public LiveReceiveGiftBean setNamingUserName(String namingUserName) { + this.namingUserName = namingUserName; + return this; + } + + public String getNamingLiveAvatar() { + return namingLiveAvatar; + } + + public LiveReceiveGiftBean setNamingLiveAvatar(String namingLiveAvatar) { + this.namingLiveAvatar = namingLiveAvatar; + return this; + } + + public String getNamingUserAvatar() { + return namingUserAvatar; + } + + public LiveReceiveGiftBean setNamingUserAvatar(String namingUserAvatar) { + this.namingUserAvatar = namingUserAvatar; + return this; + } + + public String getNamingStatus() { + return namingStatus; + } + + public LiveReceiveGiftBean setNamingStatus(String namingStatus) { + this.namingStatus = namingStatus; + return this; + } + + public String getNamingCoin() { + return namingCoin; + } + + public LiveReceiveGiftBean setNamingCoin(String namingCoin) { + this.namingCoin = namingCoin; + return this; + } + private AllServerNotifyEvent event = new AllServerNotifyEvent(); public AllServerNotifyEvent getEvent() { 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 427a8439a..bf5362590 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -1031,6 +1031,10 @@ public class SocketRyClient { receiveGiftBean.setAncherName(map.getString("ancherName")); receiveGiftBean.setHot_num(map.getString("hot_num")); receiveGiftBean.setDrpk_status(map.getString("drpk_status")); + receiveGiftBean.setNamingCoin(map.getString("naming_live_name")); + receiveGiftBean.setNamingLiveName(map.getString("naming_live_name")); + receiveGiftBean.setNamingUid(map.getString("naming_uid")); + receiveGiftBean.setNamingLiveuid(map.getString("naming_liveuid")); receiveGiftBean.setmLiveUId(mLiveUid); receiveGiftBean.setmTypeBuyGuard(false); receiveGiftBean.setAllServerNotify(false); diff --git a/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java index 65da01f37..a36e27ca8 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveGiftViewHolder.java @@ -30,7 +30,7 @@ import com.yunbao.live.utils.LiveTextRender; public class LiveGiftViewHolder extends AbsViewHolder { - private View mRoot; + private View mRoot, root_back; private View mBg; private View mStar; private ImageView mAvatar; @@ -62,6 +62,7 @@ public class LiveGiftViewHolder extends AbsViewHolder { @Override public void init() { mRoot = findViewById(R.id.root); + root_back = findViewById(R.id.root_back); mBg = findViewById(R.id.bg); mStar = findViewById(R.id.star); mAvatar = (ImageView) findViewById(R.id.avatar); @@ -127,7 +128,7 @@ public class LiveGiftViewHolder extends AbsViewHolder { * 显示礼物动画 */ public void show(LiveReceiveGiftBean bean, boolean isSameUser) { - if (bean.getMark()==3) {//这是幸运礼物 + if (bean.getMark() == 3) {//这是幸运礼物 if (!mIdle) { hideNormal(); } @@ -177,6 +178,13 @@ public class LiveGiftViewHolder extends AbsViewHolder { mGiftCount.setText(new LiveTextRender().renderGiftCount(mLianCount)); } mLastGiftKey = bean.getKey(); + if (!TextUtils.equals(bean.getNamingLiveuid(), "0") && !TextUtils.equals(bean.getNamingUid(), "0")) { + root_back.setBackgroundResource(R.drawable.background_naming); + findViewById(R.id.naming_icon).setVisibility(View.VISIBLE); + } else { + root_back.setBackgroundResource(R.mipmap.icon_live_gift_anim_3); + findViewById(R.id.naming_icon).setVisibility(View.GONE); + } if (lian && mGiftCount != null && mAnimation != null) { mGiftCount.startAnimation(mAnimation); } diff --git a/live/src/main/res/drawable/background_naming.xml b/live/src/main/res/drawable/background_naming.xml new file mode 100644 index 000000000..f2b43bce8 --- /dev/null +++ b/live/src/main/res/drawable/background_naming.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/background_naming_icon.xml b/live/src/main/res/drawable/background_naming_icon.xml new file mode 100644 index 000000000..fb9f5a989 --- /dev/null +++ b/live/src/main/res/drawable/background_naming_icon.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_live_gift.xml b/live/src/main/res/layout/view_live_gift.xml index 333498664..8cb71f034 100644 --- a/live/src/main/res/layout/view_live_gift.xml +++ b/live/src/main/res/layout/view_live_gift.xml @@ -8,6 +8,7 @@ android:visibility="invisible"> +