Browse Source

1.修改首页推荐进入游戏,然后退出游戏后,返回到全部训练页面,返回页面不正确bug

王鹏鹏 2 years ago
parent
commit
e892ed2eba

+ 3 - 1
game/src/main/java/com/yingyangfly/game/introduction/GameIntroductionActivity.kt

@@ -42,6 +42,7 @@ class GameIntroductionActivity :
     private var gameCode: String = ""
     private var playClass: String = ""
     private var gameBean: GameBean? = null
+    private var homePage: Boolean = false
     private var mVodPlayer: TXVodPlayer? = null
 
     /**
@@ -53,6 +54,7 @@ class GameIntroductionActivity :
         desn = intent.getStringExtra("desn") ?: ""
         gameCode = intent.getStringExtra("gameCode") ?: ""
         playClass = intent.getStringExtra("playClass") ?: ""
+        homePage = intent.getBooleanExtra("homePage", false)
         voicePlayer = VoicePlayer.getInstance(mContext)
         mVodPlayer = TXVodPlayer(mContext)
         if (isEnterGame.not()) {
@@ -192,7 +194,7 @@ class GameIntroductionActivity :
                             if (isEnterGame) {
                                 val exitGameDialog = ExitGameDialog()
                                 exitGameDialog.onDialogClickListener = {
-                                    if (TextUtils.equals("A", playClass)) {
+                                    if (homePage) {
                                         JumpUtil.jumpActivity(RouterUrlCommon.home, mContext)
                                     } else {
                                         JumpUtil.jumpActivity(RouterUrlCommon.freeTrain, mContext)

+ 2 - 0
home/src/main/java/com/yingyangfly/home/activity/HomeActivity.kt

@@ -364,6 +364,7 @@ class HomeActivity : BaseMVVMActivity<ActivityHomeBinding, HomeViewModel>(),
             .withString("playClass", bean.playClass)
             .withString("videoUrl", bean.gameVideoUrl)
             .withString("desn", bean.desn)
+            .withBoolean("homePage", true)
             .withTransition(R.anim.leftin, R.anim.leftout)
             .navigation(mContext)
     }
@@ -570,6 +571,7 @@ class HomeActivity : BaseMVVMActivity<ActivityHomeBinding, HomeViewModel>(),
             .withString("playClass", "A")
             .withString("videoUrl", bean.gameVideoUrl)
             .withString("desn", bean.desn)
+            .withBoolean("homePage", true)
             .withTransition(R.anim.leftin, R.anim.leftout)
             .navigation(mContext)
     }