|
|
@@ -5,43 +5,37 @@ import android.os.Bundle
|
|
|
import android.view.View
|
|
|
import androidx.lifecycle.LifecycleOwner
|
|
|
import com.adealink.frame.base.fastLazy
|
|
|
-import com.adealink.frame.guide.GuideCenter
|
|
|
-import com.adealink.frame.guide.core.GuideLabel
|
|
|
-import com.adealink.frame.locale.language.languageManager
|
|
|
import com.adealink.frame.router.Router
|
|
|
import com.adealink.frame.util.DisplayUtil
|
|
|
import com.adealink.weparty.commonui.dialogfragment.BaseDialogFragment
|
|
|
import com.adealink.weparty.commonui.layout.DynamicLayers
|
|
|
import com.adealink.weparty.commonui.layout.IDynamicView
|
|
|
-import com.adealink.weparty.module.game.Game
|
|
|
+import com.adealink.weparty.config.GlobalConfigType
|
|
|
import com.adealink.weparty.module.game.GameModule
|
|
|
-import com.adealink.weparty.module.game.data.GameShowConfig
|
|
|
import com.adealink.weparty.module.operation.Operation
|
|
|
import com.adealink.weparty.module.operation.Operation.RechargePackage.Companion.EXTRA_SOURCE
|
|
|
import com.adealink.weparty.module.operation.Operation.RechargePackage.Companion.SOURCE_ROOM_OPERATION
|
|
|
import com.adealink.weparty.module.operation.OperationModule
|
|
|
import com.adealink.weparty.module.operation.rechargepackage.data.EntranceType
|
|
|
import com.adealink.weparty.module.profile.decorate.data.DecorType
|
|
|
-import com.adealink.weparty.module.room.RoomModule
|
|
|
-import com.adealink.weparty.module.webview.Web
|
|
|
+import com.adealink.weparty.module.room.base.BaseRoomComp
|
|
|
import com.adealink.weparty.module.webview.WebViewDialogFragmentBuilder
|
|
|
import com.adealink.weparty.module.webview.data.OfflineH5GameInfo
|
|
|
import com.adealink.weparty.room.R
|
|
|
-import com.adealink.weparty.module.room.base.BaseRoomComp
|
|
|
import com.adealink.weparty.room.game.adapter.GameEntranceAdapter
|
|
|
+import com.adealink.weparty.room.game.data.DragonTigerEntrance
|
|
|
import com.adealink.weparty.room.game.data.GameEntrance
|
|
|
import com.adealink.weparty.room.game.data.GameEntranceType
|
|
|
import com.adealink.weparty.room.game.data.GreedyBoxEntrance
|
|
|
import com.adealink.weparty.room.game.data.GreedyProEntrance
|
|
|
import com.adealink.weparty.room.game.data.LuckyFruitEntrance
|
|
|
-import com.adealink.weparty.room.game.data.LuckyGameLevelEntrance
|
|
|
import com.adealink.weparty.room.game.data.LuckyProEntrance
|
|
|
import com.adealink.weparty.room.game.data.RechargePackageEntrance
|
|
|
+import com.adealink.weparty.room.game.data.RussianRouletteEntrance
|
|
|
import com.adealink.weparty.room.game.data.SlotEntrance
|
|
|
import com.adealink.weparty.room.game.data.SlotProEntrance
|
|
|
-import com.adealink.weparty.room.guide.GameOpenGuide
|
|
|
-import com.adealink.weparty.room.guide.data.RoomGuideLabel
|
|
|
-import com.adealink.weparty.room.guide.data.RoomGuideType
|
|
|
+import com.adealink.weparty.room.game.data.TeenPattiEntrance
|
|
|
+import com.adealink.weparty.room.game.data.TexasCowboyEntrance
|
|
|
import com.adealink.weparty.url.H5Page
|
|
|
import com.adealink.weparty.url.urlConfigService
|
|
|
import com.adealink.weparty.util.goLocalLinkPage
|
|
|
@@ -62,74 +56,9 @@ class GameComp(
|
|
|
setIndicator(viewBinding.indicator, false)
|
|
|
setAdapter(gameEntranceAdapter)
|
|
|
setOnBannerListener { data, _ ->
|
|
|
- when (data) {
|
|
|
- is LuckyFruitEntrance -> {
|
|
|
- goLocalLinkPage(activity, urlConfigService.getH5Url(H5Page.LUCKY_FRUIT))
|
|
|
- }
|
|
|
-
|
|
|
- is RechargePackageEntrance -> {
|
|
|
- Router.getRouterInstance<BaseDialogFragment>(Operation.RechargePackage.PATH)
|
|
|
- ?.apply {
|
|
|
- arguments = Bundle()
|
|
|
- .apply {
|
|
|
- putInt(EXTRA_SOURCE, SOURCE_ROOM_OPERATION)
|
|
|
- }
|
|
|
- }
|
|
|
- ?.show(fragmentManager)
|
|
|
- }
|
|
|
-
|
|
|
- is SlotEntrance -> {
|
|
|
- activity?.let {
|
|
|
- Router.build(it, Web.FullScreen.PATH)
|
|
|
- .putExtra(Web.Common.EXTRA_URL, urlConfigService.getH5Url(H5Page.SLOT))
|
|
|
- .start()
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- is GreedyProEntrance -> {
|
|
|
- goLocalLinkPage(activity, urlConfigService.getH5Url(H5Page.GREEDY_PRO))
|
|
|
- }
|
|
|
-
|
|
|
- is GreedyBoxEntrance -> {
|
|
|
- showGreedyBox()
|
|
|
- }
|
|
|
-
|
|
|
- is SlotProEntrance -> {
|
|
|
- showSlotPro()
|
|
|
- }
|
|
|
-
|
|
|
-// is LuckyGameLevelEntrance -> {
|
|
|
-// activity?.let {
|
|
|
-// Router.build(it, Web.FullScreen.PATH)
|
|
|
-// .putExtra(Web.Common.EXTRA_URL, UrlConfig.luckyGame)
|
|
|
-// .start()
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
- is LuckyProEntrance -> {
|
|
|
- goLocalLinkPage(activity, urlConfigService.getH5Url(H5Page.LUCKY_PRO))
|
|
|
- }
|
|
|
- }
|
|
|
+ handleBannerClick(data)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// viewBinding.enlargeIv.setOnClickListener {
|
|
|
-// viewBinding.banner.show()
|
|
|
-// viewBinding.indicator.show()
|
|
|
-// viewBinding.enlargeIv.gone()
|
|
|
-// viewBinding.shrinkIv.show()
|
|
|
-// }
|
|
|
-// viewBinding.shrinkIv.setOnClickListener {
|
|
|
-// viewBinding.banner.hide()
|
|
|
-// viewBinding.indicator.hide()
|
|
|
-// viewBinding.enlargeIv.show()
|
|
|
-// viewBinding.shrinkIv.gone()
|
|
|
-// }
|
|
|
-// if (isSmallScreenDevice()) {
|
|
|
-// viewBinding.shrinkIv.performClick()
|
|
|
-// } else {
|
|
|
-// viewBinding.enlargeIv.performClick()
|
|
|
-// }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -140,186 +69,148 @@ class GameComp(
|
|
|
private val rechargePackageViewModel by fastLazy {
|
|
|
OperationModule.getRechargePackageViewModel(requireActivity())
|
|
|
}
|
|
|
- private val rouletteViewModel by fastLazy {
|
|
|
- GameModule.getRouletteViewModel(viewModelStoreOwner)
|
|
|
- }
|
|
|
private val gameEntrances = arrayListOf<GameEntrance>()
|
|
|
private val gameEntranceMap = hashMapOf<GameEntranceType, GameEntrance>()
|
|
|
private val gameEntranceAdapter by fastLazy { GameEntranceAdapter(arrayListOf()) }
|
|
|
|
|
|
- private var greedyBoxShowConfig: GameShowConfig? = null
|
|
|
- private var slotProShowConfig: GameShowConfig? = null
|
|
|
-
|
|
|
- override fun onCreate() {
|
|
|
- super.onCreate()
|
|
|
- GameOpenGuide.register(activity)
|
|
|
- }
|
|
|
-
|
|
|
override fun onNewIntent(intent: Intent?) {
|
|
|
super.onNewIntent(intent)
|
|
|
loadData()
|
|
|
}
|
|
|
|
|
|
- private fun showSlotPro() {
|
|
|
- val activity = activity ?: return
|
|
|
- WebViewDialogFragmentBuilder()
|
|
|
- .height(1340 * DisplayUtil.getScreenWidth() / 750)
|
|
|
- .loadingUrl(slotProShowConfig?.loadingUrl)
|
|
|
- .offlineGameInfo(OfflineH5GameInfo(slotProShowConfig?.url, DecorType.JACKPOT_SLOT_GAME.value))
|
|
|
- .build()
|
|
|
- ?.showUrl(activity.supportFragmentManager, "")
|
|
|
- }
|
|
|
-
|
|
|
- private fun showGreedyBox() {
|
|
|
- val activity = activity ?: return
|
|
|
- WebViewDialogFragmentBuilder()
|
|
|
- .height(761 * DisplayUtil.getScreenWidth() / 750)
|
|
|
- .loadingUrl(greedyBoxShowConfig?.loadingUrl)
|
|
|
- .offlineGameInfo(OfflineH5GameInfo(greedyBoxShowConfig?.offlineUrl, DecorType.GREEDY_BOX_GAME.value))
|
|
|
- .build()
|
|
|
- ?.showUrl(activity.supportFragmentManager, "")
|
|
|
- }
|
|
|
-
|
|
|
override fun observeViewModel() {
|
|
|
rechargePackageViewModel?.entranceConfigLDMap?.get(EntranceType.ROOM_OPERATION)
|
|
|
?.observe(viewLifecycleOwner) {
|
|
|
if (it == null) {
|
|
|
removeEntrance(GameEntranceType.RECHARGE_PACKAGE)
|
|
|
} else {
|
|
|
- addEntrance(RechargePackageEntrance(it.getIcon(languageManager?.getLanguageCode())))
|
|
|
+ addEntrance(RechargePackageEntrance(it))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private fun checkAndShowGameOpenGuide() {
|
|
|
- val hasShowGameOpenGuide = GuideLabel.isGuideFinished(RoomGuideLabel.GAME_OPEN)
|
|
|
- if (hasShowGameOpenGuide) {
|
|
|
- return
|
|
|
- }
|
|
|
- GuideCenter.activeGuide(RoomGuideType.GAME_OPEN)
|
|
|
+ private fun showSlotPro(loadingUrl: String? = "") {
|
|
|
+ gameViewModel?.checkGameValid(GlobalConfigType.GLOBAL_JACKPOT_SLOT_VERSION_INFO)
|
|
|
+ ?.observe(viewLifecycleOwner) {
|
|
|
+ if(it.first.not()) return@observe
|
|
|
+ val resourceUrl = it.second?.resourceUrl
|
|
|
+ val needDownload = it.second?.needDownload ?: true
|
|
|
+ val activity = activity ?: return@observe
|
|
|
+ WebViewDialogFragmentBuilder()
|
|
|
+ .height(1340 * DisplayUtil.getScreenWidth() / 750)
|
|
|
+ .loadingUrl(loadingUrl)
|
|
|
+ .offlineGameInfo(OfflineH5GameInfo(resourceUrl, DecorType.JACKPOT_SLOT_GAME.value, needDownload))
|
|
|
+ .build()
|
|
|
+ ?.showUrl(activity.supportFragmentManager, "")
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun showGreedyBox(loadingUrl: String? = "") {
|
|
|
+ gameViewModel?.checkGameValid(GlobalConfigType.GLOBAL_GREEDYBOX_VERSION_INFO)
|
|
|
+ ?.observe(viewLifecycleOwner) {
|
|
|
+ if(it.first.not()) return@observe
|
|
|
+ val resourceUrl = it.second?.resourceUrl
|
|
|
+ val needDownload = it.second?.needDownload ?: true
|
|
|
+ val activity = activity ?: return@observe
|
|
|
+ WebViewDialogFragmentBuilder()
|
|
|
+ .height(761 * DisplayUtil.getScreenWidth() / 750)
|
|
|
+ .loadingUrl(loadingUrl)
|
|
|
+ .offlineGameInfo(OfflineH5GameInfo(resourceUrl, DecorType.GREEDY_BOX_GAME.value, needDownload))
|
|
|
+ .build()
|
|
|
+ ?.showUrl(activity.supportFragmentManager, "")
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun showDragonFightEntry(loadingUrl: String? = "") {
|
|
|
+ gameViewModel?.checkGameValid(GlobalConfigType.GLOBAL_DRAGON_TIGER_FIGHT_VERSION_INFO)
|
|
|
+ ?.observe(viewLifecycleOwner) {
|
|
|
+ if(it.first.not()) return@observe
|
|
|
+ val resourceUrl = it.second?.resourceUrl
|
|
|
+ val needDownload = it.second?.needDownload ?: true
|
|
|
+ val activity = activity ?: return@observe
|
|
|
+ WebViewDialogFragmentBuilder()
|
|
|
+ .height(1070 * DisplayUtil.getScreenWidth() / 750)
|
|
|
+ .loadingUrl(loadingUrl)
|
|
|
+ .offlineGameInfo(OfflineH5GameInfo(resourceUrl, DecorType.DRAGON_TIGER_FIGHT_GAME.value, needDownload))
|
|
|
+ .build()
|
|
|
+ ?.showUrl(activity.supportFragmentManager, "")
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun showTeenPattiEntry(loadingUrl: String? = "") {
|
|
|
+ gameViewModel?.checkGameValid(GlobalConfigType.GLOBAL_TEENPATTI_VERSION_INFO)
|
|
|
+ ?.observe(viewLifecycleOwner) {
|
|
|
+ if(it.first.not()) return@observe
|
|
|
+ val resourceUrl = it.second?.resourceUrl
|
|
|
+ val needDownload = it.second?.needDownload ?: true
|
|
|
+ val activity = activity ?: return@observe
|
|
|
+ WebViewDialogFragmentBuilder()
|
|
|
+ .height(1170 * DisplayUtil.getScreenWidth() / 750)
|
|
|
+ .loadingUrl(loadingUrl)
|
|
|
+ .offlineGameInfo(OfflineH5GameInfo(resourceUrl, DecorType.TEEN_PATTI_GAME.value, needDownload))
|
|
|
+ .build()
|
|
|
+ ?.showUrl(activity.supportFragmentManager, "")
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun showTexasCowboyEntry(loadingUrl: String? = "") {
|
|
|
+ gameViewModel?.checkGameValid(GlobalConfigType.GLOBAL_TEXAS_COWBOY_VERSION_INFO)
|
|
|
+ ?.observe(viewLifecycleOwner) {
|
|
|
+ if(it.first.not()) return@observe
|
|
|
+ val resourceUrl = it.second?.resourceUrl
|
|
|
+ val needDownload = it.second?.needDownload ?: true
|
|
|
+ val activity = activity ?: return@observe
|
|
|
+ WebViewDialogFragmentBuilder()
|
|
|
+ .height(1230 * DisplayUtil.getScreenWidth() / 750)
|
|
|
+ .loadingUrl(loadingUrl)
|
|
|
+ .offlineGameInfo(OfflineH5GameInfo(resourceUrl, DecorType.TEXAS_GAME.value, needDownload))
|
|
|
+ .build()
|
|
|
+ ?.showUrl(activity.supportFragmentManager, "")
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun showRussianRouletteEntry(loadingUrl: String? = "") {
|
|
|
+ gameViewModel?.checkGameValid(GlobalConfigType.GLOBAL_RUSSIAN_TURNTABLE_VERSION_INFO)
|
|
|
+ ?.observe(viewLifecycleOwner) {
|
|
|
+ if(it.first.not()) return@observe
|
|
|
+ val resourceUrl = it.second?.resourceUrl
|
|
|
+ val needDownload = it.second?.needDownload ?: true
|
|
|
+ val activity = activity ?: return@observe
|
|
|
+ WebViewDialogFragmentBuilder()
|
|
|
+ .height(1123 * DisplayUtil.getScreenWidth() / 750)
|
|
|
+ .loadingUrl(loadingUrl)
|
|
|
+ .offlineGameInfo(OfflineH5GameInfo(resourceUrl, DecorType.RUSSIAN_TURNTABLE_GAME.value, needDownload))
|
|
|
+ .build()
|
|
|
+ ?.showUrl(activity.supportFragmentManager, "")
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override fun loadData() {
|
|
|
-// checkAndShowGameOpenGuide()
|
|
|
-// gameViewModel?.isShowLuckyFruit()?.observe(viewLifecycleOwner) {
|
|
|
-// when (it) {
|
|
|
-// is Rlt.Success -> {
|
|
|
-// if (it.data.data!!.show) {
|
|
|
-// addEntrance(
|
|
|
-// LuckyFruitEntrance(
|
|
|
-// UriUtil.getUriForResourceId(R.drawable.lucky_fruit_entry_ic)
|
|
|
-// .toString(), getCompatString(APP_R.string.game_luck_fruit)
|
|
|
-// )
|
|
|
-// )
|
|
|
-// } else {
|
|
|
-// removeEntrance(GameEntranceType.LUCKY_FRUIT)
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// is Rlt.Failed -> {
|
|
|
-// removeEntrance(GameEntranceType.LUCKY_FRUIT)
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
rechargePackageViewModel?.refreshConfig()
|
|
|
-// RoomModule.getJoinedRoomId()?.let { roomId ->
|
|
|
-// rouletteViewModel?.getRouletteGameInfo(roomId)?.observe(viewLifecycleOwner) {
|
|
|
-// if (it is Rlt.Success && it.data.show) {
|
|
|
-// if (it.data.playerInfoList.size > 0) {
|
|
|
-// showRouletteDialog()
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// gameViewModel?.isShowSlot()?.observe(viewLifecycleOwner) {
|
|
|
-// when (it) {
|
|
|
-// is Rlt.Success -> {
|
|
|
-// if (it.data.data!!.show) {
|
|
|
-// addEntrance(
|
|
|
-// SlotEntrance(
|
|
|
-// UriUtil.getUriForResourceId(R.drawable.room_slot_entry_ic)
|
|
|
-// .toString()
|
|
|
-// )
|
|
|
-// )
|
|
|
-// } else {
|
|
|
-// removeEntrance(GameEntranceType.SLOT)
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// is Rlt.Failed -> {
|
|
|
-// removeEntrance(GameEntranceType.SLOT)
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// gameViewModel?.isGameShow(
|
|
|
-// listOf(
|
|
|
-// DecorType.GREEDY_PRO_GAME.value,
|
|
|
-// DecorType.GREEDY_BOX_GAME.value,
|
|
|
-// DecorType.GAME_TAB_SWITCH.value,
|
|
|
-// DecorType.LUCKY_PRO_GAME.value,
|
|
|
-// DecorType.JACKPOT_SLOT.value,
|
|
|
-// )
|
|
|
-// )?.observe(viewLifecycleOwner) {
|
|
|
-// val greedyProShow = it[DecorType.GREEDY_PRO_GAME.value]?.show == true
|
|
|
-// val luckyGameLevelShow = it[DecorType.GAME_TAB_SWITCH.value]?.show == true
|
|
|
-// val showLuckyProGame = it[DecorType.LUCKY_PRO_GAME.value]?.show == true
|
|
|
-// greedyBoxShowConfig = it[DecorType.GREEDY_BOX_GAME.value]
|
|
|
-// slotProShowConfig = it[DecorType.JACKPOT_SLOT.value]
|
|
|
-//
|
|
|
-// if (greedyProShow) {
|
|
|
-// addEntrance(
|
|
|
-// GreedyProEntrance(
|
|
|
-// UriUtil.getUriForResourceId(R.drawable.room_greedy_pro_entry_ic)
|
|
|
-// .toString()
|
|
|
-// )
|
|
|
-// )
|
|
|
-// } else {
|
|
|
-// removeEntrance(GameEntranceType.GREEDY_PRO_GAME)
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (greedyBoxShowConfig?.show == true) {
|
|
|
-// addEntrance(
|
|
|
-// GreedyBoxEntrance(
|
|
|
-// UriUtil.getUriForResourceId(R.drawable.room_greedy_box_entry_ic)
|
|
|
-// .toString()
|
|
|
-// )
|
|
|
-// )
|
|
|
-// } else {
|
|
|
-// removeEntrance(GameEntranceType.GREEDY_BOX_GAME)
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (slotProShowConfig?.show == true) {
|
|
|
-// addEntrance(
|
|
|
-// SlotProEntrance(
|
|
|
-// UriUtil.getUriForResourceId(R.drawable.room_slot_pro_entry_ic)
|
|
|
-// .toString()
|
|
|
-// )
|
|
|
-// )
|
|
|
-// } else {
|
|
|
-// removeEntrance(GameEntranceType.JACKPOT_SLOT)
|
|
|
-// }
|
|
|
-//
|
|
|
-//// if (luckyGameLevelShow) {
|
|
|
-//// addEntrance(
|
|
|
-//// LuckyGameLevelEntrance(
|
|
|
-//// UriUtil.getUriForResourceId(R.drawable.room_lucky_game_level_entry_ic)
|
|
|
-//// .toString()
|
|
|
-//// )
|
|
|
-//// )
|
|
|
-//// } else {
|
|
|
-// removeEntrance(GameEntranceType.LUCKY_GAME_LEVEL)
|
|
|
-//// }
|
|
|
-// if (showLuckyProGame) {
|
|
|
-// addEntrance(
|
|
|
-// LuckyProEntrance(
|
|
|
-// UriUtil.getUriForResourceId(R.drawable.lucky_pro_entry_ic)
|
|
|
-// .toString()
|
|
|
-// )
|
|
|
-// )
|
|
|
-// } else {
|
|
|
-// removeEntrance(GameEntranceType.LUCKY_PRO_GAME)
|
|
|
-// }
|
|
|
-// }
|
|
|
+ gameViewModel?.isGameShow(
|
|
|
+ listOf(
|
|
|
+ DecorType.LUCKY_FRUIT_GAME.value,
|
|
|
+ DecorType.JACKPOT_GAME.value,
|
|
|
+ DecorType.JACKPOT_SLOT_GAME.value,
|
|
|
+ DecorType.GREEDY_BOX_GAME.value,
|
|
|
+ DecorType.TEEN_PATTI_GAME.value,
|
|
|
+ DecorType.DRAGON_TIGER_FIGHT_GAME.value,
|
|
|
+ DecorType.RUSSIAN_TURNTABLE_GAME.value,
|
|
|
+ DecorType.TEXAS_GAME.value,
|
|
|
+ DecorType.LUCKY_PRO_GAME.value,
|
|
|
+ DecorType.GREEDY_PRO_GAME.value
|
|
|
+ )
|
|
|
+ )?.observe(viewLifecycleOwner) { configMap ->
|
|
|
+ for((key, value) in configMap) {
|
|
|
+ if(value.show) {
|
|
|
+ val entrance = getEntrance(key) ?: continue
|
|
|
+ addEntrance(entrance)
|
|
|
+ } else {
|
|
|
+ val entranceType = getEntranceType(key)?: continue
|
|
|
+ removeEntrance(entranceType)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private fun addEntrance(entrance: GameEntrance) {
|
|
|
@@ -344,74 +235,96 @@ class GameComp(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private fun updateEntrance(entranceType: GameEntranceType, newEntrance: GameEntrance) {
|
|
|
- val oldEntrance = gameEntranceMap[entranceType] ?: return
|
|
|
- when (entranceType) {
|
|
|
- GameEntranceType.LUCKY_FRUIT -> {
|
|
|
- val oldData = (oldEntrance as? LuckyFruitEntrance) ?: return
|
|
|
- val newData = (newEntrance as? LuckyFruitEntrance) ?: return
|
|
|
- oldData.icon = newData.icon
|
|
|
- oldData.title = newData.title
|
|
|
+ private fun handleBannerClick(data: Any) {
|
|
|
+ when (data) {
|
|
|
+ is RechargePackageEntrance -> {
|
|
|
+ Router.getRouterInstance<BaseDialogFragment>(Operation.RechargePackage.PATH)
|
|
|
+ ?.apply {
|
|
|
+ arguments = Bundle()
|
|
|
+ .apply {
|
|
|
+ putInt(EXTRA_SOURCE, SOURCE_ROOM_OPERATION)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ?.show(fragmentManager)
|
|
|
+ }
|
|
|
+
|
|
|
+ is LuckyFruitEntrance -> {
|
|
|
+ goLocalLinkPage(activity, urlConfigService.getH5Url(H5Page.LUCKY_FRUIT))
|
|
|
+ }
|
|
|
+
|
|
|
+ is SlotEntrance -> {
|
|
|
+ val activity = activity ?: return
|
|
|
+ WebViewDialogFragmentBuilder()
|
|
|
+ .height(1300 * DisplayUtil.getScreenWidth() / 750)
|
|
|
+ .build()
|
|
|
+ ?.showUrl(activity.supportFragmentManager, urlConfigService.getH5Url(H5Page.SLOT))
|
|
|
+ }
|
|
|
+
|
|
|
+ is GreedyProEntrance -> {
|
|
|
+ val activity = activity?: return
|
|
|
+ goLocalLinkPage(activity, urlConfigService.getH5Url(H5Page.GREEDY_PRO))
|
|
|
}
|
|
|
|
|
|
- GameEntranceType.RECHARGE_PACKAGE -> {
|
|
|
- val oldData = (oldEntrance as? RechargePackageEntrance) ?: return
|
|
|
- val newData = (newEntrance as? RechargePackageEntrance) ?: return
|
|
|
- oldData.icon = newData.icon
|
|
|
+ is GreedyBoxEntrance -> {
|
|
|
+ showGreedyBox()
|
|
|
}
|
|
|
|
|
|
- GameEntranceType.SLOT -> {
|
|
|
- val oldData = (oldEntrance as? SlotEntrance) ?: return
|
|
|
- val newData = (newEntrance as? SlotEntrance) ?: return
|
|
|
- oldData.icon = newData.icon
|
|
|
+ is SlotProEntrance -> {
|
|
|
+ showSlotPro()
|
|
|
}
|
|
|
|
|
|
- GameEntranceType.GREEDY_PRO -> {
|
|
|
- val oldData = (oldEntrance as? GreedyProEntrance) ?: return
|
|
|
- val newData = (newEntrance as? GreedyProEntrance) ?: return
|
|
|
- oldData.icon = newData.icon
|
|
|
+ is LuckyProEntrance -> {
|
|
|
+ val activity = activity?: return
|
|
|
+ goLocalLinkPage(activity, urlConfigService.getH5Url(H5Page.LUCKY_PRO))
|
|
|
}
|
|
|
|
|
|
- GameEntranceType.GREEDY_BOX -> {
|
|
|
- val oldData = (oldEntrance as? GreedyBoxEntrance) ?: return
|
|
|
- val newData = (newEntrance as? GreedyBoxEntrance) ?: return
|
|
|
- oldData.icon = newData.icon
|
|
|
+ is TeenPattiEntrance -> {
|
|
|
+ showTeenPattiEntry()
|
|
|
}
|
|
|
|
|
|
- GameEntranceType.LUCKY_GAME_LEVEL -> {
|
|
|
- val oldData = (oldEntrance as? LuckyGameLevelEntrance) ?: return
|
|
|
- val newData = (newEntrance as? LuckyGameLevelEntrance) ?: return
|
|
|
- oldData.icon = newData.icon
|
|
|
+ is RussianRouletteEntrance -> {
|
|
|
+ showRussianRouletteEntry()
|
|
|
}
|
|
|
|
|
|
- GameEntranceType.LUCKY_PRO -> {
|
|
|
- val oldData = (oldEntrance as? LuckyProEntrance) ?: return
|
|
|
- val newData = (newEntrance as? LuckyProEntrance) ?: return
|
|
|
- oldData.icon = newData.icon
|
|
|
+ is TexasCowboyEntrance -> {
|
|
|
+ showTexasCowboyEntry()
|
|
|
}
|
|
|
|
|
|
- GameEntranceType.SLOT_PRO -> {
|
|
|
- val oldData = (oldEntrance as? SlotProEntrance) ?: return
|
|
|
- val newData = (newEntrance as? SlotProEntrance) ?: return
|
|
|
- oldData.icon = newData.icon
|
|
|
+ is DragonTigerEntrance -> {
|
|
|
+ showDragonFightEntry()
|
|
|
}
|
|
|
}
|
|
|
- gameEntranceAdapter.notifyDataSetChanged()
|
|
|
}
|
|
|
|
|
|
- private fun showRouletteDialog() {
|
|
|
- Router.getRouterInstance<BaseDialogFragment>(Game.Roulette.PATH)?.apply {
|
|
|
- arguments = Bundle().apply {
|
|
|
- putLong(
|
|
|
- Game.Common.EXTRA_ROOM_ID,
|
|
|
- RoomModule.getJoinedRoomId() ?: 0
|
|
|
- )
|
|
|
- }
|
|
|
- }?.show(fragmentManager)
|
|
|
+ private fun getEntrance(id: Int): GameEntrance? {
|
|
|
+ return when(id) {
|
|
|
+ DecorType.LUCKY_FRUIT_GAME.value -> LuckyFruitEntrance()
|
|
|
+ DecorType.LUCKY_PRO_GAME.value -> LuckyProEntrance()
|
|
|
+ DecorType.GREEDY_PRO_GAME.value -> GreedyProEntrance()
|
|
|
+ DecorType.JACKPOT_GAME.value -> SlotEntrance()
|
|
|
+ DecorType.JACKPOT_SLOT_GAME.value -> SlotProEntrance()
|
|
|
+ DecorType.GREEDY_BOX_GAME.value -> GreedyBoxEntrance()
|
|
|
+ DecorType.TEEN_PATTI_GAME.value -> TeenPattiEntrance()
|
|
|
+ DecorType.RUSSIAN_TURNTABLE_GAME.value -> RussianRouletteEntrance()
|
|
|
+ DecorType.TEXAS_GAME.value -> TexasCowboyEntrance()
|
|
|
+ DecorType.DRAGON_TIGER_FIGHT_GAME.value -> DragonTigerEntrance()
|
|
|
+ else -> null
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- override fun onDestroy() {
|
|
|
- super.onDestroy()
|
|
|
- GameOpenGuide.unregister()
|
|
|
+ private fun getEntranceType(id: Int): GameEntranceType? {
|
|
|
+ return when(id) {
|
|
|
+ DecorType.LUCKY_FRUIT_GAME.value -> GameEntranceType.LUCKY_FRUIT
|
|
|
+ DecorType.LUCKY_PRO_GAME.value -> GameEntranceType.LUCKY_PRO
|
|
|
+ DecorType.GREEDY_PRO_GAME.value -> GameEntranceType.GREEDY_PRO
|
|
|
+ DecorType.JACKPOT_GAME.value -> GameEntranceType.SLOT
|
|
|
+ DecorType.JACKPOT_SLOT_GAME.value -> GameEntranceType.SLOT_PRO
|
|
|
+ DecorType.GREEDY_BOX_GAME.value -> GameEntranceType.GREEDY_BOX
|
|
|
+ DecorType.TEEN_PATTI_GAME.value -> GameEntranceType.TEEN_PATTI
|
|
|
+ DecorType.RUSSIAN_TURNTABLE_GAME.value -> GameEntranceType.RUSSIAN_ROULETTE
|
|
|
+ DecorType.TEXAS_GAME.value -> GameEntranceType.TEXAS_COWBOY
|
|
|
+ DecorType.DRAGON_TIGER_FIGHT_GAME.value -> GameEntranceType.DRAGON_TIGER_SLOT
|
|
|
+ else -> null
|
|
|
+ }
|
|
|
}
|
|
|
}
|