diff --git a/app/src/main/java/com/chwl/app/avroom/fragment/BaseRoomFragment.kt b/app/src/main/java/com/chwl/app/avroom/fragment/BaseRoomFragment.kt index b40402a93..0ed004bda 100644 --- a/app/src/main/java/com/chwl/app/avroom/fragment/BaseRoomFragment.kt +++ b/app/src/main/java/com/chwl/app/avroom/fragment/BaseRoomFragment.kt @@ -98,6 +98,7 @@ import com.chwl.core.manager.RoomEvent import com.chwl.core.mentoring_relationship.event.MentoringStopCountingEvent import com.chwl.core.room.anotherroompk.ShowGiftDialogEvent import com.chwl.core.room.anotherroompk.ShowUserInfoDialogEvent +import com.chwl.core.room.bean.RoomIcon import com.chwl.core.room.bean.RoomInfo import com.chwl.core.room.event.RoomAtEvent import com.chwl.core.room.event.RoomClearScreenEvent @@ -122,6 +123,7 @@ import com.chwl.library.common.util.LimitClickUtils import com.chwl.library.net.rxnet.utils.RxNetWorkUtils import com.chwl.library.rxbus.RxBus import com.chwl.library.utils.* +import com.google.gson.Gson import com.netease.nim.uikit.common.antispam.AntiSpamEvent import com.netease.nimlib.sdk.StatusCode import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder @@ -793,6 +795,40 @@ open class BaseRoomFragment?> : override fun onClick(v: View) { if (mClickLimit.checkForTime(500)) return when (v.id) { + R.id.iv_config_entrance -> { + val roomInfo = AvRoomDataManager.get().mCurrentRoomInfo ?: return + val configInfo = roomInfo.rightBottomIconConfig ?: return + if (configInfo.skipType == 1) { + + } else if (configInfo.skipType == 2) { + val roomIcon: RoomIcon = RoomIcon( + skipContent = configInfo.skipUrl, + skipType = 3, + showType = 1, + code = "BAISHUN", + ruleValue = configInfo.reserve) + try { + val url = roomIcon.skipContent + val ruleValue = Gson().fromJson( + roomIcon.ruleValue, + RoomIcon.RuleValueBean::class.java + ) + val config = Gson().fromJson( + ruleValue.RESERVE, + BaiShunGameConfig::class.java + ) + if (config != null && url != null) { + config.reloadDynamicParams() +// listener?.onShowBaiShunGame(url, config) + (activity as? AVRoomActivity)?.showBaiShunGame(url, config) + } else { + SingleToastUtil.showToast(R.string.manager_trtc_trtcengineadapter_042) + } + } catch (e: Exception) { + e.printStackTrace() + } + } + } R.id.iv_game -> { // RoomGameListDialog().show(childFragmentManager, "GAME_LIST") val dialog = RoomGameplayDialog() diff --git a/app/src/main/res/layout/fragment_av_room_game.xml b/app/src/main/res/layout/fragment_av_room_game.xml index f5b1283c0..5a5e19060 100644 --- a/app/src/main/res/layout/fragment_av_room_game.xml +++ b/app/src/main/res/layout/fragment_av_room_game.xml @@ -228,6 +228,18 @@ tools:contentDescription="@string/layout_fragment_av_room_game_05" tools:visibility="visible" /> + + CREATOR = new Creator() { + @Override + public RightBottomIconConfig createFromParcel(Parcel in) { + return new RightBottomIconConfig(in); + } + + @Override + public RightBottomIconConfig[] newArray(int size) { + return new RightBottomIconConfig[size]; + } + }; +} diff --git a/core/src/main/java/com/chwl/core/room/bean/RoomInfo.java b/core/src/main/java/com/chwl/core/room/bean/RoomInfo.java index 12db9a384..ffe98bd86 100644 --- a/core/src/main/java/com/chwl/core/room/bean/RoomInfo.java +++ b/core/src/main/java/com/chwl/core/room/bean/RoomInfo.java @@ -160,6 +160,8 @@ public class RoomInfo implements Parcelable,Serializable { // 总流水 private double serialValue; + private RightBottomIconConfig rightBottomIconConfig; + protected RoomInfo(Parcel in) { uid = in.readLong(); officeUser = in.readInt(); @@ -192,6 +194,7 @@ public class RoomInfo implements Parcelable,Serializable { isOpenKTV = in.readByte() != 0; isOpenGame = in.readByte() != 0; boxSwitchVo = in.readParcelable(BoxSwitchVo.class.getClassLoader()); + rightBottomIconConfig = in.readParcelable(RightBottomIconConfig.class.getClassLoader()); findLoveDrawSwitchVo = in.readParcelable(FindLoveSwitchVo.class.getClassLoader()); singingMusicName = in.readString(); limitType = in.readString(); @@ -258,6 +261,7 @@ public class RoomInfo implements Parcelable,Serializable { dest.writeByte((byte) (isOpenKTV ? 1 : 0)); dest.writeByte((byte) (isOpenGame ? 1 : 0)); dest.writeParcelable(boxSwitchVo, flags); + dest.writeParcelable(rightBottomIconConfig, flags); dest.writeParcelable(findLoveDrawSwitchVo, flags); dest.writeString(singingMusicName); dest.writeString(limitType);