Quellcode durchsuchen

017多语言处理

wbspool vor 11 Monaten
Ursprung
Commit
88819db838

+ 10 - 7
BusinessAuth/src/main/java/com/develop/auth/ui/MemberLaunchFragment.kt

@@ -29,13 +29,16 @@ class MemberLaunchFragment: CommonBVMFragment<FragmentMemberLaunchBinding, Membe
         val memberText = getString(com.develop.common.R.string.member)
         val description = getString(com.develop.common.R.string.not_a_member_yet, memberText)
         val memberIndex = description.indexOf(memberText)
-        val spannable = SpannableString(description)
-        spannable.setSpan(
-            ForegroundColorSpan(Color.RED),
-            memberIndex,
-            memberIndex + memberText.length,
-            Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
-        )
+        val spannable = description
+        if(memberIndex != -1){
+            val spannable = SpannableString(description)
+            spannable.setSpan(
+                ForegroundColorSpan(Color.RED),
+                memberIndex,
+                memberIndex + memberText.length,
+                Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
+            )
+        }
         binding.tvTitle.text = spannable
         binding.tvLoginOrSignup.setOnClickListener {
             viewModel.fragmentChangeLiveData.postValue(FragmentTag.MEMBER_LOGIN)

+ 11 - 1
BusinessCommon/src/main/java/com/develop/common/utils/TuyaDps.java

@@ -11,6 +11,7 @@ public class TuyaDps {
     public static final int TARGET_PRESSURE_COOKER = 107;
     public static final int WIND_SPEED = 108;
     public static final int DEV_MODE = 109;
+    public static final int DEV_READY = 110;
     public static final int POT_CLOVER_STATUS = 111;
     public static final int REMAIN_TIME_O = 112;
     public static final int ERROR_CODE = 113;
@@ -19,5 +20,14 @@ public class TuyaDps {
     public static final int TARGET_TEMP = 116;
     public static final int CURRENT_TEMP = 117;
     public static final int TARGET_TIME = 118;
-    public static final int DEV_READY = 110;
+    public static final int MAX_TIME = 119;
+    public static final int MIN_TIME = 120;
+    public static final int MAX_TEMP = 121;
+    public static final int MIN_TEMP = 122;
+    public static final int MAX_MOTOR_GEAR = 123;
+    public static final int MIN_MOTOR_GEAR = 124;
+    public static final int MAX_SPRAY_WATER = 125;
+    public static final int MIN_SPRAY_WATER = 126;
+
+
 }

+ 14 - 1
BusinessCommon/src/main/java/com/develop/common/utils/TuyaUtils.java

@@ -19,6 +19,7 @@ import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevModes;
 import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevStatus;
 import com.kuyuntech.cofarcooking.device.sdk.constant.core.HeatModes;
 import com.kuyuntech.cofarcooking.device.sdk.constant.core.MotorDirections;
+import com.kuyuntech.cofarcooking.device.sdk.devmode.core.BaseDevMode;
 import com.kuyuntech.cofarcooking.device.sdk.eventbus.core.DevInfo;
 import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK;
 import com.tuya.smartai.iot_sdk.DPEvent;
@@ -78,6 +79,8 @@ public class TuyaUtils {
 
         DevInfo info = CofarSDK.devInfo();
 
+        BaseDevMode mode = info.getMode();
+
         DPEvent[] dpEvents = new DPEvent[]{
           new DPEvent(TuyaDps.DEV_MODE,(byte) DPEvent.Type.PROP_VALUE,devMode,0),
           new DPEvent(TuyaDps.CURRENT_PRESSURE_COOKER,(byte) DPEvent.Type.PROP_VALUE,-1,0),
@@ -90,12 +93,22 @@ public class TuyaUtils {
           new DPEvent(TuyaDps.MOTOR_GEAR,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getMotorGearBuffer() != -1 ? info.getMotorGearBuffer() : info.getMotorGear()),0),
           new DPEvent(TuyaDps.MOTOR_DIRECTION,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getMotorDirectionBuffer() != -1 ? info.getMotorDirectionBuffer():info.getMotorDirection()),0),
           new DPEvent(TuyaDps.SPRAY_WATER,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getWaterGearBuffer() != -1 ? info.getWaterGearBuffer() : info.getWaterGear()),0),
-          new DPEvent(TuyaDps.WIND_SPEED,(byte) DPEvent.Type.PROP_VALUE,-1,-1),
+          new DPEvent(TuyaDps.WIND_SPEED,(byte) DPEvent.Type.PROP_VALUE,1,0),
           new DPEvent(TuyaDps.TARGET_TEMP,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getTargetTempBuffer() != -1 ? info.getTargetTempBuffer():info.getTargetTemp()),0),
           new DPEvent(TuyaDps.CURRENT_TEMP,(byte) DPEvent.Type.PROP_VALUE,(int)info.getTemp(),0),
           new DPEvent(TuyaDps.POT_CLOVER_STATUS,(byte) DPEvent.Type.PROP_VALUE,(int)info.getPotCloverStatus(),0),
           new DPEvent(TuyaDps.POT_STATUS,(byte) DPEvent.Type.PROP_VALUE,(int)info.getPotStatus(),0),
           new DPEvent(TuyaDps.DEV_READY,(byte) DPEvent.Type.PROP_VALUE,CommonUtils.INSTANCE.devReady() ? 0 : 1,0),
+          new DPEvent(TuyaDps.MAX_TIME,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMaxTime(),0),
+          new DPEvent(TuyaDps.MIN_TIME,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMinTime(),0),
+          new DPEvent(TuyaDps.MAX_TEMP,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMaxTemp(),0),
+          new DPEvent(TuyaDps.MIN_TEMP,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMinTemp(),0),
+          new DPEvent(TuyaDps.MAX_MOTOR_GEAR,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMaxMotorGear(),0),
+          new DPEvent(TuyaDps.MIN_MOTOR_GEAR,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMinMotorGear(),0),
+          new DPEvent(TuyaDps.MAX_SPRAY_WATER,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMaxWaterGear(),0),
+          new DPEvent(TuyaDps.MIN_MOTOR_GEAR,(byte) DPEvent.Type.PROP_VALUE,mode == null ? 0 : mode.getMinMotorGear(),0),
+
+
         };
 
 

+ 1 - 1
app/build.gradle

@@ -13,7 +13,7 @@ ext{
     versionCode=Integer.parseInt(new SimpleDateFormat("yyMMddHH").format(new Date()) + 1)
 //    versionCode=230617180
     brandCode="000A"
-    model="1039"
+    model="5037"
 
 }
 

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

@@ -191,7 +191,7 @@ fun getSN(): String {
 
 
 
-    return "000A10390020123010190010"
+//    return "000A10390020123010190009"
 
     //通过反射获取sn号
     try {