增加【九天AI】UI 1722/target/1
authorCaisking <Casiking@zhihuishixun.com>
Wed, 16 Apr 2025 07:46:49 +0000 (15:46 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Wed, 16 Apr 2025 07:56:12 +0000 (15:56 +0800)
code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h
code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h
code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceView.h
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceBluetoothFailedStartView.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceConnectTimeoutView.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceMobileDataFailedStartView.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceReturnResultTextView.cpp
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_lingxi.bin [new file with mode: 0644]

index 7127be4..216f85f 100644 (file)
@@ -1,15 +1,15 @@
-/*
-* Copyright (c) xxxxxxxx Technologies Co., Ltd. 2021-2021. All rights reserved.
-* Description: language
-* Author: Graphic develop team
-* Create: 2021-07-06
-*/
-
-#ifndef UI_RESOURCE_STRING_H
-#define UI_RESOURCE_STRING_H
-#include <cstdint>
-namespace OHOS {
-enum UIResourceTextId : uint16_t {
+/*\r
+* Copyright (c) xxxxxxxx Technologies Co., Ltd. 2021-2021. All rights reserved.\r
+* Description: language\r
+* Author: Graphic develop team\r
+* Create: 2021-07-06\r
+*/\r
+\r
+#ifndef UI_RESOURCE_STRING_H\r
+#define UI_RESOURCE_STRING_H\r
+#include <cstdint>\r
+namespace OHOS {\r
+enum UIResourceTextId : uint16_t {\r
     STR_EXERCISE_OUTDOORWALKING = 0,\r
     STR_EXERCISE_OUTDOORRUNNING = 1,\r
     STR_EXERCISE_OUTDOORBIKING = 2,\r
@@ -652,10 +652,11 @@ enum UIResourceTextId : uint16_t {
     STR_RECORD_MAX = 639,\r
     STR_CLEAR_ALL_RECORDS = 640,\r
     STR_DEEPSEEK = 641,\r
+    STR_AIMODES_LINGXI = 642,\r
     STR_MAX_ID = 642,\r
 }; // UIResourceTextId\r
-
-enum FontLanguageId : uint8_t {
+\r
+enum FontLanguageId : uint8_t {\r
     LANGUAGE_ID_AR,\r
     LANGUAGE_ID_AZ,\r
     LANGUAGE_ID_CS,\r
index ede8f78..2b162ea 100644 (file)
@@ -32,7 +32,7 @@ namespace OHOS
             AIMODES_KIMI,            /*KIMI*/
             AIMODES_DOUBAO,          /*豆包*/
             AIMODES_TONGYI_QIANWEN,  /*通义千问->DeepSeek*/
-            AIMODES_IFLYTEK_SPARK,   /*讯飞星火*/
+            AIMODES_IFLYTEK_SPARK,   /*讯飞星火->lingxi*/
             AIMODES_CHATGPT,         /*chatgpt*/
             AIMODES_MAX_NUM,
         } aimodels;
index d6de21b..1268ce1 100644 (file)
@@ -39,6 +39,7 @@ namespace OHOS
     static constexpr const char *AIMODEL_TONGYI_QIANWEN_PATH = "/user/res/AIVoice/aimodels/aimodes_tongyi_qianwen.bin"; /*通义千问*/
     static constexpr const char *AIMODEL_IFLYTEK_SPARK_PATH = "/user/res/AIVoice/aimodels/aimodes_iflytek_spark.bin";   /*讯飞星火*/
     static constexpr const char *AIMODEL_DEEPSEEK_PATH = "/user/res/AIVoice/aimodels/aimodes_deepseek.bin";             /*deepseek*/
+    static constexpr const char *AIMODEL_LINGXI_PATH = "/user/res/AIVoice/aimodels/aimodels_lingxi.bin";                /*lingxi*/
 
     /*组件ID*/
     static constexpr const char *AIVOICE_START_CHAT_BUTTON_VIEW_ID = "aivoice_start_chat_button_view_id"; // 开始对话
@@ -69,7 +70,8 @@ namespace OHOS
         {STR_AIMODELS_DOUBAO, AIMODEL_DOUBAO_PATH},
         // {STR_TONGYI_QIANWEN, AIMODEL_TONGYI_QIANWEN_PATH},
         {STR_DEEPSEEK, AIMODEL_DEEPSEEK_PATH},
-        {STR_IFLYTEK_SPARK, AIMODEL_IFLYTEK_SPARK_PATH},
+        // {STR_IFLYTEK_SPARK, AIMODEL_IFLYTEK_SPARK_PATH},
+        {STR_AIMODES_LINGXI, AIMODEL_LINGXI_PATH},
         {STR_AIMODES_CHATGPT, AIMODEL_CHATGPT_ON_PATH},
     };
 
index 42f9829..01f7c1f 100644 (file)
@@ -11,6 +11,7 @@
 #include "wearable_log.h"
 #include "ui_resource_string.h"
 #include <UiConfig.h>
+#include "ConfigModel.h"
 namespace OHOS
 {
 
@@ -92,8 +93,19 @@ namespace OHOS
         //TOOD: 待优化
         if(labelconfig.textId == STR_DEEPSEEK) {
             label->SetText("DeepSeek");
-        } else
+        }else if(labelconfig.textId == STR_AIMODES_LINGXI) {
+            int language = ConfigModel::GetInstance()->GetLanguage();
+            if (language == 0) // 如果当前系统为中文
+            {
+                label->SetText("九天");
+            }
+            else
+            {
+                label->SetText("jiutian");
+            }
+        } else{
             label->SetTextId(labelconfig.textId);
+        }
         label->SetLineBreakMode(labelconfig.lineBreakMode);
         label->SetRollSpeed(23);
         label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
@@ -278,15 +290,23 @@ namespace OHOS
     {
         if (title)
         {
-            if(textId == STR_DEEPSEEK) 
-            {
+            if(textId == STR_DEEPSEEK) {
                 title->SetText("DeepSeek");
-            } 
-            else 
-            {
-            title->SetTextId(textId);
-            title->ForceResetText();
+             }else if(textId == STR_AIMODES_LINGXI) {
+                int language = ConfigModel::GetInstance()->GetLanguage();
+                if (language == 0) // 如果当前系统为中文
+                {
+                    title->SetText("九天");
+                }
+                else
+                {
+                    title->SetText("jiutian");
+                }
+            } else{
+                title->SetTextId(textId);
             }
+
+            title->ForceResetText();
         }
     }
 
index 41216d6..fd64a07 100644 (file)
@@ -28,6 +28,7 @@
 #include <sys/stat.h>
 #include "bleService.h"
 #include <custom_save_runtime.h>
+#include "ConfigModel.h"
 namespace OHOS
 {
     // 声明定时器变量
@@ -1085,7 +1086,8 @@ namespace OHOS
                 {2, {STR_AIMODELS_DOUBAO, 3}},
                 // {3, {STR_TONGYI_QIANWEN, 4}},
                 {3, {STR_DEEPSEEK, 4}},
-                {4, {STR_IFLYTEK_SPARK, 5}},
+                // {4, {STR_IFLYTEK_SPARK, 5}},
+                {4, {STR_AIMODES_LINGXI, 5}},
                 {5, {STR_AIMODES_CHATGPT, 1}},
             };
             textId = STR_AIMODES_WENXINYIYAN;
@@ -1099,7 +1101,8 @@ namespace OHOS
                 {3, {STR_AIMODELS_DOUBAO, 3}},
                 // {4, {STR_TONGYI_QIANWEN, 4}},
                 {4, {STR_DEEPSEEK, 4}},
-                {5, {STR_IFLYTEK_SPARK, 5}},
+                // {5, {STR_IFLYTEK_SPARK, 5}},
+                {5, {STR_AIMODES_LINGXI, 5}},
             };
             textId = STR_AIMODES_CHATGPT;
         }
index e61d048..9eb7e35 100644 (file)
@@ -161,8 +161,19 @@ namespace OHOS
         //TOOD: 待优化
         if(labelconfig.textId == STR_DEEPSEEK) {
             label->SetText("DeepSeek");
-        } else
+        }else if(labelconfig.textId == STR_AIMODES_LINGXI) {
+            int language = ConfigModel::GetInstance()->GetLanguage();
+            if (language == 0) // 如果当前系统为中文
+            {
+                label->SetText("九天");
+            }
+            else
+            {
+                label->SetText("jiutian");
+            }
+        } else{
             label->SetTextId(labelconfig.textId);
+        }
         label->SetLineBreakMode(labelconfig.lineBreakMode);
         label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         label->SetRollSpeed(23);
@@ -413,11 +424,13 @@ namespace OHOS
             aiModelPicker->SetRotateFactor(1.0);
             aiModelPicker->RequestFocus();
             aiModelPicker->RegisterSelectedListener(presenter_);
-            aiModelPicker->SetTextColor(Color::GetColorFromRGBA(0x00, 0x00, 0x00, 0xff), Color::GetColorFromRGBA(0xff, 0x00, 0x00, 0xff));
+            // 设置文本颜色为透明
+            aiModelPicker->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x00), Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x00));
             const char *uiPicker1Data[] = {"0", "1", "2", "3", "4", "5"};
             aiModelPicker->SetValues(uiPicker1Data, sizeof(uiPicker1Data) / sizeof(uiPicker1Data[0]));
