王鹏鹏 před 2 roky
rodič
revize
3a25435a2a

+ 20 - 2
game/src/main/java/com/yingyangfly/game/introduction/GameIntroductionActivity.kt

@@ -7,6 +7,7 @@ import android.content.Context
 import android.content.Intent
 import android.text.TextUtils
 import android.text.method.ScrollingMovementMethod
+import android.util.Log
 import android.view.MotionEvent
 import android.view.View
 import com.alibaba.android.arouter.facade.annotation.Route
@@ -44,6 +45,7 @@ class GameIntroductionActivity :
     private var gameBean: GameBean? = null
     private var homePage: Boolean = false
     private var mVodPlayer: TXVodPlayer? = null
+    private var loadingOver = false
 
     /**
      * 语音合成
@@ -194,8 +196,16 @@ class GameIntroductionActivity :
                             if (isEnterGame) {
                                 val exitGameDialog = ExitGameDialog()
                                 exitGameDialog.onDialogClickListener = {
-                                    LiveEventBusUtil.send(RxBusCodes.CALLQUITGAME, "")
-                                    finish()
+                                    if (loadingOver) {
+                                        LiveEventBusUtil.send(RxBusCodes.CALLQUITGAME, "")
+                                        finish()
+                                    } else {
+                                        if (homePage) {
+                                            JumpUtil.jumpActivity(RouterUrlCommon.home, mContext)
+                                        } else {
+                                            JumpUtil.jumpActivity(RouterUrlCommon.freeTrain, mContext)
+                                        }
+                                    }
                                 }
                                 exitGameDialog.show(supportFragmentManager, "exitGameDialog")
                             } else {
@@ -330,6 +340,14 @@ class GameIntroductionActivity :
                 finish()
             }
         }
+
+        //游戏加载完成
+        LiveEventBusUtil.observer<String>(this, RxBusCodes.LOADINGOVER) {
+            runOnUiThread {
+                Log.e("wpp", "--------------------------->游戏加载完成")
+                loadingOver = true
+            }
+        }
     }
 
     /**