|
@@ -2,7 +2,6 @@ package com.yingyangfly.game.introduction
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
import android.os.Bundle
|
|
|
-import android.text.TextUtils
|
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
@@ -23,10 +22,12 @@ class GameIntroductionActivity :
|
|
|
BaseMVVMActivity<ActivityGameIntroductionBinding, GameIntroductionViewModel>(),
|
|
|
View.OnTouchListener {
|
|
|
|
|
|
- private var id: String = ""
|
|
|
+ private var gameCode: String = ""
|
|
|
+ private var playClass: String = ""
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
- id = intent.getStringExtra("url") ?: ""
|
|
|
+ gameCode = intent.getStringExtra("gameCode") ?: ""
|
|
|
+ playClass = intent.getStringExtra("playClass") ?: ""
|
|
|
super.onCreate(savedInstanceState)
|
|
|
}
|
|
|
|
|
@@ -49,29 +50,19 @@ class GameIntroductionActivity :
|
|
|
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
- if (TextUtils.isEmpty(id).not()) {
|
|
|
- viewModel.getGameDetail(id, fail = {
|
|
|
-
|
|
|
- }, success = {
|
|
|
- if (it != null) {
|
|
|
- binding.data = it
|
|
|
- if (TextUtils.isEmpty(it.gameVideoUrl).not()) {
|
|
|
- initPalyer(it)
|
|
|
- }
|
|
|
- getGameDetailByCode(it.gameCode, it.playClass)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ getGameDetailByCode()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取游戏信息
|
|
|
*/
|
|
|
- private fun getGameDetailByCode(gameCode: String, playClass: String) {
|
|
|
+ private fun getGameDetailByCode() {
|
|
|
viewModel.getGameDetailByCode(gameCode, playClass, fail = {
|
|
|
|
|
|
}, success = {
|
|
|
-
|
|
|
+ if (it != null) {
|
|
|
+ binding.data = it
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -95,7 +86,7 @@ class GameIntroductionActivity :
|
|
|
if (v.id == R.id.homeImage) {
|
|
|
JumpUtil.jumpActivity(RouterUrlCommon.home, mContext)
|
|
|
} else if (v.id == R.id.btnStartGame) {
|
|
|
- JumpUtil.jumpActivityWithUrl(RouterUrlCommon.playGame, id, mContext)
|
|
|
+// JumpUtil.jumpActivityWithUrl(RouterUrlCommon.playGame, id, mContext)
|
|
|
}
|
|
|
}
|
|
|
MotionEvent.ACTION_CANCEL -> {
|