+            // aiModelPicker->SetVisible(false);//屏蔽picker组件
         }
-
+    
         return true;
     }
 
@@ -938,15 +951,23 @@ namespace OHOS
         int textId = AiVoiceModel::GetInstance().GetAiModelTextId();
         if (title)
         {
-            if(textId == STR_DEEPSEEK) 
-            {
+            if(textId == STR_DEEPSEEK) {
                 title->SetText("DeepSeek");
-            } 
-            else 
-            {
-            title->SetTextId(textId);
-            title->ForceResetText();
+             }else if(textId == STR_AIMODES_LINGXI) {
+                int language = ConfigModel::GetInstance()->GetLanguage();
+                if (language == 0) // 如果当前系统为中文
+                {
+                    title->SetText("九天");
+                }
+                else
+                {
+                    title->SetText("jiutian");
+                }
+            } else{
+                title->SetTextId(textId);
             }
+
+            title->ForceResetText();
         }
         if (aiModelImage)
         {
index babb779..a6601f2 100644 (file)
@@ -11,6 +11,7 @@
 #include "wearable_log.h"
 #include "ui_resource_string.h"
 #include <UiConfig.h>
+#include "ConfigModel.h"
 namespace OHOS
 {
     static constexpr const int16_t LABEL_ROLL_SPEED = 70;
@@ -84,8 +85,19 @@ namespace OHOS
         //TOOD: 待优化
         if(labelconfig.textId == STR_DEEPSEEK) {
             label->SetText("DeepSeek");
-        } else
+         }else if(labelconfig.textId == STR_AIMODES_LINGXI) {
+            int language = ConfigModel::GetInstance()->GetLanguage();
+            if (language == 0) // 如果当前系统为中文
+            {
+                label->SetText("九天");
+            }
+            else
+            {
+                label->SetText("jiutian");
+            }
+        } else{
             label->SetTextId(labelconfig.textId);
+        }
         label->SetLineBreakMode(labelconfig.lineBreakMode);
         label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize);
@@ -269,15 +281,23 @@ namespace OHOS
     {
         if (title)
         {
-            if(textId == STR_DEEPSEEK) 
-            {
+            if(textId == STR_DEEPSEEK) {
                 title->SetText("DeepSeek");
-            } 
-            else 
-            {
-            title->SetTextId(textId);
-            title->ForceResetText();
+             }else if(textId == STR_AIMODES_LINGXI) {
+                int language = ConfigModel::GetInstance()->GetLanguage();
+                if (language == 0) // 如果当前系统为中文
+                {
+                    title->SetText("九天");
+                }
+                else
+                {
+                    title->SetText("jiutian");
+                }
+            } else{
+                title->SetTextId(textId);
             }
+
+            title->ForceResetText();
         }
     }
 
index 554cab8..3243182 100644 (file)
@@ -11,6 +11,7 @@
 #include "wearable_log.h"
 #include "ui_resource_string.h"
 #include <UiConfig.h>
+#include "ConfigModel.h"
 namespace OHOS
 {
 
@@ -89,11 +90,22 @@ namespace OHOS
         label->SetPosition(labelconfig.left, labelconfig.top, labelconfig.width, labelconfig.height);
         label->SetStyle(STYLE_TEXT_FONT, labelconfig.fontSize);
         label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh);
-        //TOOD: 待优化
-        if(labelconfig.textId == STR_DEEPSEEK) {
+         //TOOD: 待优化
+         if(labelconfig.textId == STR_DEEPSEEK) {
             label->SetText("DeepSeek");
-        } else
+        }else if(labelconfig.textId == STR_AIMODES_LINGXI) {
+            int language = ConfigModel::GetInstance()->GetLanguage();
+            if (language == 0) // 如果当前系统为中文
+            {
+                label->SetText("九天");
+            }
+            else
+            {
+                label->SetText("jiutian");
+            }
+        } else{
             label->SetTextId(labelconfig.textId);
+        }
         label->SetLineBreakMode(labelconfig.lineBreakMode);
         label->SetRollSpeed(23);
         label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
@@ -279,15 +291,23 @@ namespace OHOS
     {
         if (title)
         {
-            if(textId == STR_DEEPSEEK) 
-            {
+            if(textId == STR_DEEPSEEK) {
                 title->SetText("DeepSeek");
-            } 
-            else 
-            {
-            title->SetTextId(textId);
-            title->ForceResetText();
+             }else if(textId == STR_AIMODES_LINGXI) {
+                int language = ConfigModel::GetInstance()->GetLanguage();
+                if (language == 0) // 如果当前系统为中文
+                {
+                    title->SetText("九天");
+                }
+                else
+                {
+                    title->SetText("jiutian");
+                }
+            } else{
+                title->SetTextId(textId);
             }
+
+            title->ForceResetText();
         }
     }
 }
\ No newline at end of file
index 0d5611b..a09397d 100644 (file)
@@ -13,7 +13,7 @@
 #include <UiConfig.h>
 #include <iostream>
 #include "string"
-
+#include "ConfigModel.h"
 namespace OHOS
 {
 
@@ -129,8 +129,19 @@ namespace OHOS
         //TOOD: 待优化
         if(labelconfig.textId == STR_DEEPSEEK) {
             label->SetText("DeepSeek");
-        } else
+        }else if(labelconfig.textId == STR_AIMODES_LINGXI) {
+            int language = ConfigModel::GetInstance()->GetLanguage();
+            if (language == 0) // 如果当前系统为中文
+            {
+                label->SetText("九天");
+            }
+            else
+            {
+                label->SetText("jiutian");
+            }
+        } else{
             label->SetTextId(labelconfig.textId);
+        }
         label->SetLineBreakMode(labelconfig.lineBreakMode);
         label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize);
@@ -353,15 +364,23 @@ namespace OHOS
     {
         if (title)
         {
-            if(textId == STR_DEEPSEEK) 
-            {
+            if(textId == STR_DEEPSEEK) {
                 title->SetText("DeepSeek");
-            } 
-            else 
-            {
-            title->SetTextId(textId);
-            title->ForceResetText();
+             }else if(textId == STR_AIMODES_LINGXI) {
+                int language = ConfigModel::GetInstance()->GetLanguage();
+                if (language == 0) // 如果当前系统为中文
+                {
+                    title->SetText("九天");
+                }
+                else
+                {
+                    title->SetText("jiutian");
+                }
+            } else{
+                title->SetTextId(textId);
             }
+
+            title->ForceResetText();
         }
     }
 
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_lingxi.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_lingxi.bin
new file mode 100644 (file)
index 0000000..0c4bb19
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:33763925d0358af3d2f1e4c6cb8fbf5c5c8190a918a5a86636a4dafbfaf86d80
+size 9624