浏览代码

提交人:jtm
提交内容:bug fixed

江天明 1 年之前
父节点
当前提交
aa61244c0a
共有 1 个文件被更改,包括 32 次插入3 次删除
  1. 32 3
      BusinessStep/src/main/java/com/develop/step/ui/ModesDetailActivity.kt

+ 32 - 3
BusinessStep/src/main/java/com/develop/step/ui/ModesDetailActivity.kt

@@ -369,7 +369,7 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         }
         pressStartTime = -1L
 
-        if (viewModel.modeType != ModesType.TURBO.name && event.keyCode == PRESS_DOWN_KEY_CODE && canStart) {
+        if (modeType != ModesType.WIGHT.name && modeType != ModesType.TURBO.name && event.keyCode == PRESS_DOWN_KEY_CODE && canStart) {
             //非turbo模式
             if (userChanging && currDevInfo.status.toByte() != DevStatus.STOP) {
                 //用户调节中
@@ -384,6 +384,9 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
                 }
             }
         }
+        if (modeType == ModesType.WIGHT.name) {
+            weightClearClick();
+        }
         canStart = true
         return super.onKeyUp(keyCode, event)
     }
@@ -1706,8 +1709,21 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         binding.ivWeight.visibility = View.GONE
         binding.tvModeName.text = viewModel.getModeTitle(resources)
 
+        val workMode = ConfigUtils.getMode(modeType)
         if (!isNightTheme()) {
-            Glide.with(this).load(viewModel.getBanner()).into(binding.ivBanner)
+            if (workMode == null) {
+                Glide.with(this).load(com.develop.common.R.drawable.ic_mode_diy)
+                    .into(binding.ivBanner)
+            } else {
+                Glide.with(this).load(
+                    resources.getIdentifier(
+                        workMode.bg,
+                        "drawable",
+                        this.packageName
+                    )
+                )
+                    .into(binding.ivBanner)
+            }
         }
     }
 
@@ -1728,8 +1744,21 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         binding.ivWeight.visibility = View.GONE
         Log.d("dddddd", "llTurboView===VISIBLE")
         binding.llTurboView.visibility = View.VISIBLE
+        val workMode = ConfigUtils.getMode(modeType)
         if (!isNightTheme()) {
-            Glide.with(this).load(viewModel.getBanner()).into(binding.ivBanner)
+            if (workMode == null) {
+                Glide.with(this).load(com.develop.common.R.drawable.ic_mode_diy)
+                    .into(binding.ivBanner)
+            } else {
+                Glide.with(this).load(
+                    resources.getIdentifier(
+                        workMode.bg,
+                        "drawable",
+                        this.packageName
+                    )
+                )
+                    .into(binding.ivBanner)
+            }
         }
     }