|
@@ -45,6 +45,7 @@ import java.io.File
|
|
|
class GamePlayDialog : BaseXDFragment<DialogGamePlayBinding>(), IRoomActiveListener {
|
|
|
|
|
|
private var url = ""
|
|
|
+ private var gameType = ""
|
|
|
|
|
|
private var webView: WebView? = null
|
|
|
private var localGameUrl = ""
|
|
@@ -64,11 +65,13 @@ class GamePlayDialog : BaseXDFragment<DialogGamePlayBinding>(), IRoomActiveListe
|
|
|
companion object {
|
|
|
private const val URL = "url"
|
|
|
private const val FULL_GAME = "fullGame"
|
|
|
- fun newInstance(url: String,isFullGame:Boolean): GamePlayDialog {
|
|
|
+ private const val GAME_TYPE = "gameType"
|
|
|
+ fun newInstance(url: String,isFullGame:Boolean,gameType:String): GamePlayDialog {
|
|
|
val dialog = GamePlayDialog()
|
|
|
val bundle = Bundle()
|
|
|
bundle.putString(URL, url)
|
|
|
bundle.putBoolean(FULL_GAME, isFullGame)
|
|
|
+ bundle.putString(GAME_TYPE,gameType)
|
|
|
dialog.arguments = bundle
|
|
|
return dialog
|
|
|
}
|
|
@@ -84,6 +87,23 @@ class GamePlayDialog : BaseXDFragment<DialogGamePlayBinding>(), IRoomActiveListe
|
|
|
override fun initOther() {
|
|
|
SwagoRoomManager.addListener(this)
|
|
|
arguments?.let {
|
|
|
+ gameType = it.getString(GAME_TYPE,"")
|
|
|
+ when(gameType){
|
|
|
+ "1" ->
|
|
|
+ binding.ivBg.setBackgroundResource(R.mipmap.bg_three_card)
|
|
|
+ "2" ->
|
|
|
+ binding.ivBg.setBackgroundResource(R.mipmap.bg_fruit_party)
|
|
|
+ "3" ->
|
|
|
+ binding.ivBg.setBackgroundResource(R.mipmap.bg_frenzy_vagas)
|
|
|
+ "4" ->
|
|
|
+ binding.ivBg.setBackgroundResource(R.mipmap.bg_three_card_duel)
|
|
|
+ "6" ->
|
|
|
+ binding.ivBg.setBackgroundResource(R.mipmap.bg_food_wheel)
|
|
|
+ "7" ->
|
|
|
+ binding.ivBg.setBackgroundResource(R.mipmap.bg_lucky_piggy)
|
|
|
+ "8" ->
|
|
|
+ binding.ivBg.setBackgroundResource(R.mipmap.bg_magical_piggy)
|
|
|
+ }
|
|
|
url = it.getString(URL, "")
|
|
|
if (url.startsWith("file://")){
|
|
|
localGameUrl = url
|