Browse Source

处理011翻译,喝点击切换模式问题

zhangshenjie 1 month ago
parent
commit
e36c041afe

+ 6 - 2
BusinessAirFryer/src/main/java/com/develop/airfryer/ui/DevModeView.kt

@@ -13,6 +13,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
 import com.blankj.utilcode.util.ActivityUtils.startActivity
 import com.blankj.utilcode.util.AppUtils
 import com.develop.airfryer.databinding.DevModeViewBinding
+import com.develop.base.util.DevModesEvent
 import com.develop.base.util.ThreadUtils
 import com.kuyuntech.cofarcooking.device.sdk.constant.core.CommonEventTypes
 import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevModes
@@ -21,6 +22,7 @@ import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevCommonEvent
 import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevPromptEvent
 import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevStatusEvent
 import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
+import org.greenrobot.eventbus.EventBus
 import org.greenrobot.eventbus.Subscribe
 
 class DevModeView(context: Context, attrs: AttributeSet) : ConstraintLayout(context, attrs) {
@@ -33,7 +35,7 @@ class DevModeView(context: Context, attrs: AttributeSet) : ConstraintLayout(cont
 
     init {
         binding = DevModeViewBinding.inflate(LayoutInflater.from(context), this, true)
-//        setupClickListener()
+        setupClickListener()
         CofarSDK.register(this)
         animation()
         updateUI()
@@ -130,7 +132,9 @@ class DevModeView(context: Context, attrs: AttributeSet) : ConstraintLayout(cont
 
 
         setOnClickListener {
-            CofarSDK.changeDevMode(if (mode == DevModes.SOUP) DevModes.AIR_FRYER else DevModes.SOUP)
+//            CofarSDK.changeDevMode(if (mode == DevModes.SOUP) DevModes.AIR_FRYER else DevModes.SOUP)
+
+            EventBus.getDefault().post(DevModesEvent())
 
         }
 

+ 4 - 0
BusinessCommon/src/main/res/values-en/strings.xml

@@ -182,6 +182,10 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="dev_remove_orange_parts">The machine is in twisted orange mode, please remove the current accessory.</string>
     <string name="dev_dice_and_peel_tips">In order to use the program, it is necessary to have and install the appropriate attachment.</string>
 
+    <string name="dev_soup_parts">please install cooking bowl to start.</string>
+    <string name="dev_air_parts">please install air fryer attachment to start.</string>
+
+
     <string name="hight_temp_warning_tips">The current temperature exceeds 60, and the motor speed exceeds the third gear. Are you sure to continue?</string>
     <string name="hight_temp_turbo_tips">The current temperature exceeds 60, turbo function cannot be operated</string>
     <string name="update_msg">System updating, please wait~</string>

+ 3 - 0
BusinessCommon/src/main/res/values-pl/strings.xml

@@ -240,6 +240,9 @@
     <string name="ntc_yi_chan"> Uwaga: NTC nie działa prawidłowo, skontaktuj się z serwisem technicznym.</string>
     <string name="mei_fang_guo_yi_chan">Uwaga\n· Miska mieszająca nie jest zablokowana, zmień położenie miski</string>
 
+    <string name="dev_soup_parts">Włóż dzbanek termorobota i uruchom ponownie.</string>
+    <string name="dev_air_parts">Włóż przystawkę do frytownicy beztłuszczowej i uruchom ponownie.</string>
+
     <string name="empty_notice">Brak treści uwagi</string>
     <string name="press_the_button">Naciśnij przycisk</string>
     <string name="please_fill_in">Należy wypełnić</string>

+ 2 - 0
BusinessCommon/src/main/res/values/strings.xml

@@ -168,6 +168,8 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="dev_not_orange_parts">Please install the Twisted Orange accessory to start the Twisted Orange program.</string>
     <string name="dev_remove_orange_parts">The machine is in twisted orange mode, please remove the current accessory.</string>
     <string name="dev_dice_and_peel_tips">In order to use the program, it is necessary to have and install the appropriate attachment.</string>
+    <string name="dev_soup_parts">please install cooking bowl to start.</string>
+    <string name="dev_air_parts">please install air fryer attachment to start.</string>
 
     <string name="hight_temp_warning_tips">The current temperature exceeds 60, and the motor speed exceeds the third gear. Are you sure to continue?</string>
     <string name="hight_temp_turbo_tips">The current temperature exceeds 60, turbo function cannot be operated</string>

+ 43 - 0
BusinessMain/src/main/java/com/develop/main/ui/HomeActivity.kt

@@ -21,11 +21,13 @@ import com.develop.base.ext.resId2Dimension
 import com.develop.base.ext.setGone
 import com.develop.base.ext.src
 import com.develop.base.manager.WifiHelp
+import com.develop.base.util.DevModesEvent
 import com.develop.base.widgets.CommonPopupWindow
 import com.develop.common.data_repo.FoodDataProvider
 import com.develop.common.data_repo.db.NewsModel
 import com.develop.common.data_repo.db.RecipesType
 import com.develop.common.data_repo.db.entity.UserInfo
+import com.develop.common.dialog.CancelConfirmDialog
 import com.develop.common.router.Screens
 import com.develop.common.tag.*
 import com.develop.common.ui.CommonBVMActivity
@@ -35,6 +37,7 @@ import com.develop.common.widget.NewsLayout
 import com.develop.main.R
 import com.develop.main.databinding.ActivityHomeBinding
 import com.develop.main.viewmodel.HomeViewModel
+import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevModes
 import com.kuyuntech.cofarcooking.device.sdk.constant.core.WorkModes
 import com.kuyuntech.cofarcooking.device.sdk.eventbus.event.DevStatusEvent
 import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
@@ -449,6 +452,46 @@ class HomeActivity : CommonBVMActivity<ActivityHomeBinding, HomeViewModel>() {
 
     class HomeBackClickEvent(showOnline: Boolean)
 
+    //5037 点击切换模式eb传递
+    @Subscribe
+    fun onDevModes(event: DevModesEvent) {
+        if (CofarSDK.devInfo().devMode == DevModes.SOUP){
+            showDevModeDialog(getString(com.develop.common.R.string.dev_air_parts))
+
+        }else if (CofarSDK.devInfo().devMode == DevModes.AIR_FRYER){
+            showDevModeDialog(getString(com.develop.common.R.string.dev_soup_parts))
+        }
+
+    }
+    fun showDevModeDialog(title :String){
+        var  cancelConfirmDialog = CancelConfirmDialog()
+        cancelConfirmDialog.showCancel = false
+        cancelConfirmDialog.showConfirm = true
+        cancelConfirmDialog.confirmStr = resources.getString(
+            resources.getIdentifier(
+                "ok", "string", this.packageName
+            )
+        )
+        cancelConfirmDialog.title = title
+        cancelConfirmDialog.showDialog(supportFragmentManager, "confirmCancelDialog")
+        cancelConfirmDialog.onDialogClickListener =
+            object : CancelConfirmDialog.OnDialogClickListener {
+                override fun onConfirm() {
+                    cancelConfirmDialog.removeSelf();
+                }
+
+                override fun onCancel() {
+                    cancelConfirmDialog.removeSelf();
+                }
+
+                override fun onKey() {
+                }
+            }
+
+
+
+    }
+
     override fun onDestroy() {
         super.onDestroy()
         wifiHelp.destroy()

+ 5 - 0
app/src/brand011ETuya/res/values-en/strings.xml

@@ -181,6 +181,11 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="dev_remove_orange_parts">The machine is in twisted orange mode, please remove the current accessory.</string>
     <string name="dev_dice_and_peel_tips">In order to use the program, it is necessary to have and install the appropriate attachment.</string>
 
+    <string name="dev_soup_parts">please install cooking bowl to start.</string>
+    <string name="dev_air_parts">please install air fryer attachment to start.</string>
+
+
+
     <string name="hight_temp_warning_tips">The current temperature exceeds 60, and the motor speed exceeds the third gear. Are you sure to continue?</string>
     <string name="hight_temp_turbo_tips">The current temperature exceeds 60, turbo function cannot be operated</string>
     <string name="update_msg">System updating, please wait~</string>

+ 8 - 4
app/src/brand011ETuya/res/values-pl/strings.xml

@@ -56,7 +56,7 @@
 
     <string name="language">Język</string>
     <string name="sound">DŹWIĘK</string>
-    <string name="brightness">Jasność</string>
+    <string name="brightness">Czas blokady ekranu</string>
     <string name="user_account">KONTO UŻYTKOWNIKA</string>
     <string name="storage">PRZECHOWYWANIE</string>
     <string name="reset">Przywróć ustawienia fabryczne</string>
@@ -74,7 +74,7 @@
 
     <string name="newest">Najnowsze</string>
     <string name="the_most_commonly_searched">Najczęściej wyszukiwane</string>
-    <string name="notice">Powiadomienie</string>
+    <string name="notice">Powiadomienia</string>
     <string name="all">Wszystkie przepisy</string>
     <string name="Recipes">Przepisy</string>
     <string name="ingredients">Składniki</string>
@@ -245,6 +245,10 @@
     <string name="engjoy_your_meal">SMACZNEGO!</string>
     <string name="gan_sao_yi_chan">Uwaga\n· Wysoka temperatura\n· Brak zawartości w misce podczas podgrzewania\n· Dodawanie składników, płynów</string>
 
+    <string name="dev_soup_parts">Włóż dzbanek termorobota i uruchom ponownie.</string>
+    <string name="dev_air_parts">Włóż przystawkę do frytownicy beztłuszczowej i uruchom ponownie.</string>
+
+
     <string name="zhuan_su_fan_kui_yi_chan">Ostrzeżenie\n· Pokrywa miski nie jest całkowicie zatrzaśnięta\n· Przeciążenie silnika, poczekaj, aż urządzenie ostygnie, Uruchom ponownie z mniejszą ilością zawartości miski.</string>
     <string name="dian_zi_cheng_tong_xin_yi_chan">Uwaga\n· Waga nie została zmierzona, błąd wagi\n· Waga uszkodzona </string>
     <string name="ntc_yi_chan"> Uwaga: NTC nie działa prawidłowo, skontaktuj się z serwisem technicznym.</string>
@@ -385,11 +389,11 @@
 
 
     <string name="language_011">Język</string>
-    <string name="brightness_011">Jasność</string>
+    <string name="brightness_011">Czas blokady ekranu</string>
     <string name="reset_011">Przywróć ustawienia fabryczne</string>
     <string name="mei_fang_guo_yi_chan_011">Nie wykryto dzbanka termorobota</string>
     <string name="lid_unlock_011">Pokrywa misy została nieprawidłowo zamknięta</string>
-    <string name="notice_011">Powiadomienie</string>
+    <string name="notice_011">Powiadomienia</string>
     <string name="empty_notice_011">Brak powiadomień</string>
     <string name="press_the_button_011">Wciśnij oraz przytrzymaj przycisk</string>
     <string name="direction_011">Obroty</string>

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

@@ -225,7 +225,7 @@ fun getSN(): String {
 //        return "000A50370020123010190004"
 //        return "011A50370020123010190003"
 //        return "011A50370020123010190006"
-//        return "011E50370020123010190001"
+        return "011E50370020123010190001"
 //    return "007D20020020123010190001"
 //        return "036I21060020123010190007"
 //        return "030A10390020123010190004"
@@ -249,7 +249,7 @@ fun getSN(): String {
 //        return  "062A20030020123010190003"
 //        return "062A20030020123010190004"
 //        return  "063A10390020123010190015"
-        return  "063B10390020123010190001"
+//        return  "063B10390020123010190001"
 //        return  "063B20030020123010190015"
 //        return "063B21050020123010190001"
 //        return  "049B10390020123010190001"

+ 4 - 0
libBase/src/main/java/com/develop/base/util/DevModesEvent.java

@@ -0,0 +1,4 @@
+package com.develop.base.util;
+
+public class DevModesEvent {
+}