Kaynağa Gözat

1.添加游戏结算页面

王鹏鹏 2 yıl önce
ebeveyn
işleme
d60b1dbd20

+ 8 - 4
game/src/main/java/com/yingyangfly/game/dialog/GameResultDialog.kt

@@ -93,15 +93,19 @@ class GameResultDialog : DialogFragment() {
 
     @SuppressLint("SetTextI18n")
     private fun initData() {
-        if (TextUtils.equals("1", isPass)) {
+        if (TextUtils.equals("0", isPass)) {
+            imageBackground?.setBackgroundResource(R.mipmap.icon_game_success)
+        } else {
             imageBackground?.setBackgroundResource(R.mipmap.icon_game_fail)
+        }
+        tvGameLevel?.text = if (TextUtils.equals("4", isPass)) {
+            "超时游戏失败"
         } else {
-            imageBackground?.setBackgroundResource(R.mipmap.icon_game_success)
+            "当前关卡:$curLevel"
         }
-        tvGameLevel?.text = "当前关卡:$curLevel"
         tvTotalGameScore?.text = "总得分:" + totalScore + "分"
         tvGameScore?.text = "本关得分:" + curLevelScore + "分"
-        btnContinueThisLevel!!.text = if(TextUtils.equals("0", isPass)){
+        btnContinueThisLevel!!.text = if (TextUtils.equals("0", isPass)) {
             "下一关"
         } else {
             "继续本关"