From 0ed37aee111c3660610683a87a9c56301019e2bd Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 14 Apr 2023 10:40:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/socket/SocketRyClient.java | 1 + .../yunbao/live/views/LiveRoomViewHolder.java | 18 ++++++++++++++---- .../yunbao/live/views/PortraitLiveManager.java | 12 +++++++++--- live/src/main/res/layout/view_live_room.xml | 2 ++ 4 files changed, 26 insertions(+), 7 deletions(-) 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 8256c2681..0d0ecdf50 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -302,6 +302,7 @@ public class SocketRyClient { ); } + } else if (action3 == 5) { // endDRGif(); LiveRoomViewHolder.d_pk_view.setVisibility(View.GONE); 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 7f01973b5..b7f2dafc4 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -356,6 +356,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private Banner topBanner1, topBanner2;//心愿单&联系方式 public SVGAImageView svga_new_user_gif, svga_new_user_double, svga_new_user_follow; private String mAnchorName;//主播名字 + private boolean isHinde = false; @Subscribe(threadMode = ThreadMode.MAIN) public void onUpdata(String str) { @@ -1509,6 +1510,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis topBanner1.setVisibility(View.GONE); topBanner2.setVisibility(View.GONE); + removeDetailView(); } public void clearChat() { @@ -4240,7 +4242,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", "")); closePkTwo(); - showAnchorSayAndCallAnchor(); break; case CUSTOM_FULL_SERVICE_NOTIFY: customFullServiceNotify(event.getCustomFullServiceNotifyEvent()); @@ -4544,7 +4545,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis String s1 = StringUtil.getDurationText(mPkTimeCount * 1000); textTime.setText(String.format(mContext.getString(R.string.pk_time), s1)); countdownHandler.postAtTime(countdownRunnable, getNextSecondTime()); - hideAnchorSayAndCallAnchor(); } else { mPkTimeCount = 0; timeTitle.setVisibility(View.GONE); @@ -4562,6 +4562,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } mPkTimeCount = 0; showAnchorSayAndCallAnchor(); + if (mHandler != null) { + mHandler.removeMessages(WHAT_PK_TIME); + } } /** @@ -4741,12 +4744,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void hideAnchorSayAndCallAnchor() { + isHinde = true; mAnchorSay.setVisibility(View.GONE); topBanner2.setVisibility(View.VISIBLE); topBanner1.setVisibility(View.GONE); } public void showAnchorSayAndCallAnchor() { + isHinde = false; if (mAnchorSay.getVisibility() == View.GONE && sayModel != null && sayModel.getLivePreview() != null && sayModel.getLivePreview().getIsShow() == 1 @@ -4778,7 +4783,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mTopBannerList = new ArrayList<>(); } // if(sayModel!=null&&sayModel.getLivePreview().getIsShow()==1&&sa) - topBanner1.setVisibility(View.VISIBLE); + if (!isHinde){ + topBanner1.setVisibility(View.VISIBLE); + } + BannerBean bannerBean = new BannerBean(); bannerBean.setWishlistIcon(wishListProgress.getWishlistIcon()) .setWishlistName(wishListProgress.getWishlistName()) @@ -4963,7 +4971,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void onSuccess(LiveAnchorCallMeModel data) { System.out.println(">>>>> 获取联系方式:" + data); if (data.getIsShow() == 1) { - topBanner1.setVisibility(View.VISIBLE); + if (!isHinde){ + topBanner1.setVisibility(View.VISIBLE); + } BannerBean call = new BannerBean(); call.setData(data); call.setType(TopBannerCustomViewHolder.TYPE_CALL_ANCHOR); 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 7910576e2..2a86d0c06 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -259,8 +259,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe }; - - @Override public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) { isEnterRoom = false; @@ -652,6 +650,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } } liveHandler.postDelayed(loadRunnableGone, 15_000); + if (TextUtils.equals(data.getEnterRoomInfo().getIsconnection(), "1")) { + //通知心愿单位置换地方 + EventBus.getDefault().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_ING)); + } } @@ -1932,6 +1935,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.upDataPkScore(pkScores, time); setPkStatus(true); } + //通知心愿单位置换地方 + EventBus.getDefault().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_ING)); } public void endDRGif() { @@ -1954,7 +1960,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void showXydComplete(XydCompleteModel model, LiveReceiveGiftBean liveReceiveGiftBean) { if (mLiveRoomViewHolder != null) { - mLiveRoomViewHolder.showXydComplete(model, false,liveReceiveGiftBean); + mLiveRoomViewHolder.showXydComplete(model, false, liveReceiveGiftBean); } } } diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 270f11856..ef9aa8d2a 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -704,6 +704,7 @@ android:layout_alignParentRight="true" android:layout_marginTop="20dp" android:layout_marginRight="5dp" + android:visibility="gone" app:delay_time="5000" app:indicator_height="8dp" app:indicator_width="8dp" /> @@ -2195,6 +2196,7 @@ android:layout_marginTop="20dp" android:layout_marginRight="5dp" app:delay_time="5000" + android:visibility="gone" app:indicator_height="8dp" app:indicator_width="8dp" />