fix[修复BUG]

This commit is contained in:
Martin 2024-06-05 09:50:57 +08:00
parent 9c9eb34756
commit 5a924d9fea
10 changed files with 84 additions and 33 deletions

View File

@ -125,6 +125,8 @@ public class SWManager extends BaseCacheManager {
//设置竖屏 //设置竖屏
cfg.orientationMode = VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_FIXED_PORTRAIT; cfg.orientationMode = VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_FIXED_PORTRAIT;
mRtcEngine.setVideoEncoderConfiguration(cfg); mRtcEngine.setVideoEncoderConfiguration(cfg);
// 创建一个 SurfaceView 对象并将其作为 FrameLayout 的子对象 // 创建一个 SurfaceView 对象并将其作为 FrameLayout 的子对象
@ -232,7 +234,8 @@ public class SWManager extends BaseCacheManager {
ChannelMediaOptions options = new ChannelMediaOptions(); ChannelMediaOptions options = new ChannelMediaOptions();
// 设置角色 BROADCASTER (主播) AUDIENCE (观众) // 设置角色 BROADCASTER (主播) AUDIENCE (观众)
options.clientRoleType = Constants.CLIENT_ROLE_BROADCASTER; options.clientRoleType = Constants.CLIENT_ROLE_BROADCASTER;
options.publishCameraTrack = true;
options.publishMicrophoneTrack = true;
mRtcEngine.setAudioProfile(Constants.AUDIO_PROFILE_MUSIC_HIGH_QUALITY); mRtcEngine.setAudioProfile(Constants.AUDIO_PROFILE_MUSIC_HIGH_QUALITY);
mRtcEngine.setAudioScenario(Constants.AUDIO_SCENARIO_GAME_STREAMING); 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 @Override
public void onError(int err) { public void onError(int err) {
super.onError(err); super.onError(err);
@ -486,6 +497,7 @@ public class SWManager extends BaseCacheManager {
public interface onRtcEngineListener { public interface onRtcEngineListener {
void onOpenSuccess(String channel, int uid); void onOpenSuccess(String channel, int uid);
void onUserOffline(int uid);
} }
public void setPkContainer(FrameLayout pkContainer) { public void setPkContainer(FrameLayout pkContainer) {

View File

@ -87,6 +87,7 @@ import com.yunbao.live.bean.LiveChatBean;
import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveKsyConfigBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.NewAllServerNotifyGuardEvent;
import com.yunbao.live.dialog.FreePkDialogFragment; import com.yunbao.live.dialog.FreePkDialogFragment;
import com.yunbao.live.dialog.LiveInputDialogFragment; import com.yunbao.live.dialog.LiveInputDialogFragment;
import com.yunbao.live.dialog.LiveNewFunctionDialogFragment; import com.yunbao.live.dialog.LiveNewFunctionDialogFragment;
@ -1942,13 +1943,20 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
} }
break; break;
} }
} }
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onAllServerNotifyFFGGGDJANEvent(AllServerNotifyFFGGGDJANEvent event) { public void onAllServerNotifyFFGGGDJANEvent(AllServerNotifyFFGGGDJANEvent event) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.showAllServerNotifyFFGGGD(event,false); mLiveRoomViewHolder.showAllServerNotifyFFGGGD(event,false);
} }
} }
@Subscribe(threadMode = ThreadMode.MAIN)
public void onNewAllServerNotifyGuardEvent(NewAllServerNotifyGuardEvent event) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.buyGuardNew(event);
}
}
} }

View File

