From 754f2a9294151cb7dba3f88ac4d804b25e357d7e Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 25 Apr 2024 15:32:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98=E5=85=A8?= =?UTF-8?q?=E6=9C=8D=E8=B7=B3=E8=BD=AC=E7=9B=B4=E6=92=AD=E9=97=B4=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 4 +- .../live/presenter/LiveGiftAnimPresenter.java | 62 +++++++++++++++++-- .../yunbao/live/views/LiveRoomViewHolder.java | 1 + 3 files changed, 60 insertions(+), 7 deletions(-) diff --git a/config.gradle b/config.gradle index 516ec9bb3..3136158c6 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", // 测试 -// serverHost : "https://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", //百度语音识别 diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index b73e45d18..43357d093 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -382,7 +382,12 @@ public class LiveGiftAnimPresenter { } }, 1000); } else { - changeLiveRoom(); + if (mIvLook.getTag()!=null&&mIvLook.getTag()instanceof LiveReceiveGiftBean){ + changeLiveRoom((LiveReceiveGiftBean) mIvLook.getTag()); + }else { + changeLiveRoom(); + } + } } @@ -430,12 +435,57 @@ public class LiveGiftAnimPresenter { } }); } + private void changeLiveRoom(LiveReceiveGiftBean mTempGifGiftBean) { + if (mTempGifGiftBean != null) { + String uid = mTempGifGiftBean.getUid(); + String userId = CommonAppConfig.getInstance().getUid(); + if (!TextUtils.isEmpty(mLiveUid)) { + userId = mLiveUid; + } + if (userId.equals(uid)) { + ToastUtil.show(WordUtil.isNewZh() ? "已在当前直播间" : "Already in the current studio"); + return; + } + } + if (mTempGifGiftBean.getRoomnum() == null || mTempGifGiftBean.getRoomnum().isEmpty()) { + return; + } + LiveHttpUtil.getLiveInfo(mTempGifGiftBean.getRoomnum(), new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); + new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { + @Override + public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { + if (liveBean == null) { + return; + } + if (MicStatusManager.getInstance().isMic(liveUid)) { + MicStatusManager.getInstance().showDownMicDialog(mContext); + return; + } + EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)).setLiveEnd(true)); + } + + @Override + public void onCheckError(String contextError) { + + } + }); + } + } + }); + } private void changeLiveRoom() { if (mTempGifGiftBean != null) { String uid = mTempGifGiftBean.getUid(); String userId = CommonAppConfig.getInstance().getUid(); + if (!TextUtils.isEmpty(mLiveUid)) { + userId = mLiveUid; + } if (userId.equals(uid)) { ToastUtil.show(WordUtil.isNewZh() ? "已在当前直播间" : "Already in the current studio"); return; @@ -1008,11 +1058,13 @@ public class LiveGiftAnimPresenter { superNotice.setBackgroundResource(R.mipmap.super_notice); mIvLook.setText(R.string.live_onlookers); mAncherName = mTempGifGiftBean.getAncherName(); + mRoomNum = bean.getRoomnum(); mGifGiftTipAllServer.setSelected(false); mGifGiftTipGroupAllServer.setAlpha(1f); mGifGiftTipGroupAllServer.setVisibility(View.VISIBLE); textRender.render(mContext, mGifGiftTipAllServer, mTempGifGiftBean.getGiftIcon(), mTempGifGiftBean.getUserNiceName(), mAncherName, mTempGifGiftBean.getGiftName(), 1, mWindowManager, ""); mIvLook.setVisibility(View.VISIBLE); + mIvLook.setTag(bean); mGifGiftTipShowAnimatorAllServer.start(); } @@ -1137,12 +1189,12 @@ public class LiveGiftAnimPresenter { int unameSize = textMsg.length(); builder.setSpan(new ForegroundColorSpan(Color.parseColor(dto.getColour())), unameIndexOf, unameIndexOf + unameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } - if (!showB){ + if (!showB) { iv_look_full_service_notice_new3.setVisibility(View.GONE); - }else { - if (TextUtils.equals(event.getJumpType(),"0")){ + } else { + if (TextUtils.equals(event.getJumpType(), "0")) { iv_look_full_service_notice_new3.setVisibility(View.GONE); - }else { + } else { iv_look_full_service_notice_new3.setVisibility(View.VISIBLE); } } 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 3d2cb2d03..66bc715c2 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -3990,6 +3990,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (mLiveGiftAnimPresenter == null) { mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager); } + mLiveGiftAnimPresenter.setLiveUidStream(mLiveUid,mStream); mLiveGiftAnimPresenter.showGiftAnim(bean, isAncher); }