|
|
@@ -7,7 +7,6 @@ import android.content.Context
|
|
|
import android.content.Intent
|
|
|
import android.os.Build
|
|
|
import android.text.TextUtils
|
|
|
-import android.util.Log
|
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
|
import android.view.ViewTreeObserver
|
|
|
@@ -21,12 +20,12 @@ import androidx.constraintlayout.widget.ConstraintSet
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
import com.alibaba.android.arouter.launcher.ARouter
|
|
|
import com.bumptech.glide.Glide
|
|
|
-import com.tencent.bugly.crashreport.CrashReport
|
|
|
import com.yingyangfly.baselib.bean.GameDataBean
|
|
|
import com.yingyangfly.baselib.bean.GetSaveGameRecordBean
|
|
|
import com.yingyangfly.baselib.db.VoicePlayerBean
|
|
|
import com.yingyangfly.baselib.ext.getEndAnimation
|
|
|
import com.yingyangfly.baselib.ext.getScaleAnimation
|
|
|
+import com.yingyangfly.baselib.ext.logd
|
|
|
import com.yingyangfly.baselib.ext.show
|
|
|
import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
|
|
|
import com.yingyangfly.baselib.player.VoicePlayer
|
|
|
@@ -36,9 +35,7 @@ import com.yingyangfly.baselib.utils.GsonUtil
|
|
|
import com.yingyangfly.baselib.utils.JumpUtil
|
|
|
import com.yingyangfly.baselib.utils.LiveEventBusUtil
|
|
|
import com.yingyangfly.baselib.utils.RxBusCodes
|
|
|
-import com.yingyangfly.baselib.utils.User
|
|
|
import com.yingyangfly.baselib.utils.img.ImgUtil
|
|
|
-import com.yingyangfly.game.BuildConfig
|
|
|
import com.yingyangfly.game.R
|
|
|
import com.yingyangfly.game.databinding.ActivityPlayGameBinding
|
|
|
import com.yingyangfly.game.dialog.CompletionTrainingDialog
|
|
|
@@ -187,7 +184,7 @@ class PlayGameActivity : BaseMVVMActivity<ActivityPlayGameBinding, PlayGameViewM
|
|
|
binding.webView.evaluateJavascript(
|
|
|
"javascript:CallContinueGame()"
|
|
|
) {
|
|
|
- Log.e("wpp", "----------------继续游戏")
|
|
|
+ "游戏介绍页面返回继续游戏".logd()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -285,18 +282,17 @@ class PlayGameActivity : BaseMVVMActivity<ActivityPlayGameBinding, PlayGameViewM
|
|
|
R.id.imagePause -> {
|
|
|
runOnUiThread {
|
|
|
if (callQuitGame) {
|
|
|
- reportGameCrashInfo("游戏结束退出失败,通过返回键退出游戏")
|
|
|
ActivityManagers.instance.finishActivity(GameIntroductionActivity::class.java)
|
|
|
finish()
|
|
|
} else {
|
|
|
if (TextUtils.equals("D", playClass)) {
|
|
|
finish()
|
|
|
} else {
|
|
|
- Log.e("wpp", "游戏暂停")
|
|
|
+ "点击暂停游戏".logd()
|
|
|
binding.webView.evaluateJavascript(
|
|
|
"javascript:CallPauseGame()"
|
|
|
) {
|
|
|
- Log.e("wpp", "游戏暂停成功跳转介绍")
|
|
|
+ "游戏暂停成功跳转介绍".logd()
|
|
|
ARouter.getInstance()
|
|
|
.build(RouterUrlCommon.gameIntroduction)
|
|
|
.withString("gameCode", gameCode).withString("id", id)
|
|
|
@@ -480,7 +476,8 @@ class PlayGameActivity : BaseMVVMActivity<ActivityPlayGameBinding, PlayGameViewM
|
|
|
LiveEventBusUtil.observer<String>(this, RxBusCodes.SAVEDATA) {
|
|
|
runOnUiThread {
|
|
|
if (TextUtils.isEmpty(it).not()) {
|
|
|
- Log.e("wpp", "游戏保存-----------$it")
|
|
|
+ val message = "游戏进度保存$it"
|
|
|
+ message.logd()
|
|
|
val gameDataBean = GsonUtil.GsonToBean(it, GameDataBean::class.java)
|
|
|
if (gameDataBean != null) {
|
|
|
val score: Int = gameTotalScore.toInt() + gameDataBean.curLevelScore.toInt()
|
|
|
@@ -503,11 +500,7 @@ class PlayGameActivity : BaseMVVMActivity<ActivityPlayGameBinding, PlayGameViewM
|
|
|
} else {
|
|
|
parsingData(gameDataBean, isPass)
|
|
|
}
|
|
|
- } else {
|
|
|
- reportGameCrashInfo("h5返回信息解析失败")
|
|
|
}
|
|
|
- } else {
|
|
|
- reportGameCrashInfo("h5返回游戏信息为空")
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -740,18 +733,4 @@ class PlayGameActivity : BaseMVVMActivity<ActivityPlayGameBinding, PlayGameViewM
|
|
|
val cn = am.getRunningTasks(1)[0].topActivity
|
|
|
return cn!!.className == activity.javaClass.name
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 上报游戏异常
|
|
|
- */
|
|
|
- private fun reportGameCrashInfo(msg: String) {
|
|
|
- if (BuildConfig.DEBUG) {
|
|
|
- Log.e("wpp", "游戏页面日志上报----------------->$msg")
|
|
|
- CrashReport.postCatchedException(
|
|
|
- Throwable(
|
|
|
- msg + "\n用户信息:" + User.getName() + User.getUserId() + "\n游戏名称: " + gameName + "游戏code: " + gameCode
|
|
|
- )
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
}
|