@ -65,6 +65,7 @@ import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.GiftCacheUtil; import com.yunbao.common.utils.GiftCacheUtil;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.NobleUtil; import com.yunbao.common.utils.NobleUtil;
import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
@ -1021,9 +1022,11 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
if (u != null) { if (u != null) {
u.setLevel(obj.getIntValue("level")); u.setLevel(obj.getIntValue("level"));
//送礼物后更新粉丝徽章等级 //送礼物后更新粉丝徽章等级
L.eSw("___送礼物后更新粉丝徽章等级_修改前3333___ "+obj.getIntValue("medal_level"));
u.setMedalLevel(obj.getIntValue("medal_level")); u.setMedalLevel(obj.getIntValue("medal_level"));
u.setMedalName(obj.getString("medal_name")); u.setMedalName(obj.getString("medal_name"));
u.setCoin(coin); u.setCoin(coin);
L.eSw("___送礼物后更新粉丝徽章等级_修改后3333___ "+obj.getIntValue("medal_level"));
} }
if (mCoin != null) { if (mCoin != null) {
mCoin.setText(coin); mCoin.setText(coin);

View File

@ -44,6 +44,7 @@ import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity; import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
@ -656,7 +657,9 @@ public class LiveGiftPopup extends AbsDialogFragment {
if (u != null) { if (u != null) {
u.setLevel(obj.getIntValue("level")); u.setLevel(obj.getIntValue("level"));
//送礼物后更新粉丝徽章等级 //送礼物后更新粉丝徽章等级
L.eSw("___送礼物后更新粉丝徽章等级_修改前111___ "+obj.getIntValue("medal_level"));
u.setMedalLevel(obj.getIntValue("medal_level")); u.setMedalLevel(obj.getIntValue("medal_level"));
L.eSw("___送礼物后更新粉丝徽章等级_修改后111___ "+CommonAppConfig.getInstance().getUserBean().getMedalLevel());
u.setMedalName(obj.getString("medal_name")); u.setMedalName(obj.getString("medal_name"));
u.setCoin(coin); u.setCoin(coin);
} }
@ -1360,8 +1363,10 @@ public class LiveGiftPopup extends AbsDialogFragment {
u.setLevel(obj.getIntValue("level")); u.setLevel(obj.getIntValue("level"));
//送礼物后更新粉丝徽章等级 //送礼物后更新粉丝徽章等级
u.setMedalLevel(obj.getIntValue("medal_level")); u.setMedalLevel(obj.getIntValue("medal_level"));
L.eSw("___送礼物后更新粉丝徽章等级_修改前2222___ "+obj.getIntValue("medal_level"));
u.setMedalName(obj.getString("medal_name")); u.setMedalName(obj.getString("medal_name"));
u.setCoin(coin); u.setCoin(coin);
L.eSw("___送礼物后更新粉丝徽章等级_修改后2222___ "+CommonAppConfig.getInstance().getUserBean().getMedalLevel());
} }
if (diamondText != null) { if (diamondText != null) {
diamondText.setText(coin); diamondText.setText(coin);

View File

@ -150,16 +150,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
mRefreshView = mRootView.findViewById(R.id.refreshView); mRefreshView = mRootView.findViewById(R.id.refreshView);
view_no = mRootView.findViewById(R.id.view_no); view_no = mRootView.findViewById(R.id.view_no);
apply_btn = mRootView.findViewById(R.id.apply_btn); apply_btn = mRootView.findViewById(R.id.apply_btn);
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_DEFAULT) { updateMicType();
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));
}
apply_btn.setOnClickListener(new View.OnClickListener() { apply_btn.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -354,6 +345,12 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
} }
} }
if (data.size() > 0 && pg == 1) { if (data.size() > 0 && pg == 1) {
for (int i = 0; i <data.size(); i++) {
if(data.get(i).getId().equals(CommonAppConfig.getInstance().getUid())){
MicStatusManager.getInstance().setMicData(MicStatusManager.MIC_TYPE_OPEN, LiveActivity.mLiveUid);
updateMicType();
}
}
nums = 0; nums = 0;
view_no.setVisibility(View.GONE); view_no.setVisibility(View.GONE);
if (nums == 0) { if (nums == 0) {
@ -389,6 +386,19 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
} }
private void updateMicType() {
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));
}
}
@Override @Override
public void onClick(View v) { public void onClick(View v) {
dismiss(); dismiss();

View File

@ -815,7 +815,7 @@ public class LiveSwLinkMicPkPresenter implements View.OnClickListener {
EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", "")); EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", ""));
Log.e("ry", "退出多人OKKK" + inputStreamList.size()); Log.e("ry", "退出多人OKKK" + inputStreamList.size());
isDRPK = 0; isDRPK = 0;
DRPKing = 1; DRPKing = -1;
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {

View File

@ -255,6 +255,11 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder implements ITX
//开播成功 //开播成功
L.eSw("开播成功"); L.eSw("开播成功");
} }
@Override
public void onUserOffline(int uid) {
}
}); });
} }

