Bläddra i källkod

翻译功能处理

zhangshenjie 1 vecka sedan
förälder
incheckning
fb683f3339

+ 7 - 7
BusinessAirFryer/src/main/assets/lang_config_000.json

@@ -7,13 +7,6 @@
       "showName": "Polski",
       "show": false
     },
-    {
-      "name": "German(德语)",
-      "value": "DE",
-      "icon": "icon_lang_de",
-      "showName": "Deutsch",
-      "show": true
-    },
     {
       "name": "French(法语)",
       "value": "FR",
@@ -56,6 +49,13 @@
       "showName": "English",
       "show": true
     },
+    {
+      "name": "German(德语)",
+      "value": "DE",
+      "icon": "icon_lang_de",
+      "showName": "Deutsch",
+      "show": true
+    },
     {
       "name": "Greek(希腊语)",
       "value": "GR",

+ 1 - 1
BusinessAirFryer/src/main/assets/lang_config_077.json

@@ -54,7 +54,7 @@
       "value": "EN",
       "icon": "icon_lang_en",
       "showName": "English",
-      "show": false
+      "show": true
     },
     {
       "name": "Greek(希腊语)",

+ 29 - 0
BusinessCommon/src/main/java/com/develop/common/bean/TranslateBean.java

@@ -0,0 +1,29 @@
+package com.develop.common.bean;
+
+public class TranslateBean {
+    private  String id;
+    private String value;
+
+    public TranslateBean(String id, String value) {
+        this.id = id;
+        this.value = value;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+
+}

+ 5 - 0
BusinessCommon/src/main/java/com/develop/common/data_repo/db/DataFactory.kt

@@ -32,6 +32,11 @@ val dataSn = getSN()
             ?: Collections.emptyList();
     }
 
+    fun selectLanguageDataV2(resource: Resources): List<ConfigUtils.Lang> {
+        return ConfigUtils.selectLangConfig()?.langs ?: Collections.emptyList();
+    }
+
+
     fun createLanguageData(resource: Resources): MutableList<LanguageModel> {
         val languageList = mutableListOf<LanguageModel>()
         val strList = if (isNightTheme() || isBrand036I()) {

+ 5 - 5
BusinessCommon/src/main/java/com/develop/common/data_repo/db/entity/DevRecipe.kt

@@ -101,7 +101,7 @@ data class DevRecipe(
      * @see com.kuyuntech.cofarcooking.coreapi.constant.core.DifficultyLevel
      */
     @ColumnInfo(name = "difficulty_level")
-    val difficultyLevel: String?,
+    var difficultyLevel: String?,
 
     /**
      * 兼容母包版本
@@ -113,13 +113,13 @@ data class DevRecipe(
      * 名称
      */
     @ColumnInfo
-    val name: String?,
+    var name: String?,
 
     /**
      * 介绍
      */
     @ColumnInfo
-    val introduction: String?,
+    var introduction: String?,
 
 
 
@@ -148,12 +148,12 @@ data class DevRecipe(
      * 食谱描述
      * */
     @ColumnInfo(name = "food_description")
-    val  foodDescription :String?,
+    var  foodDescription :String?,
 
 
     /**
      * 厨师建议
      * */
     @ColumnInfo(name = "chef_rec")
-    val  chefRec :String?
+    var  chefRec :String?
 )

+ 1 - 1
BusinessCommon/src/main/java/com/develop/common/data_repo/db/entity/DevRecipeFood.kt

@@ -54,7 +54,7 @@ data class DevRecipeFood(
      * 食材名称
      */
     @ColumnInfo(name = "food_name")
-    val foodName: String?,
+    var foodName: String?,
 
     /**
      * 关联食谱份量

+ 3 - 0
BusinessCommon/src/main/java/com/develop/common/data_repo/net/Api.kt

@@ -7,6 +7,7 @@ object Api {
    // const val HOST = "http://nat.kuyuntech.com:19973/dev/"
     const val HOST = "https://cfdev.cofarcn.com/dev/"
 
+
     const val REGISTER = "register"
     const val LOGIN = "login"
     const val PERFECT_INFO = "perfetInfo"
@@ -22,5 +23,7 @@ object Api {
     const val GET_HOT_TAGS = "hotTags"
     const val CANCEL_ACCOUNT = "cancelAccount"
 
+    //翻译地址
+    const val  TRANSLATE = "https://icook.cofarcn.com/api/youdao/translate"
 
 }

+ 79 - 0
BusinessCommon/src/main/java/com/develop/common/dialog/LanguageSelectDialog.kt

@@ -0,0 +1,79 @@
+package com.develop.common.dialog
+
+import android.graphics.Color
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.appcompat.app.AppCompatActivity
+import com.develop.base.ext.dimenRes
+import com.develop.base.ext.globalRes
+import com.develop.base.ext.isBrand062
+import com.develop.base.mvvm.FullScreenTransparentDialog
+import com.develop.common.R
+import com.develop.common.data_repo.db.DataFactory
+import com.develop.common.databinding.DialogDataPickerBinding
+import com.develop.common.databinding.DialogLanguagePickerBinding
+
+class LanguageSelectDialog(
+    private val activity: AppCompatActivity,
+    private val onConfirm: (index: Int, values:String,change: Boolean) -> Unit
+): FullScreenTransparentDialog() {
+
+    private val binding = DialogLanguagePickerBinding.inflate(activity.layoutInflater)
+    private val initIndex = 0
+    private val listlang = DataFactory.selectLanguageDataV2(globalRes())
+    private var is062 = false
+
+    override fun onCreateView(
+        inflater: LayoutInflater,
+        container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View {
+        return binding.root
+    }
+    init {
+        is062 = isBrand062()
+        val listData = createAgeListData()
+        binding.root.setOnClickListener {
+            dismiss()
+        }
+        binding.tvYes.setOnClickListener {
+            dismiss()
+            val currentIndex = binding.wheelPicker.currentItemPosition
+            var values :String = listlang[currentIndex].value.lowercase()
+            onConfirm(currentIndex, values,true)
+        }
+        binding.tvCancel.setOnClickListener {
+            dismiss()
+        }
+
+        binding.wheelPicker.selectedItemTextColor = if (is062) activity.resources.getColor(R.color.color_5887DA) else Color.BLACK
+        binding.wheelPicker.itemTextColor = 0xff000000.toInt()
+        binding.wheelPicker.itemTextSize = dimenRes(com.develop.common.R.dimen.convert_28px)
+        binding.wheelPicker.setAtmospheric(true)
+        binding.wheelPicker.isCurved = true
+        binding.wheelPicker.data = listData
+        if (initIndex >= 0 && initIndex <= listData.size - 1) {
+            binding.wheelPicker.setSelectedItemPosition(initIndex, false)
+        }
+    }
+
+    private fun createAgeListData(): List<String> {
+
+        val list = mutableListOf<String>()
+//        list.add(0,"0")
+//        for (index in 20..80) {
+//            list.add(index.toString())
+//        }
+        var size = listlang.size-1
+        for(i in 0..size){
+            var language = listlang[i]
+            list.add(i,language.name+" "+"("+language.value+")")
+        }
+
+
+
+        return list
+    }
+}

+ 29 - 5
BusinessCommon/src/main/java/com/develop/common/utils/ConfigUtils.kt

@@ -36,10 +36,10 @@ object ConfigUtils {
             val fileList = GlobalApp().assets.list("") ?: arrayOf()
             var inputStream: InputStream? = null
 
-            if (sn.startsWith("000B")){
+            if (sn.startsWith("000B")) {
                 //由于000B 是要黑色风格,因为皮肤包问题,估在这添加多000B配置
                 inputStream = GlobalApp().assets.open("config_000B.json")
-            }else{
+            } else {
                 if (fileList.contains("config_${brandNum}.json")) {
                     inputStream = GlobalApp().assets.open("config_${brandNum}.json")
                 } else {
@@ -57,12 +57,14 @@ object ConfigUtils {
             val jsonString = String(buffer, Charset.defaultCharset())
             val gson = Gson()
             var cfConfig = gson.fromJson(jsonString, CfConfig::class.java)
-            if (sn.startsWith("033I")||sn.startsWith("033K")){
+            if (sn.startsWith("033I") || sn.startsWith("033K")) {
                 /**
                  * 由于config_033的json配置没有扭橙,但是033I的客户需要添加一个,估在这做判断
                  * */
-                var workMode = WorkMode("citrus_juicer","CITRUS_JUICER",
-                    "ic_grid_citrus_juicer","ic_mode_citrus_juicer","SOUP",true);
+                var workMode = WorkMode(
+                    "citrus_juicer", "CITRUS_JUICER",
+                    "ic_grid_citrus_juicer", "ic_mode_citrus_juicer", "SOUP", true
+                );
                 cfConfig.workModes.add(workMode)
             }
             return cfConfig
@@ -133,6 +135,28 @@ object ConfigUtils {
         }
     }
 
+    fun selectLangConfig(): LangConfig? {
+        return try {
+
+
+            var inputStream: InputStream? = null
+            inputStream = GlobalApp().assets.open("lang_config.json")
+            val size = inputStream.available()
+            val buffer = ByteArray(size)
+            inputStream.read(buffer)
+            inputStream.close()
+
+            val jsonString = String(buffer, Charset.defaultCharset())
+            val gson = Gson()
+            val cfConfig = gson.fromJson(jsonString, LangConfig::class.java)
+            return cfConfig
+        } catch (ex: IOException) {
+            ex.printStackTrace()
+            null
+        }
+    }
+
+
     fun loadTuyaConfig(): Map<String, String>? {
         return try {
             var sn = getSN()

+ 60 - 0
BusinessCommon/src/main/res/layout/dialog_language_picker.xml

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <RelativeLayout
+        android:id="@+id/fl_content"
+        android:layout_width="@dimen/convert_460px"
+        android:layout_height="@dimen/convert_390px"
+        android:background="@drawable/bg_white_button_round10px"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent">
+
+        <com.aigestudio.wheelpicker.WheelPicker
+            android:id="@+id/wheel_picker"
+            android:layout_width="@dimen/convert_460px"
+            android:layout_height="@dimen/convert_300px"
+
+            />
+
+        <TextView
+            android:layout_marginTop="@dimen/convert_10px"
+            android:id="@+id/tv_yes"
+            android:layout_width="wrap_content"
+            android:layout_height="@dimen/convert_60px"
+            android:layout_below="@id/wheel_picker"
+            android:background="@drawable/bg_ee8f08_button"
+            android:gravity="center"
+            android:paddingLeft="@dimen/convert_32px"
+            android:paddingRight="@dimen/convert_32px"
+            android:text="@string/yes"
+            android:textColor="#fff"
+            android:layout_marginLeft="@dimen/convert_40px"
+            android:textSize="@dimen/convert_30px"
+
+            />
+
+        <TextView
+            android:id="@+id/tv_cancel"
+            android:layout_width="@dimen/convert_140px"
+            android:layout_height="@dimen/convert_60px"
+            android:layout_below="@id/wheel_picker"
+            android:layout_alignParentEnd="true"
+            android:background="@drawable/bg_ee8f08_stoke"
+            android:elevation="@dimen/convert_15px"
+            android:gravity="center"
+            android:text="@string/no"
+            android:layout_marginTop="@dimen/convert_10px"
+            android:layout_marginRight="@dimen/convert_40px"
+            android:textColor="@color/no_color"
+            android:textSize="@dimen/convert_30px"
+            />
+
+    </RelativeLayout>
+
+
+</androidx.constraintlayout.widget.ConstraintLayout>

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

@@ -251,6 +251,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="score">Score</string>
     <string name="share">Share</string>
     <string name="delete">Delete</string>
+    <string name="translation">Translation</string>
     <string name="recipe_update_tips">A total of {{num}} recipes have been found. Do you want to download them?</string>
     <string name="no_recipe_update_tips">No new recipe data package \n Currently the latest version</string>
     <string name="recipe_update_process_tips">({{progress}})Recipe data downloading…</string>

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

@@ -246,6 +246,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="score">Score</string>
     <string name="share">Share</string>
     <string name="delete">Delete</string>
+    <string name="translation">Translation</string>
     <string name="recipe_update_tips">A total of {{num}} recipes have been found. Do you want to download them?</string>
     <string name="no_recipe_update_tips">No new recipe data package \n Currently the latest version</string>
     <string name="recipe_update_process_tips">({{progress}})Recipe data downloading…</string>

+ 35 - 11
BusinessStep/src/main/java/com/develop/step/ui/recipes_detail/CookDetailActivity.kt

@@ -20,6 +20,7 @@ import com.develop.base.util.MMkvUtils
 import com.develop.base.util.ThreadUtils
 import com.develop.common.data_repo.FoodDataProvider
 import com.develop.common.data_repo.db.entity.UserFavoriteRecipes
+import com.develop.common.dialog.AgeSelectDialog
 import com.develop.common.dialog.AmountSelectDialog
 import com.develop.common.dialog.CancelConfirmDialog
 import com.develop.common.dialog.RecipeDeleteConfirmDialog
@@ -28,6 +29,7 @@ import com.develop.common.tag.CURRENT_USER_ID
 import com.develop.common.ui.CommonBVMActivity
 import com.develop.common.utils.Resource
 import com.develop.common.dialog.DownloadFailedDialog
+import com.develop.common.dialog.LanguageSelectDialog
 import com.develop.common.dialog.PlainDialogView
 import com.develop.common.dialog.ShareQRCodeDialog
 import com.develop.common.event.RefreshDataEvent
@@ -102,6 +104,7 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
     private var isLoadingDialog = false //判断是否显示了loading,主要用在在线食谱
 
     private var isOnResume = true //避免在线食谱重复请求
+    private var isTranslate = false
     override fun createViewModel(): CookDetailViewModel {
         return getViewModel(CookDetailViewModel::class.java)
     }
@@ -124,6 +127,7 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
 
     private fun initData() {
         viewModel.getRecipeLiveData().observe(this) {
+            dismissloadingDialog()
             cookDetailJson = Json.encodeToString(it)
             updateCookDetail(it)
             if (cookSource == "remote" && isLoadingDialog) {
@@ -468,6 +472,20 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
         binding.clFuncMore.setOnClickListener {
             binding.clFuncMore.setGone()
         }
+
+        binding.tvMoreTranslate.setOnClickListener {
+            binding.clFuncMore.setGone()
+            LanguageSelectDialog(this) { index, values,change ->
+                isTranslate = true
+                showloadingDialog()
+                viewModel.getTranslateDetail(viewModel.setTranslateDate(values),values)
+            }.showDialog(supportFragmentManager, "LanguageSelectDialog")
+
+
+
+
+        }
+
     }
 
     private fun startCookStep() {
@@ -662,19 +680,25 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
         binding.tvFoodTime.text = timeDescBuilder.toString()
         if (binding.tvEasy.visibility == View.VISIBLE) {
             detail.recipe.difficultyLevel?.let {
-                var difficultyLevel = if (it.isEmpty()) {
-                    "easy"
-                } else {
-                    it
-                }
+                //翻译回来,不能用本地String的xml了
+                if (isTranslate){
+                    binding.tvEasy.text = it
+                }else{
+                    var difficultyLevel = if (it.isEmpty()) {
+                        "easy"
+                    } else {
+                        it
+                    }
 
-                binding.tvEasy.text = resources.getString(
-                    resources.getIdentifier(
-                        difficultyLevel,
-                        "string",
-                        this.packageName
+                    binding.tvEasy.text = resources.getString(
+                        resources.getIdentifier(
+                            difficultyLevel,
+                            "string",
+                            this.packageName
+                        )
                     )
-                )
+                }
+
             }
         }
 

+ 103 - 6
BusinessStep/src/main/java/com/develop/step/viewmodel/CookDetailViewModel.kt

@@ -1,5 +1,6 @@
 package com.develop.step.viewmodel
 
+import android.util.Log
 import androidx.lifecycle.LiveData
 import androidx.lifecycle.MutableLiveData
 import androidx.lifecycle.scopeNetLife
@@ -9,10 +10,12 @@ import com.blankj.utilcode.util.ToastUtils
 import com.blankj.utilcode.util.ZipUtils
 import com.develop.base.ext.fromJson
 import com.develop.base.ext.globalApp
+import com.develop.base.ext.toJson
 import com.develop.base.mvvm.BaseViewModel
 import com.develop.base.util.FileKit
 import com.develop.base.util.MMkvUtils
 import com.develop.base.util.ThreadUtils
+import com.develop.common.bean.TranslateBean
 import com.develop.common.data_repo.FoodDataProvider
 import com.develop.common.data_repo.db.entity.DevAccessory
 import com.develop.common.data_repo.db.entity.DevRecipeCategory
@@ -27,10 +30,13 @@ import com.develop.common.tag.CURRENT_USER_ID
 import com.develop.common.utils.Resource
 import com.develop.step.ui.recipes_detail.model.CookDetailInfo
 import com.drake.net.Get
+import com.drake.net.Post
 import com.drake.net.component.Progress
 import com.drake.net.interfaces.ProgressListener
 import kotlinx.serialization.decodeFromString
 import kotlinx.serialization.json.Json
+import org.json.JSONArray
+import org.json.JSONObject
 import java.io.File
 
 class CookDetailViewModel : BaseViewModel() {
@@ -41,7 +47,10 @@ class CookDetailViewModel : BaseViewModel() {
     var portionSizeLiveData = MutableLiveData<DevRecipePortionSize>()
     var recipeNumber: String? = null
     private var mRecipeUrl: String? = null
+    var cookDetailInfo :CookDetailInfo? = null
 
+    //原始数据,用于做翻译功能
+    var cookDetailInfoInit :CookDetailInfo? = null
     //是否线上菜谱
     var isRemote = false
 
@@ -66,15 +75,16 @@ class CookDetailViewModel : BaseViewModel() {
                     addQuery("lang", MMkvUtils.getString(CURRENT_LANGUAGE) ?: "EN")
                 }.await().apply {
                     mRecipeUrl = recipeUrl
-                    val detailInfo = CookDetailInfo(
+                    cookDetailInfo = CookDetailInfo(
                         devRecipe,
                         devAccessorys,
                         devRecipeFoods,
                         devRecipeNutritions,
                         devRecipePortionSizes
                     )
-                    portionSizeLiveData.postValue(detailInfo.portionSize.firstOrNull())
-                    recipeLiveData.postValue(detailInfo)
+                    cookDetailInfoInit = cookDetailInfo
+                    portionSizeLiveData.postValue(cookDetailInfo?.portionSize?.firstOrNull())
+                    recipeLiveData.postValue(cookDetailInfo)
                 }
             }.catch {
                 ToastUtils.showShort(it.message)
@@ -103,19 +113,106 @@ class CookDetailViewModel : BaseViewModel() {
                 val includeMaterial = recipeDao.queryFood(number)
                 val includeNutrition = recipeDao.queryNutrition(number)
                 val includePortionSize = recipeDao.queryPortionSize(number)
-                val detailInfo = CookDetailInfo(
+                cookDetailInfo = CookDetailInfo(
                     recipeBean,
                     includeAccessory,
                     includeMaterial,
                     includeNutrition,
                     includePortionSize
                 )
-                portionSizeLiveData.postValue(detailInfo.portionSize.firstOrNull())
-                recipeLiveData.postValue(detailInfo)
+                cookDetailInfoInit = cookDetailInfo
+                portionSizeLiveData.postValue(cookDetailInfo?.portionSize?.firstOrNull())
+                recipeLiveData.postValue(cookDetailInfo)
             }
         }
     }
 
+    fun  getTranslateDetail(jsons :String,value: String){
+        scopeNetLife {
+            Post<String>(Api.TRANSLATE) {
+                json(jsons)
+            }.await().apply {
+                //由于后端返回不规则key ,需特殊处理
+                jsonTranslate( this,value)
+            }
+        }.catch {
+            Log.e("TAG message",it.message.toString())
+            ToastUtils.showShort(it.message)
+        }
+
+
+    }
+
+    fun  jsonTranslate (jsons: String,value: String){
+
+        var jsonObject = JSONObject(jsons)
+        var jsonArray = jsonObject.getJSONArray(value)
+        var size = jsonArray.length()-1
+        for (i in 0 .. size){
+            var jsonObject = jsonArray.getJSONObject(i)
+            var id = jsonObject.getString("id")
+            var valueList = jsonObject.getJSONArray("value")
+            var value = valueList.getString(0)
+            if (id=="name"){
+                cookDetailInfo?.recipe?.name = value
+            }
+            if (id=="introduction"){
+                cookDetailInfo?.recipe?.introduction = value
+            }
+            if (id=="difficulty"){
+                cookDetailInfo?.recipe?.difficultyLevel = value
+            }
+            if (id.contains("foodname")){
+                var ids = id
+                var list = ids.split("_")
+                var index = list[1].toInt()
+                cookDetailInfo?.material?.get(index)?.foodName = value
+            }
+
+        }
+
+
+        portionSizeLiveData.postValue(cookDetailInfo?.portionSize?.firstOrNull())
+        recipeLiveData.postValue(cookDetailInfo)
+
+
+    }
+
+
+    fun  setTranslateDate(value :String):String{
+        var  language = MMkvUtils.getString(CURRENT_LANGUAGE)?:""
+        var listLanguage = mutableListOf<String>()
+        listLanguage.add(value)
+
+        var translateList = mutableListOf<TranslateBean>()
+        translateList.add(TranslateBean("name",cookDetailInfoInit?.recipe?.name))
+        translateList.add(TranslateBean("introduction",cookDetailInfoInit?.recipe?.introduction))
+        translateList.add(TranslateBean("difficulty",cookDetailInfoInit?.recipe?.difficultyLevel))
+        var size = cookDetailInfoInit?.material?.size?:0
+
+        if (size>0){
+            size--
+        }
+
+        for (i in 0..size){
+//            DevRecipeFood
+            var material = cookDetailInfoInit?.material?.get(i)
+            material?.let {
+                translateList.add(TranslateBean("foodname_"+i, it.foodName ?: ""))
+            }
+        }
+
+        var map = HashMap<String,Any>()
+        map["from"] = language.lowercase()
+        map["tos"] = listLanguage
+        map["translateList"] = translateList
+
+        var json = GsonUtils.toJson(map)
+
+        return json
+    }
+
+
     fun getRecipeLiveData(): LiveData<CookDetailInfo> {
         return recipeLiveData
     }

+ 12 - 2
BusinessStep/src/main/res/layout/activity_cook_detail.xml

@@ -352,7 +352,6 @@
         android:background="#66000000"
         android:elevation="@dimen/convert_20px"
         android:visibility="gone"
-
         >
 
         <com.develop.common.widget.CircleBgImageView
@@ -369,7 +368,7 @@
 
         <LinearLayout
             android:id="@+id/more_container"
-            android:layout_width="@dimen/convert_252px"
+            android:layout_width="@dimen/convert_280px"
             android:layout_height="wrap_content"
             android:layout_marginTop="@dimen/convert_35px"
             android:layout_marginEnd="@dimen/convert_53px"
@@ -414,6 +413,17 @@
                 android:text="@string/delete"
                 android:textColor="@color/detail_function_title"
                 android:textSize="@dimen/convert_30px" />
+            <TextView
+                android:id="@+id/tv_more_translate"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/convert_40px"
+                android:drawableStart="@drawable/ic_more_delete"
+                android:drawablePadding="@dimen/convert_13px"
+                android:gravity="center_vertical"
+                android:text="@string/translation"
+                android:textColor="@color/detail_function_title"
+                android:textSize="@dimen/convert_26px" />
 
         </LinearLayout>
 

+ 13 - 13
app/build.gradle

@@ -21,7 +21,7 @@ ext {
     versionCode = Integer.parseInt(new SimpleDateFormat("yyMMddHH").format(new Date()) + 1)
 //    versionCode=230617180
 //    brandCode="054A"
-    brandCode = "000B"
+    brandCode = "000A"
 //    model = "5037"
     model = "1039"
 
@@ -763,23 +763,23 @@ android {
 //            //appCode 1.01 指向bug修复,2.01指向功能变更
 //            buildConfigField("String", "appCode", "\"1.01\"")
 
-            manifestPlaceholders = [channelName: "brand000BTuya"]
-            buildConfigField("String", "UpdatePlatform", "\"night\"")
-            resValue("string", "app_theme", "@style/SplashTheme")
-            buildConfigField("String", "model", "\"1039\"")
-            buildConfigField("String", "brandCode", "\"000B\"")
-            //appCode 1.01 指向bug修复,2.01指向功能变更
-            buildConfigField("String", "appCode", "\"1.01\"")
-
-//
-//            manifestPlaceholders = [channelName: "brand000ATuya"]
-//            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+//            manifestPlaceholders = [channelName: "brand000BTuya"]
+//            buildConfigField("String", "UpdatePlatform", "\"night\"")
 //            resValue("string", "app_theme", "@style/SplashTheme")
 //            buildConfigField("String", "model", "\"1039\"")
-//            buildConfigField("String", "brandCode", "\"000A\"")
+//            buildConfigField("String", "brandCode", "\"000B\"")
 //            //appCode 1.01 指向bug修复,2.01指向功能变更
 //            buildConfigField("String", "appCode", "\"1.01\"")
 
+//
+            manifestPlaceholders = [channelName: "brand000ATuya"]
+            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            resValue("string", "app_theme", "@style/SplashTheme")
+            buildConfigField("String", "model", "\"1039\"")
+            buildConfigField("String", "brandCode", "\"000A\"")
+            //appCode 1.01 指向bug修复,2.01指向功能变更
+            buildConfigField("String", "appCode", "\"1.01\"")
+
 //            manifestPlaceholders = [channelName: "brand000ATuya"]
 //            buildConfigField("String", "UpdatePlatform", "\"normal\"")
 //            resValue("string", "app_theme", "@style/SplashTheme")

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

@@ -216,8 +216,8 @@ fun getSN(): String {
 //        return "045A50370020123010190001"
 //        return "000A30150020123010190001"
 //     return "000A10390020123010170001"
-//     return "000A10390020123010190001"
-        return "000B10390020123010190001"
+     return "000A10390020123010190001"
+//        return "000B10390020123010190001"
 //        return "025A10390020123010190001"
 //        return "054A50370020123010190001"
 //        return "054A10390020123010190001"