소스 검색

1.添加游戏结算页面

王鹏鹏 2 년 전
부모
커밋
d60b1dbd20
1개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 4
      game/src/main/java/com/yingyangfly/game/dialog/GameResultDialog.kt

+ 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 {
             "继续本关"