diff --git a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java index ff9409aca..8c44a391e 100644 --- a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java @@ -405,7 +405,16 @@ public class WebViewActivity extends AbsActivity { MicStatusManager.getInstance().showDownMicDialog(mContext); return; } - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); + if (!"".endsWith(Constants.mStream)) { + finish(); + if(MicStatusManager.getInstance().isMic(liveUid)){ + MicStatusManager.getInstance().showDownMicDialog(mContext); + return; + } + EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal))); + } else { + RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk)); + } finish(); } diff --git a/config.gradle b/config.gradle index 605cfe1b3..08d317359 100644 --- a/config.gradle +++ b/config.gradle @@ -21,10 +21,10 @@ ext { baiduAppKey : "zgCgFhUKEOV7I3ZXDFpTfnRB", baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", // true表示谷歌支付 false - isGooglePlay : true, + isGooglePlay : false, //是否上报异常日志 isUploadLog : true, //是否打包成插件包模式 - isPluginModel : false, + isPluginModel : true, ] } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index ca8f0b05b..416e10995 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -63,11 +63,14 @@ import com.yunbao.common.event.FollowEvent; import com.yunbao.common.event.GiftWallIlluminateEvent; import com.yunbao.common.event.JavascriptInterfaceEvent; import com.yunbao.common.event.LiveErrorEvent; +import com.yunbao.common.event.LiveRoomChangeEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; +import com.yunbao.common.http.LiveHttpConsts; +import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.http.main.MainNetManager; import com.yunbao.common.interfaces.CommonCallback; @@ -78,6 +81,7 @@ import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.GiftCacheUtil; import com.yunbao.common.utils.L; +import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.ProcessResultUtil; import com.yunbao.common.utils.RouteUtil; @@ -101,11 +105,7 @@ import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; import com.yunbao.live.dialog.SignDialogFragment; import com.yunbao.live.event.LinkMicTxAccEvent; import com.yunbao.live.event.LiveAudienceEvent; -import com.yunbao.common.event.LiveRoomChangeEvent; import com.yunbao.live.http.ImHttpUtil; -import com.yunbao.common.http.LiveHttpConsts; -import com.yunbao.common.http.LiveHttpUtil; -import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.live.views.LiveRoomPlayViewHolder; import com.yunbao.live.views.PortraitLiveManager; import com.yunbao.share.ui.SharePopDialog; @@ -129,7 +129,7 @@ public class LiveAudienceActivity extends LiveActivity { private static final String TAG = "LiveAudienceActivity"; public static String anyway; public JSONObject pkInfo; - public static LiveAudienceActivity liveAudienceActivity; + public LiveAudienceActivity liveAudienceActivity; // 竖直滑动 ViewPager private VerticalViewPager verticalViewPager; @@ -194,6 +194,7 @@ public class LiveAudienceActivity extends LiveActivity { mLiveBean = intent.getParcelableExtra(Constants.LIVE_BEAN); mLiveUid = mLiveBean.getUid(); mStream = mLiveBean.getStream(); + Constants.mStream = mStream; initData(); MicStatusManager.getInstance().addOnMicListener(onMicStatusListener); if (!IMLoginManager.get(mContext).IsXiaJBG() && (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)) { @@ -502,6 +503,7 @@ public class LiveAudienceActivity extends LiveActivity { LiveHttpUtil.cancel(LiveHttpConsts.ROOM_CHARGE); CommonHttpUtil.cancel(CommonHttpConsts.GET_BALANCE); PortraitLiveManager.liveID = ""; + Constants.mStream = ""; super.release(); } @@ -1468,11 +1470,12 @@ public class LiveAudienceActivity extends LiveActivity { } @Subscribe(threadMode = ThreadMode.MAIN) - public void onLiveErrorEvent(LiveErrorEvent event){ + public void onLiveErrorEvent(LiveErrorEvent event) { //主播未直播时自动下滑至下一个直播间 mCurrentPage = mCurrentPage + 1; liveHandler.post(liveRunnable); } + /** * 跳转到消息中心的系统信息web * diff --git a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java index 1d7db2027..838289baa 100644 --- a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java +++ b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java @@ -31,18 +31,21 @@ import com.yunbao.common.R; import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.event.JavascriptInterfaceEvent; +import com.yunbao.common.event.LiveRoomChangeEvent; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.L; +import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.utils.LiveRoomCheckLivePresenter; +import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -172,7 +175,24 @@ public class WebViewActivityMedal extends AbsActivity { new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { @Override public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); + if (liveBean == null) { + return; + } + if (MicStatusManager.getInstance().isMic(liveUid)) { + MicStatusManager.getInstance().showDownMicDialog(mContext); + return; + } + if (!"".endsWith(Constants.mStream)) { + finish(); + if(MicStatusManager.getInstance().isMic(liveUid)){ + MicStatusManager.getInstance().showDownMicDialog(mContext); + return; + } + EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal))); + } else { + RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk)); + } + finish(); } @Override diff --git a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java index 005423034..1bebdab02 100644 --- a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java @@ -406,7 +406,17 @@ public class ZhuangBanActivity extends AbsActivity { MicStatusManager.getInstance().showDownMicDialog(mContext); return; } - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); + + if (!"".endsWith(Constants.mStream)) { + finish(); + if(MicStatusManager.getInstance().isMic(liveUid)){ + MicStatusManager.getInstance().showDownMicDialog(mContext); + return; + } + EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal))); + } else { + RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk)); + } finish(); } diff --git a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java index 801541a2d..226f3ba8c 100644 --- a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java @@ -37,6 +37,7 @@ import com.yunbao.common.Constants; import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.event.JavascriptInterfaceEvent; +import com.yunbao.common.event.LiveRoomChangeEvent; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.manager.IMLoginManager; @@ -46,11 +47,13 @@ import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.L; import com.yunbao.common.utils.LiveRoomCheckLivePresenter; +import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.ToastUtil; import com.yunbao.main.R; +import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -390,7 +393,23 @@ public class ZhuangBanActivity extends AbsActivity { new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { @Override public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); + if (liveBean == null) { + return; + } + if (MicStatusManager.getInstance().isMic(liveUid)) { + MicStatusManager.getInstance().showDownMicDialog(mContext); + return; + } + if (!"".endsWith(Constants.mStream)) { + finish(); + if(MicStatusManager.getInstance().isMic(liveUid)){ + MicStatusManager.getInstance().showDownMicDialog(mContext); + return; + } + EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal))); + } else { + RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk)); + } finish(); }