修复连麦小窗再进直播间会闪退问题
This commit is contained in:
parent
e6766dc5eb
commit
83039d7b29
@ -16,6 +16,7 @@ import com.facebook.FacebookSdk;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Locale;
|
||||
|
||||
import io.rong.imlib.RongIMClient;
|
||||
@ -31,6 +32,7 @@ import me.leolin.shortcutbadger.ShortcutBadger;
|
||||
public class CommonAppContext extends MultiDexApplication {
|
||||
|
||||
public static CommonAppContext sInstance;
|
||||
public static WeakReference<Activity> activityWeakReference;
|
||||
private int mCount;
|
||||
private boolean mFront;//是否前台
|
||||
public static int jpushMsgNum;
|
||||
@ -98,6 +100,7 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
mCount++;
|
||||
activityWeakReference=new WeakReference<>(activity);
|
||||
if (!mFront) {
|
||||
mFront = true;
|
||||
L.e("AppContext------->处于前台");
|
||||
|
@ -157,8 +157,12 @@ public class MicStatusManager {
|
||||
.isDisposed();
|
||||
}
|
||||
|
||||
public boolean isMic() {
|
||||
return micStatus == MIC_TYPE_OPEN;
|
||||
/**
|
||||
* 判断是否在连麦中
|
||||
* @param toUid 目标uid
|
||||
*/
|
||||
public boolean isMic(String toUid) {
|
||||
return micStatus == MIC_TYPE_OPEN && !micLiveId.equals(toUid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -186,8 +186,8 @@ public class RouteUtil {
|
||||
* 打开直播页面
|
||||
*/
|
||||
public static void forwardLiveAudienceActivity(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) {
|
||||
if(MicStatusManager.getInstance().isMic()){
|
||||
MicStatusManager.getInstance().showDownMicDialog(CommonAppContext.sInstance);
|
||||
if(MicStatusManager.getInstance().isMic(mLiveBean.getUid())){
|
||||
MicStatusManager.getInstance().showDownMicDialog(CommonAppContext.activityWeakReference.get());
|
||||
return;
|
||||
}
|
||||
ARouter.getInstance().build(PATH_LIVE_AUDIENCE)
|
||||
|
@ -735,7 +735,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
if(MicStatusManager.getInstance().isMic()){
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
if(MicStatusManager.getInstance().isMic()){
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
|
@ -620,7 +620,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
if(MicStatusManager.getInstance().isMic()){
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
if(MicStatusManager.getInstance().isMic()){
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
|
@ -3574,7 +3574,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
.setMicIng(2)
|
||||
.setBean(liveBean).setLiveType(liveType).setLiveTypeVal(Integer.parseInt(liveTypeVal)));
|
||||
} else {
|
||||
if(MicStatusManager.getInstance().isMic()){
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ public class MyWebViewActivity extends AbsActivity {
|
||||
}
|
||||
if (!"".endsWith(Constants.mStream)) {
|
||||
finish();
|
||||
if(MicStatusManager.getInstance().isMic()){
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ public class MyWebViewActivity2 extends AbsActivity {
|
||||
}
|
||||
if (!"".endsWith(Constants.mStream)) {
|
||||
finish();
|
||||
if(MicStatusManager.getInstance().isMic()){
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
if (!"".endsWith(Constants.mStream)) {
|
||||
if(MicStatusManager.getInstance().isMic()){
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
|
@ -775,7 +775,7 @@ public class UserHomeViewHolder2 extends AbsLivePageViewHolder implements LiveSh
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
|
||||
if (mFromLiveRoom) {
|
||||
if(MicStatusManager.getInstance().isMic()){
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user