View File

@ -1573,6 +1573,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
findViewById(R.id.btn_follow).setVisibility(View.GONE); findViewById(R.id.btn_follow).setVisibility(View.GONE);
findViewById(R.id.live_rank_pk).setVisibility(View.GONE); findViewById(R.id.live_rank_pk).setVisibility(View.GONE);
} }
if (mContext instanceof LiveRyAnchorActivity) {
findViewById(R.id.open_sidebar).setVisibility(View.GONE);
findViewById(R.id.btn_follow).setVisibility(View.GONE);
findViewById(R.id.live_rank_pk).setVisibility(View.GONE);
}
customFullServiceNotify = (ImageView) findViewById(R.id.custom_full_service_notify); customFullServiceNotify = (ImageView) findViewById(R.id.custom_full_service_notify);
reloadIM(); reloadIM();
// initStarChallengeStatus(); // initStarChallengeStatus();
@ -1722,11 +1728,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
layoutParams.topMargin = DpUtil.dp2px(190); layoutParams.topMargin = DpUtil.dp2px(190);
dragonImmediateParticipationTime.setLayoutParams(layoutParams); dragonImmediateParticipationTime.setLayoutParams(layoutParams);
} }
if (dragonImmediateParticipationTime.getVisibility() == View.GONE && mContext instanceof LiveRyAnchorActivity) { if(mContext instanceof LiveRyAnchorActivity ||mContext instanceof LiveSwAnchorActivity){
if (dragonImmediateParticipationTime.getVisibility() == View.GONE ) {
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) redPacket.getLayoutParams(); RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) redPacket.getLayoutParams();
layoutParams.topMargin = DpUtil.dp2px(110); layoutParams.topMargin = DpUtil.dp2px(110);
redPacket.setLayoutParams(layoutParams); redPacket.setLayoutParams(layoutParams);
} }
}
if (redPacketModel.getCountdown() > 180) { if (redPacketModel.getCountdown() > 180) {
redPacketQueue.setVisibility(View.GONE); redPacketQueue.setVisibility(View.GONE);
redPacketCountdown.setVisibility(View.VISIBLE); redPacketCountdown.setVisibility(View.VISIBLE);
@ -1743,7 +1751,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
redSchedule.setText(stringBuffer.toString()); redSchedule.setText(stringBuffer.toString());
openRedPacket.setText(String.format(mContext.getString(R.string.open_red_packet), mRedPacketModel.getRedPacketCount() + "")); 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.removeCallbacks(anchorTimeRunnable);
anchorTimeHandler.post(anchorTimeRunnable); anchorTimeHandler.post(anchorTimeRunnable);
} }
@ -1755,7 +1763,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
@Override @Override
public void onViewClicks() { 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<RedPacketInfoModel>() { LiveNetManager.get(mContext).redPacketInfo(mLiveUid, redPacketModel.getRedPacketId(), new com.yunbao.common.http.base.HttpCallback<RedPacketInfoModel>() {
@Override @Override
public void onSuccess(RedPacketInfoModel data) { 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.putString("toUid", toUid);
bundle.putInt("isAttention", isAttention); bundle.putInt("isAttention", isAttention);
bundle.putBoolean("isLive", isAnchor); bundle.putBoolean("isLive", isAnchor);
bundle.putBoolean("SBW", !(mContext instanceof LiveSwAnchorActivity)); bundle.putBoolean("SBW", !(mContext instanceof LiveSwAnchorActivity ||mContext instanceof LiveRyAnchorActivity ));
giftWallDialog.setArguments(bundle); giftWallDialog.setArguments(bundle);
giftWallDialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "GiftWallDialog"); giftWallDialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "GiftWallDialog");
@ -3315,7 +3324,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
//直播间 粉丝排行榜 //直播间 粉丝排行榜
openMedalRankWindow(); openMedalRankWindow();
} else if (i == R.id.btn_guard) { } 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) { } else if (i == R.id.btn_red_pack) {
((LiveActivity) mContext).openRedPackListWindow(); ((LiveActivity) mContext).openRedPackListWindow();
@ -3323,13 +3332,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
((LiveActivity) mContext).openPrizePoolWindow(); ((LiveActivity) mContext).openPrizePoolWindow();
} else if (i == R.id.user_more) { } else if (i == R.id.user_more) {
MobclickAgent.onEvent(mContext, "live_room_audience_list", "直播间上面点观众列表按钮"); 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) { } 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) { } else if (i == R.id.noble_seat) {
MobclickAgent.onEvent(mContext, "live_room_noble", "贵族按钮"); 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) { } else if (i == R.id.btn_close) {
// if (sudGameMin!=null&&sudGameMin.getVisibility()==View.VISIBLE) { // if (sudGameMin!=null&&sudGameMin.getVisibility()==View.VISIBLE) {
// new XPopup.Builder(mContext) // new XPopup.Builder(mContext)
@ -3362,7 +3371,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} else if (i == R.id.user_guard) { } else if (i == R.id.user_guard) {
MobclickAgent.onEvent(mContext, "anchor_avatar_guard", "守护按钮"); MobclickAgent.onEvent(mContext, "anchor_avatar_guard", "守护按钮");
// ((LiveActivity) mContext).openUserMoreListWindow(2, true); // ((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) { if (i == R.id.lt_trickery) {
showTrickeryDialog(); showTrickeryDialog();
@ -3387,7 +3396,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* @param in 展示的view * @param in 展示的view
*/ */
private void changeMsgView(View out, View in) { private void changeMsgView(View out, View in) {
if (mContext instanceof LiveSwAnchorActivity) { if (mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity) {
return; return;
} }
if (in.getVisibility() == View.VISIBLE) { if (in.getVisibility() == View.VISIBLE) {
@ -4740,7 +4749,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
lt_trickster_salvation.setOnClickListener(new View.OnClickListener() { lt_trickster_salvation.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (mContext instanceof LiveSwAnchorActivity) { if (mContext instanceof LiveSwAnchorActivity||mContext instanceof LiveRyAnchorActivity) {
dialog.dismiss(); dialog.dismiss();
return; return;
} }

View File

@ -1491,10 +1491,10 @@
android:visibility="visible" /> android:visibility="visible" />
<RelativeLayout <RelativeLayout
android:layout_marginTop="315dp"
android:id="@+id/lt_pk_line" android:id="@+id/lt_pk_line"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/live_top"
android:visibility="gone"> android:visibility="gone">
<TextView <TextView
@ -1535,8 +1535,7 @@
<LinearLayout <LinearLayout
android:id="@+id/pk_red_layout" android:id="@+id/pk_red_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_alignParentBottom="true">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -4,7 +4,7 @@ include ':FaceUnity'
//include ':recognizer'// //include ':recognizer'//
include ':Share' include ':Share'
include ':pluginsForAnchor' include ':pluginsForAnchor'
include ':lib_huawei' //include ':lib_huawei'
//include ':lib_google' include ':lib_google'
include ':IAP6Helper' include ':IAP6Helper'
include ':lib_faceunity' include ':lib_faceunity'