diff --git a/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java b/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java index 48521ff5d..ec62f429c 100644 --- a/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java +++ b/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java @@ -51,8 +51,8 @@ public class NobleNoticeView extends FrameLayout { private SVGAImageView svagaBc; private RelativeLayout rootLayout; private long animationTime = 8000; - private TextView gotoRoomView, nobleNickname; - private String mSvgaName; + private TextView gotoRoomView, nobleNickname, userName, anchorNickname; + private String mSvgaName, uhead,anchorUid; private RoleType roleType; private HorizontalScrollView contextLayout; private RelativeLayout scrollLayout; @@ -83,10 +83,20 @@ public class NobleNoticeView extends FrameLayout { scrollLayout = rootView.findViewById(R.id.scroll_layout); nobleIcon = rootView.findViewById(R.id.noble_icon); nobleNickname = rootView.findViewById(R.id.noble_nickname); + userName = rootView.findViewById(R.id.user_name); + anchorNickname = rootView.findViewById(R.id.anchor_nickname); contextLayout.setVisibility(GONE); gotoRoomView.setVisibility(GONE); } + public NobleNoticeView setRootView(String uHead, String userNameStr, String anchorNicknameStr, String anchorUid) { + this.uhead = uHead; + this.anchorUid = anchorUid; + userName.setText(userNameStr); + anchorNickname.setText(anchorNicknameStr); + return this; + } + /** * 设置展示的类型 * @@ -145,7 +155,7 @@ public class NobleNoticeView extends FrameLayout { public void subscribe(ObservableEmitter emitter) throws Exception { Bitmap bitmap = BitmapUtil.getInstance() .getBitmap(mContext, - "https://downs.yaoulive.com/20220818/372776fa38774814d601e68fcfc70f35.jpeg?imageView2/2/w/600/h/600", + uhead, 174, 174, 87); 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 38a47d21d..1c2fa184c 100644 --- a/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java +++ b/live/src/main/java/com/yunbao/live/bean/LiveReceiveGiftBean.java @@ -50,8 +50,47 @@ public class LiveReceiveGiftBean { private String nobilityid; private String nobilityname; private String opentype; + private String anchorUid; + + public String getAnchorUid() { + return anchorUid; + } + + public LiveReceiveGiftBean setAnchorUid(String anchorUid) { + this.anchorUid = anchorUid; + return this; + } private int sendtype; + private String uhead; + private String uname; + + public String getUname() { + return uname; + } + + public LiveReceiveGiftBean setUname(String uname) { + this.uname = uname; + return this; + } + + public String getUhead() { + return uhead; + } + + public LiveReceiveGiftBean setUhead(String uhead) { + this.uhead = uhead; + return this; + } + + public LiveChatBean getmLiveChatBean() { + return mLiveChatBean; + } + + public LiveReceiveGiftBean setmLiveChatBean(LiveChatBean mLiveChatBean) { + this.mLiveChatBean = mLiveChatBean; + return this; + } public int getSendtype() { return sendtype; diff --git a/live/src/main/java/com/yunbao/live/socket/SocketClient.java b/live/src/main/java/com/yunbao/live/socket/SocketClient.java index e0c13751c..04db014d1 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketClient.java @@ -382,6 +382,8 @@ public class SocketClient { receiveGiftBean.setNobilityname(map.getString("nobilityname")); receiveGiftBean.setOpentype(map.getString("opentype")); receiveGiftBean.setSendtype(map.getIntValue("action")); + receiveGiftBean.setSendtype(map.getIntValue("uname")); + receiveGiftBean.setSendtype(map.getIntValue("uhead")); if (map.getString("notice").equals("1")) { LiveRoomViewHolder.paygzGif(map.getString("special_src"), map.getString("anchorUid")); } 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 d4e5074fd..89a830321 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -547,6 +547,9 @@ public class SocketRyClient { receiveGiftBean.setNobilityname(map.getString("nobilityname")); receiveGiftBean.setOpentype(map.getString("opentype")); receiveGiftBean.setSendtype(map.getIntValue("action")); + receiveGiftBean.setSendtype(map.getIntValue("action")); + receiveGiftBean.setUname(map.getString("uname")); + receiveGiftBean.setUhead(map.getString("uhead")); if (map.getString("notice").equals("1")) { LiveRoomViewHolder.paygzGif(map.getString("special_src"), map.getString("anchorUid")); } 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 31cbbc916..c688546ea 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -81,6 +81,7 @@ import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.views.AbsViewHolder; import com.yunbao.common.views.weight.FullServiceNotificationView; +import com.yunbao.common.views.weight.NobleNoticeView; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; @@ -289,6 +290,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private TextView msgNumber;//悬浮窗左上角数标 private RoundedImageView msgUserIcon; //悬浮窗icon private FullServiceNotificationView fullScreen;//全副喇叭 + private NobleNoticeView noble;//全副喇叭 public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) { super(context, parentView); @@ -613,6 +615,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis EventBus.getDefault().register(this); btnEvent = findViewById(R.id.btn_event); fullScreen = (FullServiceNotificationView) findViewById(R.id.full_screen); + noble = (NobleNoticeView) findViewById(R.id.noble); btnEvent3 = findViewById(R.id.btn_event3); imgEvent = (ImageView) findViewById(R.id.img_event); btn_event2 = (LinearLayout) findViewById(R.id.btn_event2); @@ -952,12 +955,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis findViewById(R.id.wish_list_layout).setEnabled(false);*/ findViewById(R.id.open_sidebar).setVisibility(View.GONE); findViewById(R.id.btn_follow).setVisibility(View.GONE); - }else { + } else { configBanner3(); } reloadIM(); } - public void hideFloatMsg(){ + + public void hideFloatMsg() { msg.setVisibility(View.GONE); } @@ -1741,7 +1745,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * @param in 展示的view */ private void changeMsgView(View out, View in) { - if(mContext instanceof LiveRyAnchorActivity){ + if (mContext instanceof LiveRyAnchorActivity) { return; } if (in.getVisibility() == View.VISIBLE) { @@ -2255,6 +2259,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis /** * 开通贵族的全服通知 + * * @param bean */ public void showBuyVipMessage(LiveReceiveGiftBean bean) { @@ -2262,6 +2267,58 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis // mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager); // } // mLiveGiftAnimPresenter.showBuyVipGiftAnim(bean); + + switch (bean.getNobilityid()) { + case "1": + noble.setRootView(bean.getUhead(), + bean.getUname(), + bean.getAncherName(), + bean.getAnchorUid()) + .setRoleType(NobleNoticeView.RoleType.BARON); + break; + case "2": + noble.setRootView(bean.getUhead(), + bean.getUname(), + bean.getAncherName(), + bean.getAnchorUid()) + .setRoleType(NobleNoticeView.RoleType.VISCOUNT); + break; + case "3": + noble.setRootView(bean.getUhead(), + bean.getUname(), + bean.getAncherName(), + bean.getAnchorUid()) + .setRoleType(NobleNoticeView.RoleType.MARQUIS); + break; + case "4": + noble.setRootView(bean.getUhead(), + bean.getUname(), + bean.getAncherName(), + bean.getAnchorUid()) + .setRoleType(NobleNoticeView.RoleType.DUKE); + break; + case "5": + noble.setRootView(bean.getUhead(), + bean.getUname(), + bean.getAncherName(), + bean.getAnchorUid()) + .setRoleType(NobleNoticeView.RoleType.KING); + break; + case "6": + noble.setRootView(bean.getUhead(), + bean.getUname(), + bean.getAncherName(), + bean.getAnchorUid()) + .setRoleType(NobleNoticeView.RoleType.EMPEROR); + break; + case "7": + noble.setRootView(bean.getUhead(), + bean.getUname(), + bean.getAncherName(), + bean.getAnchorUid()) + .setRoleType(NobleNoticeView.RoleType.BETTER_EMPEROR); + break; + } } public void showSysMessage(LiveReceiveGiftBean bean) { diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 2a5e4f895..6bc497f37 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -2085,4 +2085,11 @@ android:layout_height="wrap_content" android:layout_below="@id/live_video" /> + + \ No newline at end of file diff --git a/main/src/main/res/layout/activity_entry.xml b/main/src/main/res/layout/activity_entry.xml index af31c49e5..68c62a25f 100644 --- a/main/src/main/res/layout/activity_entry.xml +++ b/main/src/main/res/layout/activity_entry.xml @@ -241,9 +241,4 @@ android:layout_marginTop="80dp" android:src="@mipmap/white_logo" /> - \ No newline at end of file