Browse Source

045处理

zhangshenjie 5 months ago
parent
commit
fcf64515fd

+ 14 - 4
BusinessCommon/src/main/java/com/develop/common/ui/CommonBindingActivity.kt

@@ -79,6 +79,7 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
     private var screenSaverTime = 3 //minute
     var isKeyLong = false
     private var isRunning = false
+    private var basePotCloverEleStatus = -1
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         is062 = isBrand062()
@@ -143,6 +144,8 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
         EventBus.getDefault().unregister(this)
         super.onPause()
         isResume = false
+        //由于程序返回后台问题会导致 isRunning 是true  , 估再 onPause 设置 false
+        isRunning = false
         stopScreenSaverCount()
 
     }
@@ -501,12 +504,19 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
 
     @Subscribe
     fun onBaseDevStateEvent(event: DevStatusEvent) {
-//        if (baseSn.startsWith("063") && event.devInfo.status == DevStatus.RUNNING.toInt()) {
-//            isRunning = true
-//        }
+        if (baseSn.startsWith("063") &&  event.devInfo.status == DevStatus.RUNNING.toInt() ) {
+//            if (event.devInfo.potCloverEleStatus.toInt() == 0 && basePotCloverEleStatus != 0){
+//                basePotCloverEleStatus = 0
+//            }else if (event.devInfo.potCloverEleStatus.toInt() == 1 && basePotCloverEleStatus != 1){
+//                basePotCloverEleStatus = 1
+//            }else if (event.devInfo.potCloverEleStatus.toInt() == 2 && basePotCloverEleStatus != 2){
+//                basePotCloverEleStatus = 2
+//            }
+            isRunning = true
+        }
 
 //        Log.d("TAG Base DevStateEvent", "event:" + event.devInfo.toString())
-        if (baseSn.startsWith("063") && (event.devInfo.potCloverEleStatus.toInt() == 1 && event.devInfo.status == DevStatus.STOP.toInt()) && !isShowSolenoidDilaog) {
+        if (baseSn.startsWith("063") && (event.devInfo.potCloverEleStatus.toInt() == 0 && (event.devInfo.status == DevStatus.STOP.toInt()||event.devInfo.status == DevStatus.PAUSE.toInt()))&& isRunning && !isShowSolenoidDilaog) {
             showSolenoidValveDialog()
         }
     }

BIN
BusinessCommon/src/main/res/drawable-xxxhdpi/account_background_045a.jpg


BIN
BusinessCommon/src/main/res/drawable-xxxhdpi/ic_logo_045a.webp


BIN
BusinessCommon/src/main/res/drawable-xxxhdpi/ic_screensaver_045a.png


+ 2 - 3
BusinessMain/src/main/java/com/develop/main/ui/ModeEntranceActivity.kt

@@ -133,7 +133,7 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
         }
 
         if (isNightTheme()) {
-             if (sn.startsWith("053")) {
+             if (sn.startsWith("053")||sn.startsWith("045")) {
                  binding.entranceRecycle.apply {
                      grid(2)
                      setup {
@@ -225,7 +225,7 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
                              }
                          }
                      }
-                 }.models = DataFactory.get053AEntranceData()
+                 }.models =  if (sn.startsWith("045")) DataFactory.get045AEntranceData()  else  DataFactory.get053AEntranceData()
              }else{
                  binding.entranceRecycle.apply {
                      linear(RecyclerView.HORIZONTAL)
@@ -794,7 +794,6 @@ class ModeEntranceActivity : CommonBindingActivity<ActivityModeEntranceBinding>(
                 if (isBrand036I()) DataFactory.get036IEntranceData()
 //                else if (isBrand011A()) DataFactory.get011A5037EntranceData()
 //                else if (isBrand054A()) DataFactory.get054AEntranceData()
-                else if (sn.startsWith("045")) DataFactory.get045AEntranceData()
                 else if (sn.startsWith("032")) DataFactory.get032DEntranceData()
                 else DataFactory.getEntranceData()
         }

+ 8 - 3
BusinessSetting/src/main/java/com/develop/setting/ui/AboutActivity.kt

@@ -257,6 +257,14 @@ class AboutActivity : CommonBVMActivity<ActivityAboutBinding, AboutViewModel>()
                 }
 
                 binding.ivLogo.setBackgroundResource(com.develop.common.R.drawable.ic_logo_054a)
+            }else if (sn.startsWith("045")) {
+//                ivLogoParam.apply {
+//                    width = dimenRes(com.develop.common.R.dimen.convert_180px)
+//                    height = dimenRes(com.develop.common.R.dimen.convert_180px)
+//                    marginStart = dimenRes(com.develop.common.R.dimen.convert_156px)
+//                }
+
+                binding.ivLogo.setBackgroundResource(com.develop.common.R.drawable.ic_logo_045a)
             }else if (sn.startsWith("011")){
 
                 ivLogoParam.apply {
@@ -286,9 +294,6 @@ class AboutActivity : CommonBVMActivity<ActivityAboutBinding, AboutViewModel>()
                 height = dimenRes(com.develop.common.R.dimen.convert_47px)
             }
 
-             if (sn.startsWith("045")) {
-                binding.ivLogo.setBackgroundResource(com.develop.common.R.drawable.ic_logo_045a)
-            }
         }
         binding.ivLogo.layoutParams = ivLogoParam
         binding.icUpdate.layoutParams = ivUpdateParam

