This commit is contained in:
oujunhui
2020-07-22 02:04:03 +08:00
parent 010b82d088
commit ff0a1556f3
6 changed files with 34 additions and 13 deletions

View File

@@ -107,7 +107,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
return; return;
} }
boolean getIsShowRedPackage = AvRoomDataManager.get().serverRedEnvelopeSwitch; boolean getIsShowRedPackage = AvRoomDataManager.get().isCloseRedPackage();
String text = getIsShowRedPackage ? String text = getIsShowRedPackage ?
context.getResources().getString(R.string.close_redpackage_notice) : context.getResources().getString(R.string.close_redpackage_notice) :
context.getResources().getString(R.string.open_redpackage_notice); context.getResources().getString(R.string.open_redpackage_notice);

View File

@@ -409,7 +409,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
//audioQulity = AvRoomDataManager.get().mCurrentRoomInfo.getAudioQuality(); //audioQulity = AvRoomDataManager.get().mCurrentRoomInfo.getAudioQuality();
gameBinding.setRoomInfo(AvRoomDataManager.get().mCurrentRoomInfo); gameBinding.setRoomInfo(AvRoomDataManager.get().mCurrentRoomInfo);
isCloseScreen = AvRoomDataManager.get().isCloseScreen(); isCloseScreen = AvRoomDataManager.get().isCloseScreen();
isRedPackage = AvRoomDataManager.get().serverRedEnvelopeSwitch; isRedPackage = AvRoomDataManager.get().isCloseRedPackage();
isRoomPureMode = AvRoomDataManager.get().isOpenPureMode(); isRoomPureMode = AvRoomDataManager.get().isOpenPureMode();
showGiftValue = AvRoomDataManager.get().isShowGiftValue(); showGiftValue = AvRoomDataManager.get().isShowGiftValue();
openOrCloseGiftValue(true); openOrCloseGiftValue(true);
@@ -928,6 +928,8 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
getMvpPresenter().updateScreen(isCloseScreen); getMvpPresenter().updateScreen(isCloseScreen);
} }
/** /**
* 嗨聊房切换清屏方法 * 嗨聊房切换清屏方法
*/ */

View File

@@ -682,15 +682,15 @@ public class HomePartyPresenter extends BaseMvpPresenter<IHomePartyView> {
public void updateRedPackage(){ public void updateRedPackage(){
RedPackageModel.INSTANCE.setRedPackageSwitch(AvRoomDataManager.get().getRoomUid()).subscribe(setIsNeedOpenRedPackage -> { RedPackageModel.INSTANCE.setRedPackageSwitch(AvRoomDataManager.get().getRoomUid()).subscribe(setIsNeedOpenRedPackage -> {
AvRoomDataManager.get().serverRedEnvelopeSwitch = setIsNeedOpenRedPackage; // AvRoomDataManager.get().isCloseRedPackage() = setIsNeedOpenRedPackage;
RoomInfoAttachment attachment = new RoomInfoAttachment(CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO, // RoomInfoAttachment attachment = new RoomInfoAttachment(CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO,
CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_REDPACKAGE); // CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_REDPACKAGE);
ChatRoomMessage screenMsg = ChatRoomMessageBuilder.createChatRoomCustomMessage( // ChatRoomMessage screenMsg = ChatRoomMessageBuilder.createChatRoomCustomMessage(
String.valueOf(AvRoomDataManager.get().getRoomId()), // String.valueOf(AvRoomDataManager.get().getRoomId()),
attachment // attachment
); // );
IMNetEaseManager.get().addRedPackageSwitch(screenMsg); // IMNetEaseManager.get().addRedPackageSwitch(screenMsg);
}); });
// IMNetEaseManager.get().updateGiftEffect(AvRoomDataManager.get().getRoomUid()) // IMNetEaseManager.get().updateGiftEffect(AvRoomDataManager.get().getRoomUid())

View File

@@ -971,8 +971,8 @@ public abstract class BaseMvpActivity<V extends IMvpBaseView, P extends Abstract
if (roomInfo != null && roomInfo.getUid() == notifyInfo.getRoomUid() && context instanceof AVRoomActivity) {//红包所在房间 是在房间 if (roomInfo != null && roomInfo.getUid() == notifyInfo.getRoomUid() && context instanceof AVRoomActivity) {//红包所在房间 是在房间
RedPackageOpenDialog.Companion.newInstance(notifyInfo).show(this); RedPackageOpenDialog.Companion.newInstance(notifyInfo).show(this);
} else { } else {
LogUtil.e("Red_Base:"+AvRoomDataManager.get().serverRedEnvelopeSwitch); LogUtil.e("Red_Base:"+AvRoomDataManager.get().isCloseRedPackage());
if (roomInfo != null && roomInfo.getUid() != notifyInfo.getRoomUid() && AvRoomDataManager.get().serverRedEnvelopeSwitch && context instanceof AVRoomActivity){ if (roomInfo != null && roomInfo.getUid() != notifyInfo.getRoomUid() && AvRoomDataManager.get().isCloseRedPackage() && context instanceof AVRoomActivity){
RedPackageGoRoomDialog.Companion.newInstance(notifyInfo).show(this); RedPackageGoRoomDialog.Companion.newInstance(notifyInfo).show(this);
}else if (roomInfo == null){ }else if (roomInfo == null){
RedPackageGoRoomDialog.Companion.newInstance(notifyInfo).show(this); RedPackageGoRoomDialog.Companion.newInstance(notifyInfo).show(this);

View File

@@ -64,7 +64,7 @@ public final class AvRoomDataManager {
/** /**
* 是否需要打开全服红包 * 是否需要打开全服红包
*/ */
public boolean serverRedEnvelopeSwitch; // public boolean serverRedEnvelopeSwitch;
/** /**
* 房间创建者 * 房间创建者
*/ */
@@ -769,6 +769,19 @@ public final class AvRoomDataManager {
return roomInfo.isCloseScreen(); return roomInfo.isCloseScreen();
} }
/**
* ture为关闭公屏
*
* @return -
*/
public boolean isCloseRedPackage() {
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
if (roomInfo == null) {
return true;
}
return roomInfo.isServerRedEnvelopeSwitch();
}
/** /**
* 是否为ktv模式 * 是否为ktv模式

View File

@@ -67,6 +67,11 @@ public class RoomInfo implements Parcelable,Serializable {
public String roomPwd; public String roomPwd;
/**
* 是否需要打开全服红包
*/
private boolean serverRedEnvelopeSwitch;
/** 主题类型名称 */ /** 主题类型名称 */
private String roomTag; private String roomTag;
/** 主题类型id */ /** 主题类型id */
@@ -187,6 +192,7 @@ public class RoomInfo implements Parcelable,Serializable {
", isOpenGame=" + isOpenGame + ", isOpenGame=" + isOpenGame +
", roomGame=" + roomGame + ", roomGame=" + roomGame +
", boxSwitchVo=" + boxSwitchVo + ", boxSwitchVo=" + boxSwitchVo +
", serverRedEnvelopeSwitch=" + serverRedEnvelopeSwitch +
", singingMusicName='" + singingMusicName + '\'' + ", singingMusicName='" + singingMusicName + '\'' +
", limitType='" + limitType + '\'' + ", limitType='" + limitType + '\'' +
", roomModeType=" + roomModeType + ", roomModeType=" + roomModeType +