Procházet zdrojové kódy

调整058 自动程序加载

zhangshenjie před 6 dny
rodič
revize
f7f94c5beb

+ 6 - 2
BusinessMain/src/main/java/com/develop/main/init/ui/ModesFragment.kt

@@ -114,7 +114,9 @@ class ModesFragment : ViewBindingFragment<FragmentModesBinding>() {
         }
 
         dataList =
-            if (getSN().startsWith("058")) getConfigGridList() else DataFactory.genGridModesList(
+            if (getSN().startsWith("058")) DataFactory.gen058GridModesList(
+                resources
+            ) else DataFactory.genGridModesList(
                 resources
             )
 
@@ -164,7 +166,9 @@ class ModesFragment : ViewBindingFragment<FragmentModesBinding>() {
             })
         }
         modesGalleryAdapter.setList(
-            if (getSN().startsWith("058")) getConfigList() else DataFactory.genGalleryModesList(
+            if (getSN().startsWith("058"))  DataFactory.gen058GalleryModesList(
+                resources
+            ) else DataFactory.genGalleryModesList(
                 resources
             )
         )

+ 11 - 11
app/build.gradle

@@ -23,7 +23,7 @@ static  int formatTime() {
 
 ext{
      versionCode=Integer.parseInt(new SimpleDateFormat("yyMMddHH").format(new Date()) + 1)
-     brandCode="000A"
+     brandCode="058A"
      brandVersionCode=versionCode
      model="3015"
 }
@@ -96,7 +96,7 @@ android {
             buildConfigField("String", "UpdatePlatform", "\"normal\"")
             resValue("string", "app_theme", "@style/SplashTheme")
             buildConfigField("String", "model", "\"3015\"")
-            buildConfigField("String", "brandCode", "\"000A\"")
+            buildConfigField("String", "brandCode", "\"058A\"")
         }
 
 
@@ -162,10 +162,10 @@ android {
 //            buildConfigField("String", "brandCode", "\"034A\"")
 //
 //            manifestPlaceholders = [channelName: "brand000ATuya"]
-            buildConfigField("String", "UpdatePlatform", "\"normal\"")
-            resValue("string", "app_theme", "@style/SplashTheme")
-            buildConfigField("String", "model", "\"3015\"")
-            buildConfigField("String", "brandCode", "\"000A\"")
+//            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+//            resValue("string", "app_theme", "@style/SplashTheme")
+//            buildConfigField("String", "model", "\"3015\"")
+//            buildConfigField("String", "brandCode", "\"000A\"")
 
 //            manifestPlaceholders = [channelName: "brand034"]
 //            buildConfigField("String", "UpdatePlatform", "\"night\"")
@@ -173,11 +173,11 @@ android {
 //            buildConfigField("String", "model", "\"3015\"")
 //            buildConfigField("String", "brandCode", "\"034A\"")
 
-//            manifestPlaceholders = [channelName: "brand058A"]
-//                        buildConfigField("String", "UpdatePlatform", "\"normal\"")
-//            resValue("string", "app_theme", "@style/SplashTheme")
-//            buildConfigField("String", "model", "\"3015\"")
-//            buildConfigField("String", "brandCode", "\"058A\"")
+            manifestPlaceholders = [channelName: "brand058A"]
+                        buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            resValue("string", "app_theme", "@style/SplashTheme")
+            buildConfigField("String", "model", "\"3015\"")
+            buildConfigField("String", "brandCode", "\"058A\"")
 
         }
         //输出类型

+ 263 - 0
app/src/brand000ATuya/res/values-en/strings.xml

@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <string name="not_a_member_yet">Not a %1s yet?</string>
+    <string name="member">member</string>
+    <string name="select_language">Select Language</string>
+    <string name="next">NEXT</string>
+    <string name="english">English</string>
+    <string name="chinese">简体中文</string>
+    <string name="france">Français</string>
+    <string name="japan">日本語</string>
+    <string name="skip">SKIP</string>
+    <string name="recipes">Recipes</string>
+    <string name="mode">Mode</string>
+    <string name="sunday">Sunday</string>
+    <string name="monday">Monday</string>
+    <string name="tuesday">Tuesday</string>
+    <string name="wednesday">Wednesday</string>
+    <string name="thursday">Thursday</string>
+    <string name="friday">Friday</string>
+    <string name="saturday">Saturday</string>
+    <string name="resume">RESUME</string>
+    <string name="privacy_policy">Privacy policy</string>
+    <string name="privacy_policy_content">1.How do we collect and use your personal information
+Nanfang plus client is an online information platform developed and operated by Guangdong Nanfang newspaper mobile media Co.,Ltd.(hereinafter referred to as"we").In theprocess of using the southern plus client service,we will collect the information you actively provide when using the service or arising from using the service in the following ways to provide you with services,optimize our services and ensure the security of your account.</string>
+    <string name="i_agree">I Agree</string>
+    <string name="i_have_read_the_privacy_policy">I have read the privacy policy</string>
+    <string name="second">Second</string>
+    <string name="wifi">Wi-Fi networks</string>
+    <string name="off_line">Offline</string>
+    <string name="ok">OK</string>
+    <string name="wifi_ok">OK</string>
+    <string name="wifi_loading_text">Connecting</string>
+    <string name="wifi_password_wrong">Wrong password for WiFi</string>
+    <string name="on_line">Online</string>
+    <string name="pwd_can_not_be_empty">pwd can not be empty!</string>
+    <string name="skin_for_now">Skin for now</string>
+    <string name="login">Login</string>
+    <string name="online_recipes">Online Recipes</string>
+    <string name="cook_history">Cooking history</string>
+    <string name="favourite_recipes">Favourite recipes</string>
+    <string name="settings">Settings</string>
+    <string name="grid_view">Grid view</string>
+    <string name="list_view">List view</string>
+    <string name="adapted_cooking">Adapted\ncooking</string>
+    <string name="scales">Scales</string>
+    <string name="boil_water">Boil</string>
+    <string name="chop">Chop</string>
+    <string name="ferment">Ferment</string>
+    <string name="slow_cook">Slow cook</string>
+    <string name="knead_dough">Knead dough</string>
+    <string name="steam">Steam</string>
+    <string name="food_processor">Food processor</string>
+    <string name="turbo">Turbo</string>
+    <string name="language">LANGUAGE</string>
+    <string name="sound">Volume</string>
+    <string name="brightness">BRIGHTNESS</string>
+    <string name="user_account">PROFILE</string>
+    <string name="storage">Storage</string>
+    <string name="reset">Restore factory settings</string>
+    <string name="about">ABOUT DEVICE</string>
+    <string name="weight">Scales</string>
+    <string name="local_recipes">Local recipes</string>
+    <string name="download">Download</string>
+    <string name="downloading">Downloading</string>
+    <string name="enter_search">Enter search</string>
+    <string name="search">Search</string>
+    <string name="search_content_exceed">A search query can’t be longer than 20 characters</string>
+    <string name="most_popular">Most popular</string>
+    <string name="newest">Newest</string>
+    <string name="the_most_commonly_searched">The most commonly searched</string>
+    <string name="notice">Notice</string>
+    <string name="all">ALL</string>
+    <string name="Recipes">Recipes</string>
+    <string name="ingredients">Ingredients</string>
+    <string name="Brightness">BRIGHTNESS</string>
+    <string name="screen_lock_time">Sleep after</string>
+    <string name="time_3min">3 min</string>
+    <string name="time_5min">5 min</string>
+    <string name="time_10min">10 min</string>
+    <string name="time_20min">20 min</string>
+    <string name="time_30min">30 min</string>
+    <string name="Sound">Sound</string>
+    <string name="text_to_speech">Text to speech</string>
+    <string name="Language">LANGUAGE</string>
+    <string name="Continue">CONTINUE</string>
+    <string name="start_cooking">START COOKING</string>
+    <string name="recipe_not_language">The recipe language does not match, please switch languages</string>
+    <string name="off">OFF</string>
+    <string name="on">ON</string>
+    <string name="update_the_recipes">Update the recipes</string>
+    <string name="apk">APK</string>
+    <string name="mcu">MCU</string>
+    <string name="tp">TP</string>
+    <string name="serial_number">SN</string>
+    <string name="standby_time">MODEL</string>
+    <string name="update">Update</string>
+    <string name="About">ABOUT DEVICE</string>
+    <string name="are_you_sure_to_restore_factory_settings">Are you sure to restore factory settings?</string>
+    <string name="yes">YES</string>
+    <string name="restore_factory_settings">FACTORY SETTINGS</string>
+
+    <string name="network_wifi_status_connected_no_internet">Connected, but unable to access the Internet</string>
+    <string name="network_wifi_status_saved">Saved</string>
+    <string name="network_wifi_status_idle" />
+    <string name="network_wifi_status_disabled">Disconnected</string>
+    <string name="network_wifi_status_network_failure">"IP address configuration failure"</string>
+    <string name="network_wifi_status_wifi_failure">"WLAN connection failure"</string>
+    <string name="network_wifi_status_password_failure">"There is a problem with authentication"</string>
+    <string name="network_wifi_status_scanning">Scanning...</string>
+    <string name="network_wifi_status_connecting">Connecting…</string>
+    <string name="network_wifi_status_authenticating">Authentication in progress…</string>
+    <string name="network_wifi_status_obtaining_ip_address">obtaining IP address…</string>
+    <string name="network_wifi_status_connected">Connected</string>
+    <string name="network_wifi_status_suspended">Paused</string>
+    <string name="network_wifi_status_disconnecting">Disconnecting…</string>
+    <string name="network_wifi_status_disconnected">Disconnected</string>
+    <string name="network_wifi_status_failed">Failed</string>
+    <string name="network_wifi_status_blocked">Blocked</string>
+    <string name="network_wifi_status_verifying_poor_link">Temporarily shut down (bad network condition)</string>
+    <string name="start">START</string>
+    <string name="pause">PAUSE</string>
+    <string name="cancel">CANCEL</string>
+    <string name="confirm">Done</string>
+    <string name="stop">STOP</string>
+    <string name="turn_right">Right</string>
+    <string name="turn_left">Left\n</string>
+    <string name="temperature">Temperature</string>
+    <string name="time">Time</string>
+    <string name="speed">Speed</string>
+    <string name="direction">Direction</string>
+    <string name="bad">Bad</string>
+    <string name="imperfect">Imperfect</string>
+    <string name="ordinary">Ordinary</string>
+    <string name="good">Good</string>
+    <string name="perfect">Perfect</string>
+    <string name="are_you_sure_to_delete">Are you sure to delete?</string>
+    <string name="no">NO</string>
+    <string name="unset_param_tips">Please set the operation parameters</string>
+    <string name="pmpt_confirm">Confirm</string>
+    <string name="pmpt_cancel">Cancel</string>
+    <string name="pmpt_msg">Tips</string>
+    <string name="dev_end_of_run_tips">Finish!</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>
+    <string name="update_title">Is it the latest version?</string>
+    <string name="finish_download">Downloaded</string>
+    <string name="download_fail">Download failure</string>
+    <string name="apk_version_latest">You have the latest firmware version installed.</string>
+    <string name="start_download">Start to download</string>
+    <string name="weight_overload_tips">Weighing overload</string>
+    <string name="forgot_password">Forgotten password</string>
+    <string name="enter_email_id">Enter Email ID</string>
+    <string name="enter_password">Enter Password</string>
+    <string name="register">Register</string>
+    <string name="launch_detail">Join us today and enjoy the ultimate cooking expenence</string>
+    <string name="login_sign_up">Login / Sign up</string>
+    <string name="skip_for_now">Skip for now</string>
+    <string name="reset_password">Reset Password</string>
+    <string name="enter_captcha">Enter Captcha</string>
+    <string name="send_email">Send Email</string>
+    <string name="enter_password_again">Enter Password Again</string>
+    <string name="enter_the_captcha_obtained_from_the_mail">Enter the Captcha obtained from the mail</string>
+    <string name="nickname">Nickname</string>
+    <string name="enter_nickname">Enter Nickname</string>
+    <string name="enter_nickname_exceed">The username can’t be longer than 20 characters</string>
+    <string name="Gender">Gender</string>
+    <string name="male">Male</string>
+    <string name="age">Age</string>
+    <string name="save">Save</string>
+    <string name="cancellation_of_account">Cancellation of account</string>
+    <string name="sign_up_it_s_free">Sign up, it\'s FREE</string>
+    <string name="pwd_requirement">Composed of letters and numbers,with no less than 8 digits.</string>
+    <string name="please_select_age">Please select age</string>
+    <string name="cancel_lower">Cancel</string>
+    <string name="female">Female</string>
+    <string name="tare">Tare</string>
+    <string name="keep_cooking_in_the_background">Keep cooking in the background?</string>
+    <string name="delete_old_recipes">Do you want to delete the old recipes?</string>
+    <string name="reset_button">RESET</string>
+    <string name="finish">Finish!</string>
+    <string name="error">Error</string>
+    <string name="download_failed">Download failed</string>
+    <string name="warning">Warning!</string>
+    <string name="lid_unlock">Lid unlock</string>
+    <string name="share_with_more_people">Share with more people</string>
+    <string name="scan_qr_code_with_camera">Scan QR code with camera</string>
+    <string name="enter_what_you_want_to_say">Enter what you want to say</string>
+    <string name="note_comment_content_exceed">A note/comment can’t be longer than 100 characters</string>
+    <string name="note_title">Note title</string>
+    <string name="type_your_notes_here">Type your notes here</string>
+    <string name="make_1_jar">Servings: 1</string>
+    <string name="make_n_jars">Servings: %1s</string>
+    <string name="per_serving">1 serving:</string>
+    <string name="preparation">Preparation:</string>
+    <string name="hours">h</string>
+    <string name="min">min</string>
+    <string name="ready_in">Ready in:</string>
+    <string name="jar">JAR</string>
+    <string name="serving_sizes">Serving sizes</string>
+    <string name="score">Score</string>
+    <string name="share">Share</string>
+    <string name="delete">Delete</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>
+    <string name="recipe_update_finish">Recipe data update completed</string>
+    <string name="update_recipe_title">Recipe update</string>
+    <string name="update_outage_msg">Downloading the recipes… Please do not switch off or unplug the device.</string>
+    <string name="restore_confirm_tips">Are you sure to restore to the factory settings?</string>
+    <string name="change_lang_tips">The program is running, please close the program to perform this operation again!</string>
+    <string name="exit_weight_align">Exit calibration</string>
+    <string name="weight_aligning">Calibrating..</string>
+    <string name="weight_one_kg_tips">Please put on weight 1 KGS</string>
+    <string name="weight_two_kg_tips">Please put on weight 2 KGS</string>
+    <string name="weight_align_success">Calibrate successfully!</string>
+    <string name="change_lang_tips2">After switch the language, recipe languages will change at the same time and restart. Are you sure to switch the language? </string>
+    <string name="pot_clover_not_clost_tips">The lid is unlocked or locked incorrectly. Please lock the lid and then start .</string>
+    <string name="screen_saver_title">Do you want to enter the breath screen?</string>
+    <string name="sex">Sex</string>
+    <string name="wight">Scales</string>
+    <string name="running_block_tips">Please stop the running program and start new programs.</string>
+    <string name="unset_target_time">Time has not been set.</string>
+    <string name="recipe_complete">The dish is ready</string>
+    <string name="engjoy_your_meal"> Enjoy your meal!</string>
+    <string name="gan_sao_yi_chan">WARNING!\nThe bowl is empty.\nAdd ingredients before starting the mode</string>
+    <string name="empty_notice">Empty Notice</string>
+    <string name="login_expire_tips">Log in error. Try again</string>
+    <string name="account_password_error">Invalid login or password</string>
+    <string name="account_not_exist">Invalid login</string>
+    <string name="captcha_incorrect">Invalid code</string>
+    <string name="dian_zi_cheng_tong_xin_yi_chan">WARNING!\nScales failure</string>
+    <string name="zhuan_su_fan_kui_yi_chan">WARNING!\nThe bowl lid is loose.\nMotor overload: cool the device down and\nnever fill the bowl completely before starting the mode</string>
+    <string name="ntc_yi_chan">WARNING!\nThe NTC temperature sensor failure.\nContact an AENO service centre</string>
+    <string name="mei_fang_guo_yi_chan">Missing pot</string>
+    <string name="historical_search">historical search</string>
+    <string name="connected_successfully">Connected</string>
+    <string name="sign_out">Sign out</string>
+    <string name="avatar_select">Change</string>
+    <string name="member_home">Home</string>
+    <string name="sec">s</string>
+    <string name="step">Step</string>
+    <string name="remember">Remember</string>
+    <string name="please_fill_in_your_email">You need to enter your e-mail address</string>
+    <string name="password_is_not_the_same">The passwords don‘t match</string>
+    <string name="please_fill_in">All the fields must be filled in</string>
+    <string name="evaluate_successfully">Score accepted</string>
+    <string name="minute_lower">min</string>
+    <string name="hour">h</string>
+    <string name="no_recipes">Recipe not found</string>
+    <string name="no_more_data">Insufficient memory</string>
+    <string name="easy">easy</string>
+    <string name="hard">hard</string>
+    <string name="medium">Medium</string>
+    <string name="password_should_include">The password must contain at least 8 characters, including letters and numbers</string>
+    <string name="password_should_more_than">The password must contain at least 8 characters</string>
+    <string name="a_z">A-Z</string>
+    <string name="email_send">Code has been sent</string>
+    <string name="captcha_can_not_be_empty">You need to enter the code</string>
+    <string name="please_fill_in_the_password">You need to enter the password</string>
+    <string name="reset_password_success">Password has been changed</string>
+</resources>

+ 5 - 0
app/src/main/assets/tuya_config.json

@@ -255,6 +255,11 @@
       "uid": "uuid9aa9669f99f79414",
       "ak": "ZwDCooravMlGCErWtkdARz9rT7lakmT4"
     },
+    "000A30150020123010190004": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuid8bd1a0dbd8331dfe",
+      "ak": "pPZsAIVsyC3lAIWy9CN2nkODnkR9SvMa"
+    },
     "012A30150020123010190001": {
       "pid": "7c7q4vunlgfjva9p",
       "uid": "uuidec09a7278926be2a",

+ 9 - 1
app/src/main/java/com/develop/foodcooking/MainActivity.kt

@@ -18,6 +18,7 @@ import com.develop.food.base.utils.SerialportLibUtils
 import com.develop.food.base.utils.SettingKeyBoardUtils
 import com.develop.food.base.utils.TopResumedActivityHolder
 import com.develop.food.base.utils.TuyaUtils
+import com.develop.food.base.utils.getSN
 import com.develop.food.base.widgets.RecipeUpdateDialog
 import com.google.gson.Gson
 
@@ -39,6 +40,14 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
         if (MmkvUtils.getBool("isFirstIn")) {
             navigateTo(Screens.Main.ENTRANCE_CHOSEN)
         } else {
+            //058 不需要开机视频
+
+            if (getSN().startsWith("058")){
+                navigateTo(Screens.Setting.LANGUAGE)
+            }else{
+                navigateTo(Screens.Setting.ANIMATION)
+
+            }
 //            //设置语言
 //            val list = DataFactory.createLanguageDataV2(resources)
 //            var listStr = mutableListOf<String>()
@@ -56,7 +65,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
 //                this,
 //                MmkvUtils.getString(CURRENT_LANGUAGE)?.lowercase() ?: "en"
 //            )
-            navigateTo(Screens.Setting.ANIMATION)
         }
 
 

+ 88 - 0
libBase/src/main/java/com/develop/food/base/data/DataFactory.kt

@@ -138,6 +138,50 @@ object DataFactory {
         return result
     }
 
+    fun gen058GridModesList(resource: Resources): MutableList<ModelsModel> {
+        val result = mutableListOf<ModelsModel>()
+        val resIdList = mutableListOf(
+            R.drawable.ic_adapted_cooking,
+            R.drawable.ic_knead_dough,
+            R.drawable.ic_steam,
+            R.drawable.ic_slow_cook,
+            R.drawable.ic_boil_water,
+            R.drawable.ic_food_processor,
+            R.drawable.ic_chop,
+            R.drawable.ic_night_turbo,
+
+            R.drawable.ic_scales
+
+        )
+        val modeNameList = mutableListOf(
+            resource.getString(R.string.adapted_cooking),
+            resource.getString(R.string.knead_dough),
+            resource.getString(R.string.steam),
+            resource.getString(R.string.slow_cook),
+            resource.getString(R.string.boil_water),
+            resource.getString(R.string.food_processor),
+            resource.getString(R.string.chop),
+            resource.getString(R.string.turbo),
+            resource.getString(R.string.wight)
+
+        )
+        val modesTypeList = mutableListOf(
+            ModesType.ADAPTED_COOKING,
+            ModesType.KNEAD_TOUGH,
+            ModesType.STEAM,
+            ModesType.SLOW_COOK,
+            ModesType.BOIL_WATER,
+            ModesType.FOOD_PROCESSOR,
+            ModesType.CHOP,
+            ModesType.TURBO,
+            ModesType.WIGHT
+        )
+        for (i in resIdList.indices) {
+            result.add(ModelsModel(resIdList[i], modeNameList[i], modesTypeList[i]))
+        }
+        return result
+    }
+
     fun genGridModesList(resource: Resources): MutableList<ModelsModel> {
         val result = mutableListOf<ModelsModel>()
         val resIdList = mutableListOf(
@@ -179,6 +223,8 @@ object DataFactory {
         return result
     }
 
+
+
     fun genGalleryModesList(resource: Resources): MutableList<ModelsModel> {
         val result = mutableListOf<ModelsModel>()
         val resIdList = mutableListOf(
@@ -220,6 +266,48 @@ object DataFactory {
         return result
     }
 
+    fun gen058GalleryModesList(resource: Resources): MutableList<ModelsModel> {
+        val result = mutableListOf<ModelsModel>()
+        val resIdList = mutableListOf(
+            R.drawable.ic_grid_adapted_cooking,
+            R.drawable.ic_grid_knead_dough,
+            R.drawable.ic_grid_steam,
+            R.drawable.ic_grid_slow_cook,
+            R.drawable.ic_grid_boil_water,
+            R.drawable.ic_grid_food_processor,
+            R.drawable.ic_grid_chop,
+            R.drawable.ic_grid_turbo,
+            R.drawable.ic_grid_weight
+        )
+        val modeNameList = mutableListOf(
+            resource.getString(R.string.adapted_cooking),
+            resource.getString(R.string.knead_dough),
+            resource.getString(R.string.steam),
+            resource.getString(R.string.slow_cook),
+            resource.getString(R.string.boil_water),
+            resource.getString(R.string.food_processor),
+            resource.getString(R.string.chop),
+            resource.getString(R.string.turbo),
+            resource.getString(R.string.wight)
+
+        )
+        val modesTypeList = mutableListOf(
+            ModesType.ADAPTED_COOKING,
+            ModesType.KNEAD_TOUGH,
+            ModesType.STEAM,
+            ModesType.SLOW_COOK,
+            ModesType.BOIL_WATER,
+            ModesType.FOOD_PROCESSOR,
+            ModesType.CHOP,
+            ModesType.TURBO,
+            ModesType.WIGHT
+        )
+        for (i in resIdList.indices) {
+            result.add(ModelsModel(resIdList[i], modeNameList[i], modesTypeList[i]))
+        }
+        return result
+    }
+
     fun genSettingModesList(resource: Resources): MutableList<SettingModel> {
         val result = mutableListOf<SettingModel>()
         val resIdList = mutableListOf(