+ 1 - 1
BusinessSetting/src/main/res/layout/item_screen_banner.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/iv_banner"
-    android:scaleType="centerCrop"
+    android:scaleType="fitXY"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 

+ 39 - 46
BusinessStep/src/main/java/com/develop/step/ui/ModesDetailActivity.kt

@@ -359,10 +359,10 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
             CofarSDK.startWeight()
         }
 
-        //2023.12.11 000A客户需要隐藏电磁阀  2024.10.08.电磁阀改成弹窗显示,估在这里隐藏
+        //2023.12.11 000A客户需要隐藏电磁阀  2024.10.08.电磁阀改成弹窗显示,估在这里隐藏数字
         if (sn.startsWith("063") && viewModel.modeType != ModesType.WIGHT.name) {
 //            binding.tvCount.setVisible()
-//            binding.ivPotCover.setVisible()
+            binding.ivPotCover.setVisible()
         } else {
             binding.tvCount.setGone()
             binding.ivPotCover.setGone()
@@ -997,46 +997,43 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
 
             //之前是000 需要做电磁阀,现在单独判断063  2024.10.08.电磁阀改成弹窗显示,估在这里隐藏
             //sn.startsWith("000")
-//            if (sn.startsWith("063")) {
-//                //之前的判断是判断是否称重,和点动,现在把点动去掉
-//                //!CofarSDK.devInfo().isWeightStatus && currDevInfo.mode.mode != "TURBO"
-//                if (!CofarSDK.devInfo().isWeightStatus) {
-//                    //电磁阀在非称重/切碎下显示开锁和上锁
-//                    if (currDevInfo.potCloverEleStatus.toInt() == 0 && potCloverEleStatus != 0) {
-//                        potCloverEleStatus = 0
-//                        potCloverInterval?.cancel()
-//                        if (currentBgId == com.develop.common.R.drawable.pot_clover_ele_unlock) {
-//                            binding.tvCount.setGone()
-//                        } else {
-//                            binding.tvCount.setVisible()
-//                            potCloverInterval = Interval(0, 1, TimeUnit.SECONDS, 5).life(this)
-//                                .subscribe {
-//                                    binding.tvCount.updateText(it.toString())
-//                                }.finish {
-//                                    binding.tvCount.setGone()
-//                                    currentBgId =
-//                                        com.develop.common.R.drawable.pot_clover_ele_unlock
-//                                    binding.ivPotCover.setBackgroundResource(com.develop.common.R.drawable.pot_clover_ele_unlock)
-//                                }
-//                                .start()
-//                        }
-//                    } else if (currDevInfo.potCloverEleStatus.toInt() == 1 && potCloverEleStatus != 1) {
-//                        potCloverEleStatus = 1
-//                        potCloverInterval?.cancel()
-//                        if (currentBgId == com.develop.common.R.drawable.pot_clover_ele_lock) {
-//                            binding.tvCount.setGone()
-//                        } else {
-//                            binding.tvCount.setGone()
-//                            currentBgId = com.develop.common.R.drawable.pot_clover_ele_lock
-//                            binding.ivPotCover.setBackgroundResource(com.develop.common.R.drawable.pot_clover_ele_lock)
-//                        }
-//
-//                    } else if (currDevInfo.potCloverEleStatus.toInt() == 2 && potCloverEleStatus != 2) {
-//                        potCloverEleStatus = 2
-//                        binding.tvCount.setGone()
-//                    }
-//                }
-//            }
+            if (sn.startsWith("063")) {
+                //之前的判断是判断是否称重,和点动,现在把点动去掉
+                //!CofarSDK.devInfo().isWeightStatus && currDevInfo.mode.mode != "TURBO"
+                if (!CofarSDK.devInfo().isWeightStatus) {
+                    //电磁阀在非称重/切碎下显示开锁和上锁
+                    if (currDevInfo.potCloverEleStatus.toInt() == 0 && potCloverEleStatus != 0) {
+                        potCloverEleStatus = 0
+                        potCloverInterval?.cancel()
+                        if (currentBgId == com.develop.common.R.drawable.pot_clover_ele_unlock) {
+                            binding.tvCount.setGone()
+                        } else {
+                            binding.tvCount.setGone()
+                            potCloverInterval = Interval(0, 1, TimeUnit.SECONDS, 5).life(this)
+                                .subscribe {
+                                }.finish {
+                                    currentBgId = com.develop.common.R.drawable.pot_clover_ele_unlock
+                                    binding.ivPotCover.setBackgroundResource(com.develop.common.R.drawable.pot_clover_ele_unlock)
+                                }
+                                .start()
+                        }
+                    } else if (currDevInfo.potCloverEleStatus.toInt() == 1 && potCloverEleStatus != 1) {
+                        potCloverEleStatus = 1
+                        potCloverInterval?.cancel()
+                        if (currentBgId == com.develop.common.R.drawable.pot_clover_ele_lock) {
+                            binding.tvCount.setGone()
+                        } else {
+                            binding.tvCount.setGone()
+                            currentBgId = com.develop.common.R.drawable.pot_clover_ele_lock
+                            binding.ivPotCover.setBackgroundResource(com.develop.common.R.drawable.pot_clover_ele_lock)
+                        }
+
+                    } else if (currDevInfo.potCloverEleStatus.toInt() == 2 && potCloverEleStatus != 2) {
+                        potCloverEleStatus = 2
+                        binding.tvCount.setGone()
+                    }
+                }
+            }
             currDevInfo.mode.apply {
 
 
@@ -2843,10 +2840,6 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         viewModel.stopTurbo()
     }
 
-    private fun init011Mode(obj: Any) {
-
-
-    }
 
     private fun setEggTime(size: Int, hardness: Int) {
         var time: Int = 0

+ 40 - 40
BusinessStep/src/main/java/com/develop/step/ui/cook_step/CookStepActivity.kt

@@ -205,7 +205,7 @@ class CookStepActivity : CookStepBaseActivity() {
         //2023.12.11 000A客户需要隐藏电磁阀  2024.10.08.电磁阀改成弹窗显示,估在这里隐藏
         if (baseSn.startsWith("063")) {
 //            binding.tvCount.setVisible()
-//            binding.ivPotCover.setVisible()
+            binding.ivPotCover.setVisible()
         } else {
             binding.tvCount.setGone()
             binding.ivPotCover.setGone()
@@ -408,9 +408,9 @@ class CookStepActivity : CookStepBaseActivity() {
                     binding.ivCookBg.setGone()
                 }
             } else {
-                //2023.12.11 000A客户需要隐藏电磁阀  2024.10.08.电磁阀改成弹窗显示,估在这里隐藏
+                //2023.12.11 000A客户需要隐藏电磁阀  2024.10.08.电磁阀改成弹窗显示,估在这里隐藏数字
                 if (baseSn.startsWith("063")) {
-//                    binding.ivPotCover.setVisible()
+                    binding.ivPotCover.setVisible()
                 } else {
                     binding.ivPotCover.setGone()
                 }
@@ -1034,44 +1034,44 @@ class CookStepActivity : CookStepBaseActivity() {
             LogUtils.d("========${devInfo.motorGearBuffer}")
             //之前是000 需要做电磁阀,现在单独判断063  2024.10.08.电磁阀改成弹窗显示,估在这里隐藏
             //sn.startsWith("000")
-//            if (baseSn.startsWith("063")) {
-//                if (!CofarSDK.devInfo().isWeightStatus && devInfo.mode.mode != "TURBO") {
-//                    //电磁阀在非称重/切碎下显示开锁和上锁
-//                    if (devInfo.potCloverEleStatus.toInt() == 0 && potCloverEleStatus != 0) {
-//                        potCloverEleStatus = 0
-//                        potCloverInterval?.cancel()
-//                        if (currentBgId == com.develop.common.R.drawable.pot_clover_ele_unlock) {
-//                            binding.tvCount.setGone()
-//                        } else {
-//                            binding.tvCount.setVisible()
-//                            potCloverInterval = Interval(0, 1, TimeUnit.SECONDS, 5).life(this)
-//                                .subscribe {
+            if (baseSn.startsWith("063")) {
+                if (!CofarSDK.devInfo().isWeightStatus && devInfo.mode.mode != "TURBO") {
+                    //电磁阀在非称重/切碎下显示开锁和上锁
+                    if (devInfo.potCloverEleStatus.toInt() == 0 && potCloverEleStatus != 0) {
+                        potCloverEleStatus = 0
+                        potCloverInterval?.cancel()
+                        if (currentBgId == com.develop.common.R.drawable.pot_clover_ele_unlock) {
+                            binding.tvCount.setGone()
+                        } else {
+                            binding.tvCount.setGone()
+                            potCloverInterval = Interval(0, 1, TimeUnit.SECONDS, 5).life(this)
+                                .subscribe {
 //                                    binding.tvCount.updateText(it.toString())
-//                                }.finish {
-//                                    binding.tvCount.setGone()
-//                                    currentBgId =
-//                                        com.develop.common.R.drawable.pot_clover_ele_unlock
-//                                    binding.ivPotCover.setBackgroundResource(com.develop.common.R.drawable.pot_clover_ele_unlock)
-//                                }
-//                                .start()
-//                        }
-//                    } else if (devInfo.potCloverEleStatus.toInt() == 1 && potCloverEleStatus != 1) {
-//                        potCloverEleStatus = 1
-//                        potCloverInterval?.cancel()
-//                        if (currentBgId == com.develop.common.R.drawable.pot_clover_ele_lock) {
-//                            binding.tvCount.setGone()
-//                        } else {
-//                            binding.tvCount.setGone()
-//                            currentBgId = com.develop.common.R.drawable.pot_clover_ele_lock
-//                            binding.ivPotCover.setBackgroundResource(com.develop.common.R.drawable.pot_clover_ele_lock)
-//                        }
-//
-//                    } else if (devInfo.potCloverEleStatus.toInt() == 2 && potCloverEleStatus != 2) {
-//                        potCloverEleStatus = 2
-//                        binding.tvCount.setGone()
-//                    }
-//                }
-//            }
+                                }.finish {
+                                    binding.tvCount.setGone()
+                                    currentBgId =
+                                        com.develop.common.R.drawable.pot_clover_ele_unlock
+                                    binding.ivPotCover.setBackgroundResource(com.develop.common.R.drawable.pot_clover_ele_unlock)
+                                }
+                                .start()
+                        }
+                    } else if (devInfo.potCloverEleStatus.toInt() == 1 && potCloverEleStatus != 1) {
+                        potCloverEleStatus = 1
+                        potCloverInterval?.cancel()
+                        if (currentBgId == com.develop.common.R.drawable.pot_clover_ele_lock) {
+                            binding.tvCount.setGone()
+                        } else {
+                            binding.tvCount.setGone()
+                            currentBgId = com.develop.common.R.drawable.pot_clover_ele_lock
+                            binding.ivPotCover.setBackgroundResource(com.develop.common.R.drawable.pot_clover_ele_lock)
+                        }
+
+                    } else if (devInfo.potCloverEleStatus.toInt() == 2 && potCloverEleStatus != 2) {
+                        potCloverEleStatus = 2
+                        binding.tvCount.setGone()
+                    }
+                }
+            }
 
 //            //由于正常启动时间一到结束,没有调用base
 //            if (baseSn.startsWith("063")&&devInfo.potCloverEleStatus.toInt() == 1&&!isShowSolenoidDilaog) {

+ 22 - 13
app/build.gradle

@@ -20,10 +20,10 @@ ext {
 
     versionCode = Integer.parseInt(new SimpleDateFormat("yyMMddHH").format(new Date()) + 1)
 //    versionCode=230617180
-    brandCode="063B"
-//    brandCode = "054A"
-//    model = "5037"
-    model = "1039"
+//    brandCode="063B"
+    brandCode = "045A"
+    model = "5037"
+//    model = "1039"
 
 }
 
@@ -120,7 +120,7 @@ android {
         brand045ATuya {
             dimension "platform"
             applicationId "com.develop.foodcooking"
-            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            buildConfigField("String", "UpdatePlatform", "\"night\"")
             resValue("string", "app_theme", "@style/SplashThemeNotLogo")
             buildConfigField("String", "model", "\"5037\"")
             buildConfigField("String", "brandCode", "\"045A\"")
@@ -834,6 +834,15 @@ android {
 //            buildConfigField("String", "appCode", "\"1.01\"")
 //            buildConfigField("String", "time","\"${getCurrentTime()}\"" )
 
+            manifestPlaceholders = [channelName: "brand045ATuya"]
+            buildConfigField("String", "UpdatePlatform", "\"night\"")
+            resValue("string", "app_theme", "@style/SplashThemeNotLogo")
+            buildConfigField("String", "model", "\"5037\"")
+            buildConfigField("String", "brandCode", "\"045A\"")
+            //appCode 1.01 指向bug修复,2.01指向功能变更
+            buildConfigField("String", "appCode", "\"1.01\"")
+            buildConfigField("String", "time","\"${getCurrentTime()}\"" )
+
 //            manifestPlaceholders = [channelName: "brand010D"]
 //            buildConfigField("String", "UpdatePlatform", "\"night\"")
 //            resValue("string", "app_theme", "@style/Splash010DTheme")
@@ -853,14 +862,14 @@ android {
 //            buildConfigField("String", "time","\"${getCurrentTime()}\"" )
 ////
 
-            manifestPlaceholders = [channelName: "brand063BTuya"]
-            buildConfigField("String", "UpdatePlatform", "\"normal\"")
-            resValue("string", "app_theme", "@style/SplashThemeNotLogo")
-            buildConfigField("String", "model", "\"1039\"")
-            buildConfigField("String", "brandCode", "\"063B\"")
-            //appCode 1.01 指向bug修复,2.01指向功能变更
-            buildConfigField("String", "appCode", "\"1.01\"")
-            buildConfigField("String", "time","\"${getCurrentTime()}\"" )
+//            manifestPlaceholders = [channelName: "brand063BTuya"]
+//            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+//            resValue("string", "app_theme", "@style/SplashThemeNotLogo")
+//            buildConfigField("String", "model", "\"1039\"")
+//            buildConfigField("String", "brandCode", "\"063B\"")
+//            //appCode 1.01 指向bug修复,2.01指向功能变更
+//            buildConfigField("String", "appCode", "\"1.01\"")
+//            buildConfigField("String", "time","\"${getCurrentTime()}\"" )
 //
 //            manifestPlaceholders = [channelName: "brand053A"]
 //            buildConfigField("String", "UpdatePlatform", "\"night\"")

+ 2 - 1
libBase/src/main/java/com/develop/base/ext/GlobaExt.kt

@@ -213,6 +213,7 @@ fun getSN(): String {
     if (BuildConfig.DEBUG) {
 //        return "002D10390020123010190001"
 //        return "045A21030020123010190001"
+        return "045A50370020123010190001"
 //        return "000A30150020123010190001"
 //     return "000A10390020123010170001"
 //     return "000A10390020123010190001"
@@ -252,7 +253,7 @@ fun getSN(): String {
 //        return  "063A10390020123010190015"
 //        return  "063B10390020123010190001"
 //        return  "063B20030020123010190015"
-        return "063B21050020123010190001"
+//        return "063B21050020123010190001"
 //        return  "049B10390020123010190001"
 //        return "000A50370020123010190017"
 //        return  "053A10390020123010190088"