From 5a924d9fea0f82c392dd1e5fee96ac306e32315f Mon Sep 17 00:00:00 2001 From: Martin <13046765170@163.com> Date: Wed, 5 Jun 2024 09:50:57 +0800 Subject: [PATCH] =?UTF-8?q?fix[=E4=BF=AE=E5=A4=8DBUG]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beautyapi/faceunity/agora/SWManager.java | 14 ++++++- .../live/activity/LiveSwAnchorActivity.java | 12 +++++- .../live/dialog/LiveGiftDialogFragment.java | 3 ++ .../com/yunbao/live/dialog/LiveGiftPopup.java | 5 +++ .../dialog/LiveMicUserDialogFragment.java | 30 ++++++++++----- .../presenter/LiveSwLinkMicPkPresenter.java | 2 +- .../live/views/LivePushSwViewHolder.java | 5 +++ .../yunbao/live/views/LiveRoomViewHolder.java | 37 ++++++++++++------- live/src/main/res/layout/view_live_room.xml | 5 +-- settings.gradle | 4 +- 10 files changed, 84 insertions(+), 33 deletions(-) diff --git a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java index 0b09da2f2..1dbcc7308 100644 --- a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java +++ b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java @@ -125,6 +125,8 @@ public class SWManager extends BaseCacheManager { //设置竖屏 cfg.orientationMode = VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_FIXED_PORTRAIT; + + mRtcEngine.setVideoEncoderConfiguration(cfg); // 创建一个 SurfaceView 对象,并将其作为 FrameLayout 的子对象 @@ -232,7 +234,8 @@ public class SWManager extends BaseCacheManager { ChannelMediaOptions options = new ChannelMediaOptions(); // 设置角色 BROADCASTER (主播) 或 AUDIENCE (观众) options.clientRoleType = Constants.CLIENT_ROLE_BROADCASTER; - + options.publishCameraTrack = true; + options.publishMicrophoneTrack = true; mRtcEngine.setAudioProfile(Constants.AUDIO_PROFILE_MUSIC_HIGH_QUALITY); mRtcEngine.setAudioScenario(Constants.AUDIO_SCENARIO_GAME_STREAMING); @@ -433,6 +436,14 @@ public class SWManager extends BaseCacheManager { } } + @Override + public void onUserOffline(int uid, int reason) { + super.onUserOffline(uid, reason); + if (onRtcEngineListener != null) { + //onRtcEngineListener.onOpenSuccess(channel, uid); + } + } + @Override public void onError(int err) { super.onError(err); @@ -486,6 +497,7 @@ public class SWManager extends BaseCacheManager { public interface onRtcEngineListener { void onOpenSuccess(String channel, int uid); + void onUserOffline(int uid); } public void setPkContainer(FrameLayout pkContainer) { diff --git a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java index a4240d206..1c31f398a 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java @@ -87,6 +87,7 @@ import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveReceiveGiftBean; +import com.yunbao.live.bean.NewAllServerNotifyGuardEvent; import com.yunbao.live.dialog.FreePkDialogFragment; import com.yunbao.live.dialog.LiveInputDialogFragment; import com.yunbao.live.dialog.LiveNewFunctionDialogFragment; @@ -1942,13 +1943,20 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl } break; } - - } + @Subscribe(threadMode = ThreadMode.MAIN) public void onAllServerNotifyFFGGGDJANEvent(AllServerNotifyFFGGGDJANEvent event) { if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.showAllServerNotifyFFGGGD(event,false); } } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onNewAllServerNotifyGuardEvent(NewAllServerNotifyGuardEvent event) { + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.buyGuardNew(event); + } + } + } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java index 12100ee45..c9667ec0f 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java @@ -65,6 +65,7 @@ import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.GiftCacheUtil; +import com.yunbao.common.utils.L; import com.yunbao.common.utils.NobleUtil; import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.StringUtil; @@ -1021,9 +1022,11 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On if (u != null) { u.setLevel(obj.getIntValue("level")); //送礼物后更新粉丝徽章等级 + L.eSw("___送礼物后更新粉丝徽章等级_修改前3333___ "+obj.getIntValue("medal_level")); u.setMedalLevel(obj.getIntValue("medal_level")); u.setMedalName(obj.getString("medal_name")); u.setCoin(coin); + L.eSw("___送礼物后更新粉丝徽章等级_修改后3333___ "+obj.getIntValue("medal_level")); } if (mCoin != null) { mCoin.setText(coin); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index f1069d325..b6c2c946e 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -44,6 +44,7 @@ import com.opensource.svgaplayer.SVGADrawable; import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAVideoEntity; +import com.yunbao.common.utils.L; import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; @@ -656,7 +657,9 @@ public class LiveGiftPopup extends AbsDialogFragment { if (u != null) { u.setLevel(obj.getIntValue("level")); //送礼物后更新粉丝徽章等级 + L.eSw("___送礼物后更新粉丝徽章等级_修改前111___ "+obj.getIntValue("medal_level")); u.setMedalLevel(obj.getIntValue("medal_level")); + L.eSw("___送礼物后更新粉丝徽章等级_修改后111___ "+CommonAppConfig.getInstance().getUserBean().getMedalLevel()); u.setMedalName(obj.getString("medal_name")); u.setCoin(coin); } @@ -1360,8 +1363,10 @@ public class LiveGiftPopup extends AbsDialogFragment { u.setLevel(obj.getIntValue("level")); //送礼物后更新粉丝徽章等级 u.setMedalLevel(obj.getIntValue("medal_level")); + L.eSw("___送礼物后更新粉丝徽章等级_修改前2222___ "+obj.getIntValue("medal_level")); u.setMedalName(obj.getString("medal_name")); u.setCoin(coin); + L.eSw("___送礼物后更新粉丝徽章等级_修改后2222___ "+CommonAppConfig.getInstance().getUserBean().getMedalLevel()); } if (diamondText != null) { diamondText.setText(coin); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveMicUserDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveMicUserDialogFragment.java index d41a0b83c..6430619b4 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveMicUserDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveMicUserDialogFragment.java @@ -150,16 +150,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View mRefreshView = mRootView.findViewById(R.id.refreshView); view_no = mRootView.findViewById(R.id.view_no); apply_btn = mRootView.findViewById(R.id.apply_btn); - if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_DEFAULT) { - apply_btn.setBackgroundResource(R.drawable.background_0fdab8); - apply_btn.setText(mContext.getString(R.string.apply_for_lianmai)); - } else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) { - apply_btn.setBackgroundResource(R.drawable.background_00a0e9); - apply_btn.setText(mContext.getString(R.string.cancel_application)); - } else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_OPEN) { - apply_btn.setBackgroundResource(R.drawable.background_eb6877); - apply_btn.setText(mContext.getString(R.string.quit_mic)); - } + updateMicType(); apply_btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -354,6 +345,12 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View } } if (data.size() > 0 && pg == 1) { + for (int i = 0; i 180) { redPacketQueue.setVisibility(View.GONE); @@ -1743,7 +1751,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis redSchedule.setText(stringBuffer.toString()); openRedPacket.setText(String.format(mContext.getString(R.string.open_red_packet), mRedPacketModel.getRedPacketCount() + "")); } - if (IMLoginManager.get(mContext).getUserInfo().anchorUserType() && mContext instanceof LiveSwAnchorActivity) { + if (IMLoginManager.get(mContext).getUserInfo().anchorUserType() && (mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity)) { anchorTimeHandler.removeCallbacks(anchorTimeRunnable); anchorTimeHandler.post(anchorTimeRunnable); } @@ -1755,7 +1763,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onViewClicks() { - if (!(mContext instanceof LiveSwAnchorActivity)) { + if (!(mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity)) { LiveNetManager.get(mContext).redPacketInfo(mLiveUid, redPacketModel.getRedPacketId(), new com.yunbao.common.http.base.HttpCallback() { @Override public void onSuccess(RedPacketInfoModel data) { @@ -1781,6 +1789,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } + } }); } @@ -2950,7 +2959,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis bundle.putString("toUid", toUid); bundle.putInt("isAttention", isAttention); bundle.putBoolean("isLive", isAnchor); - bundle.putBoolean("SBW", !(mContext instanceof LiveSwAnchorActivity)); + bundle.putBoolean("SBW", !(mContext instanceof LiveSwAnchorActivity ||mContext instanceof LiveRyAnchorActivity )); giftWallDialog.setArguments(bundle); giftWallDialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "GiftWallDialog"); @@ -3315,7 +3324,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis //直播间 粉丝排行榜 openMedalRankWindow(); } else if (i == R.id.btn_guard) { - ((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveSwAnchorActivity); + ((LiveActivity) mContext).openNewGuardListWindow((mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity )); } else if (i == R.id.btn_red_pack) { ((LiveActivity) mContext).openRedPackListWindow(); @@ -3323,13 +3332,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis ((LiveActivity) mContext).openPrizePoolWindow(); } else if (i == R.id.user_more) { MobclickAgent.onEvent(mContext, "live_room_audience_list", "直播间上面点观众列表按钮"); - ((LiveActivity) mContext).openUserMoreListWindow(1, false, false, mContext instanceof LiveSwAnchorActivity); + ((LiveActivity) mContext).openUserMoreListWindow(1, false, false, mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity); } else if (i == R.id.hot_btn) { - ((LiveActivity) mContext).openUserMoreListWindow(1, false, false, mContext instanceof LiveSwAnchorActivity); + ((LiveActivity) mContext).openUserMoreListWindow(1, false, false, mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity); } else if (i == R.id.noble_seat) { MobclickAgent.onEvent(mContext, "live_room_noble", "贵族按钮"); - ((LiveActivity) mContext).openUserMoreListWindow(1, false, true, mContext instanceof LiveSwAnchorActivity); + ((LiveActivity) mContext).openUserMoreListWindow(1, false, true, mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity); } else if (i == R.id.btn_close) { // if (sudGameMin!=null&&sudGameMin.getVisibility()==View.VISIBLE) { // new XPopup.Builder(mContext) @@ -3362,7 +3371,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } else if (i == R.id.user_guard) { MobclickAgent.onEvent(mContext, "anchor_avatar_guard", "守护按钮"); // ((LiveActivity) mContext).openUserMoreListWindow(2, true); - ((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveSwAnchorActivity); + ((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity); } if (i == R.id.lt_trickery) { showTrickeryDialog(); @@ -3387,7 +3396,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * @param in 展示的view */ private void changeMsgView(View out, View in) { - if (mContext instanceof LiveSwAnchorActivity) { + if (mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity) { return; } if (in.getVisibility() == View.VISIBLE) { @@ -4740,7 +4749,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis lt_trickster_salvation.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if (mContext instanceof LiveSwAnchorActivity) { + if (mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity) { dialog.dismiss(); return; } diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index d26c53496..da44880cd 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -1491,10 +1491,10 @@ android:visibility="visible" /> + android:layout_height="wrap_content">