Merge #2500 into sdk650pathc0423 from refs/changes/2500/head 2502/target/1 2503/target/1 2504/target/1
author罗正 <1732036298@qq.com>
Tue, 14 Oct 2025 04:46:48 +0000 (04:46 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Tue, 14 Oct 2025 04:46:48 +0000 (04:46 +0000)
Code review from 罗正

* refs/changes/2500/head: (4 commits squashed)

  - ln设备接口文档更新

  - Merge branch &#39;sdk650pathc0423&#39; of codeup.aliyun.com:64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - n9解决蓝牙ai不可用问题

  - 下拉界面添加切换样式按钮,fd230,272同步修改

Signed-off-by: 罗正 <1732036298@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/2500
15 files changed:
code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoiceView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/include/ThemeStyleView.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceView.cpp
code/sdk/zhihui/leiniao/imsl_ln/ln_api.c
code/sdk/zhihui/leiniao/imsl_ln/ln_api_token.c
code/sdk/zhihui/leiniao/设备API接口文档.md

index e80c804..b5e2123 100644 (file)
@@ -192,7 +192,7 @@ namespace OHOS
             else if (GetSelect4gorbt() == AI_SELECT_BT)
             {
 #ifdef SUPPORT_BLE_SERVICE
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "蓝牙:查询Ai是否就绪");
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "蓝牙:查询Ai是否就绪:%d",it->second.second);
                 inquire_AI_is_ready(it->second.second);
 #endif
             }
index c6a9110..d0bc2dc 100644 (file)
@@ -45,7 +45,6 @@ namespace OHOS
 #include <asm/delay.h>
 #include <aivoice/include/AiVoiceModelC.h>
 #include <los_base.h>
-        extern void set_need_tts_reconnect(uint8_t flag);
 
         void remove_4GAI_vote(void)
         {
@@ -98,7 +97,6 @@ namespace OHOS
     void AiVoicePresenter::OnStart()
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnStart");
-        Presenter<AiVoiceView>::OnStart();
         ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);
         // 开启一个60s取消长亮屏timer
         model->ai_start_screen60s_timer();
@@ -113,7 +111,6 @@ namespace OHOS
     void AiVoicePresenter::OnStop(void)
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnStop start");
-        Presenter<AiVoiceView>::OnStop();
         ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON);
         model->StatusResume();
         model->AIVoice_StopTimer();
@@ -130,9 +127,6 @@ namespace OHOS
         uapi_stop_all_websocket_servers();
         uapi_destroy_all_websocket_servers();
 #endif
-        
-        // dinit_ai_task();
-        // ai_cleanup_resources();
 
         uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_SLOW);
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnStop end");
@@ -341,7 +335,6 @@ namespace OHOS
             break;
 
         case AIVOICE_RETURN_RESULT_TEXT_VIEWID:
-            // set_need_tts_reconnect(0);                                 // 停止tts重连
             AiVoiceModel::GetInstance().ClearQuestionAndAiAnswerStr(); // 清空上次用户问题和Ai回答字符串
             AiVoiceModel::GetInstance().SetIsClickable(false);
             AiVoiceModel::GetInstance().SetIsLimitDisplayed(false);
@@ -365,10 +358,8 @@ namespace OHOS
             AiVoiceModel::GetInstance().start_ai_isready_timer();
             break;
         case AIVOICE_RETURN_RESULT_TEXT_VIEWID:
-            // set_need_tts_reconnect(1); // 开始tts重连
             break;
         case AIVOICE_LISTENING_VIEWID:
-            // set_stop_send_ai_flag(0); // 开始发送AI数据
             AiVoiceModel::GetInstance().StartListenAndRecordingUserQuestion();
             AiVoiceModel::GetInstance().start_listening_timer();
             break;
index 7f5ea7c..820f351 100644 (file)
@@ -487,7 +487,7 @@ namespace OHOS
             VolumeProcess->SetKnobStyle(StyleDefault::GetSliderKnobStyle());
             VolumeProcess->RequestFocus();
             VolumeProcess->SetRotateFactor(5.0);
-            // VolumeProcess->SetVisible(false);
+            VolumeProcess->SetVisible(false);
             VolumeProcess->SetOnRotateListener(presenter_);
             AddViewToRootContainer(VolumeProcess);
         }
@@ -498,7 +498,7 @@ namespace OHOS
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CreateAiVoiceView");
         if (!CreateAiVoiceScrollView() || !CreateAiVoiceViewImageView() || !CreateAiVoiceViewPicker() ||
-            !CreateAiVoiceViewLabel() || !CreateAiVoiceViewButton() || !CreateAiVoiceVoiceView())
+            !CreateAiVoiceViewLabel() || !CreateAiVoiceViewButton())
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CreateAiVoiceView fail!");
             return nullptr;
@@ -730,6 +730,13 @@ namespace OHOS
         {
             SendMsgToUIService(UI_UPDATE_USER_QUESTION_STR, 0, nullptr, 0);
         }
+        if(AiVoiceModel::GetInstance().GetSelect4gorbt() == AI_SELECT_4G)
+        {
+            if (VolumeProcess)
+            {
+                VolumeProcess->SetVisible(true);
+            }
+        }
         return true;
     }
 
@@ -1086,7 +1093,7 @@ namespace OHOS
 
     void AiVoiceView::ChangeView(int16_t hideView, int16_t showView)
     {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::ChangeView hideView:%d, showView:%d", hideView, showView);
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::ChangeView hideView:%d, showView:%d", hideView, showView);
         if (!CheckViewParam(hideView, showView))
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CheckViewParam failed.");
index d67569c..a003fc1 100644 (file)
@@ -38,10 +38,11 @@ namespace OHOS
         void ClearAll();
 
         UIToggleButton *GetDropDownCardPage2_ToggleButton(int index);
+        void SetApplistDisplay(void);
 
     private:
         UIToggleButton *ToggleButtonInit(ToggleButtonConfig &toggleButtonConfig);
-        UIToggleButton *toggleButton[2]{nullptr};
+        UIToggleButton *toggleButton[3]{nullptr};
     };
 
 }
index c14c51c..84d9e65 100644 (file)
 #include "string"
 #include "AppViewIDs.h"
 #include "NativeAbility.h"
+#include "themestyle/include/ThemeStyleModel.h"
 namespace OHOS
 {
     // viewId
-    static constexpr const char *DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID = "dropdown_bt"; // 查找手机
-    static constexpr const char *DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID = "dropdown_4g";  // 手电筒
+    static constexpr const char *DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID = "dropdown_bt";                    // 查找手机
+    static constexpr const char *DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID = "dropdown_4g";                     // 手电筒
+    static constexpr const char *DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID = "dropdown_applist_display"; // 列表样式
 
     // Image src
     static constexpr const char *DROPDOWN_FINDPHONE_IMAGE = "/user/res/dropdown/DROPDOWN_FINDPHONE.bin";
 
     static constexpr const char *DROPDOWN_LIGHTING_IMAGE = "/user/res/dropdown/DROPDOWN_LIGHTING.bin";
 
+    static constexpr const char *DROPDOWN_APPLIST_DISPLAY_IMAGE[] =
+        {
+            "/user/res/themestyle/arclist.bin",   // 弧形列表
+            "/user/res/themestyle/hexagons.bin",  // 蜂窝
+            "/user/res/themestyle/dialplate.bin", // 拨号盘
+            "/user/res/themestyle/grid.bin",      // 瀑布流
+    };
+
     static DropDownCardPage2 *g_pDropDownCardPage2{nullptr};
     DropDownCardPage2::DropDownCardPage2()
     {
@@ -42,11 +52,37 @@ namespace OHOS
         return g_pDropDownCardPage2;
     }
 
+    void DropDownCardPage2::SetApplistDisplay(void)
+    {
+        ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle();
+        if (style == ThemeStyle::ARC_SCALE_LIST_STYLE)
+        {
+            toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[1], DROPDOWN_APPLIST_DISPLAY_IMAGE[2]);// 切换到蜂窝
+            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::HEXAGONS_STYLE);
+        }
+        else if (style == ThemeStyle::HEXAGONS_STYLE)
+        {
+            toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[2], DROPDOWN_APPLIST_DISPLAY_IMAGE[3]); // 切换到拨号盘
+            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::CIRCLE_LIST_STYLE);
+        }
+        else if (style == ThemeStyle::CIRCLE_LIST_STYLE)
+        {
+            toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[3], DROPDOWN_APPLIST_DISPLAY_IMAGE[4]); // 切换到瀑布流
+            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::WATERFALL_STYLE);
+        }
+        else if (style == ThemeStyle::WATERFALL_STYLE)
+        {
+            toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[0], DROPDOWN_APPLIST_DISPLAY_IMAGE[0]); // 切换到列表
+            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::ARC_SCALE_LIST_STYLE);
+        }
+        
+        return;
+    }
     bool DropDownCardPage2::OnClick(UIView &view, const ClickEvent &event)
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DropDownCardPage2::OnClick");
         std::string viewId = view.GetViewId();
-        if (viewId == DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID) 
+        if (viewId == DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID)
         {
             NativeAbility::GetInstance().EnterSlice(VIEW_FIND_PHONE);
         }
@@ -54,6 +90,10 @@ namespace OHOS
         {
             NativeAbility::GetInstance().EnterSlice(VIEW_FLASHLIGHT);
         }
+        else if (viewId == DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID)
+        {
+            SetApplistDisplay();
+        }
         return true;
     }
 
@@ -80,8 +120,17 @@ namespace OHOS
         }
         toggleButton->SetPosition(toggleButtonConfig.left, toggleButtonConfig.top, toggleButtonConfig.width, toggleButtonConfig.height);
         toggleButton->SetViewId(toggleButtonConfig.viewId);
-        toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
-        toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200);
+        if (toggleButtonConfig.viewId == DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID)
+        {
+            toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+            toggleButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+            toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200);
+        }
+        else
+        {
+            toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+            toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200);
+        }
         toggleButton->SetImages(toggleButtonConfig.selectImg, toggleButtonConfig.unselectImg);
 
         toggleButton->SetTouchable(toggleButtonConfig.isTouchable);
@@ -92,9 +141,29 @@ namespace OHOS
     bool DropDownCardPage2::InitPage(void)
     {
         int size = sizeof(toggleButton) / sizeof(toggleButton[0]);
+        ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle();
+        int index = 0;
+        if (style == ThemeStyle::ARC_SCALE_LIST_STYLE) // 弧形列表
+        {
+            index = 0;
+        }
+        else if (style == ThemeStyle::HEXAGONS_STYLE) // 蜂窝
+        {
+            index = 1;
+        }
+        else if (style == ThemeStyle::CIRCLE_LIST_STYLE) // 拨号盘
+        {
+            index = 2;
+        }
+        else if (style == ThemeStyle::WATERFALL_STYLE) // 瀑布流
+        {
+            index = 3;
+        }
+        
         ToggleButtonConfig toggleButtonConfig[] = {
             {0, 0, 100, 100, DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID, DROPDOWN_FINDPHONE_IMAGE, DROPDOWN_FINDPHONE_IMAGE, true},
             {110, 0, 100, 100, DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID, DROPDOWN_LIGHTING_IMAGE, DROPDOWN_LIGHTING_IMAGE, true},
+            {220, 0, 100, 100, DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID, DROPDOWN_APPLIST_DISPLAY_IMAGE[index], DROPDOWN_APPLIST_DISPLAY_IMAGE[index], true},
         };
 
         for (int i = 0; i < size; i++)
index 4269506..148a983 100644 (file)
@@ -338,9 +338,27 @@ namespace OHOS
     // 更新按钮的选中状态
     void ThemeStyleView::UpdateSelectedStyle(void)
     {
+        ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle();
+        int index = 0;
+        if (style == ThemeStyle::ARC_SCALE_LIST_STYLE)
+        {
+            index = 0;
+        }
+        else if (style == ThemeStyle::HEXAGONS_STYLE)
+        {
+            index = 1;
+        }
+        else if (style == ThemeStyle::CIRCLE_LIST_STYLE)
+        {
+            index = 2;
+        }
+        else if (style == ThemeStyle::WATERFALL_STYLE)
+        {
+            index = 3;
+        }
         for (int i = 0; i < MAX_STYLE; i++)
         {
-            if (i == presenter_->GetSelectThemeStyleId())
+            if (i == index)
             {
                 ThemeStyleLabelButton[i]->SetImageSrc(PNG_CHECKBOX_ON_IMAGE, PNG_CHECKBOX_ON_IMAGE);
             }
index d67569c..a003fc1 100644 (file)
@@ -38,10 +38,11 @@ namespace OHOS
         void ClearAll();
 
         UIToggleButton *GetDropDownCardPage2_ToggleButton(int index);
+        void SetApplistDisplay(void);
 
     private:
         UIToggleButton *ToggleButtonInit(ToggleButtonConfig &toggleButtonConfig);
-        UIToggleButton *toggleButton[2]{nullptr};
+        UIToggleButton *toggleButton[3]{nullptr};
     };
 
 }
index c14c51c..c8db8de 100644 (file)
 #include "string"
 #include "AppViewIDs.h"
 #include "NativeAbility.h"
+#include "themestyle/include/ThemeStyleModel.h"
 namespace OHOS
 {
     // viewId
-    static constexpr const char *DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID = "dropdown_bt"; // 查找手机
-    static constexpr const char *DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID = "dropdown_4g";  // 手电筒
+    static constexpr const char *DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID = "dropdown_bt";                    // 查找手机
+    static constexpr const char *DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID = "dropdown_4g";                     // 手电筒
+    static constexpr const char *DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID = "dropdown_applist_display"; // 列表样式
 
     // Image src
     static constexpr const char *DROPDOWN_FINDPHONE_IMAGE = "/user/res/dropdown/DROPDOWN_FINDPHONE.bin";
 
     static constexpr const char *DROPDOWN_LIGHTING_IMAGE = "/user/res/dropdown/DROPDOWN_LIGHTING.bin";
 
+    static constexpr const char *DROPDOWN_APPLIST_DISPLAY_IMAGE[] =
+        {
+            "/user/res/themestyle/list.bin",      // 列表
+            "/user/res/themestyle/arclist.bin",   // 弧形列表
+            "/user/res/themestyle/hexagons.bin",  // 蜂窝
+            "/user/res/themestyle/dialplate.bin", // 拨号盘
+            "/user/res/themestyle/grid.bin",      // 瀑布流
+    };
+
     static DropDownCardPage2 *g_pDropDownCardPage2{nullptr};
     DropDownCardPage2::DropDownCardPage2()
     {
@@ -42,11 +53,42 @@ namespace OHOS
         return g_pDropDownCardPage2;
     }
 
+    void DropDownCardPage2::SetApplistDisplay(void)
+    {
+        ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle();
+        if (style == ThemeStyle::APPLIST_STYLE)
+        {
+            toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[1], DROPDOWN_APPLIST_DISPLAY_IMAGE[1]); // 切换到弧形列表
+            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::ARC_SCALE_LIST_STYLE);
+        }
+        else if (style == ThemeStyle::ARC_SCALE_LIST_STYLE)
+        {
+            toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[2], DROPDOWN_APPLIST_DISPLAY_IMAGE[2]);// 切换到蜂窝
+            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::HEXAGONS_STYLE);
+        }
+        else if (style == ThemeStyle::HEXAGONS_STYLE)
+        {
+            toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[3], DROPDOWN_APPLIST_DISPLAY_IMAGE[3]); // 切换到拨号盘
+            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::CIRCLE_LIST_STYLE);
+        }
+        else if (style == ThemeStyle::CIRCLE_LIST_STYLE)
+        {
+            toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[4], DROPDOWN_APPLIST_DISPLAY_IMAGE[4]); // 切换到瀑布流
+            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::WATERFALL_STYLE);
+        }
+        else if (style == ThemeStyle::WATERFALL_STYLE)
+        {
+            toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[0], DROPDOWN_APPLIST_DISPLAY_IMAGE[0]); // 切换到列表
+            ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::APPLIST_STYLE);
+        }
+        
+        return;
+    }
     bool DropDownCardPage2::OnClick(UIView &view, const ClickEvent &event)
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DropDownCardPage2::OnClick");
         std::string viewId = view.GetViewId();
-        if (viewId == DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID) 
+        if (viewId == DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID)
         {
             NativeAbility::GetInstance().EnterSlice(VIEW_FIND_PHONE);
         }
@@ -54,6 +96,10 @@ namespace OHOS
         {
             NativeAbility::GetInstance().EnterSlice(VIEW_FLASHLIGHT);
         }
+        else if (viewId == DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID)
+        {
+            SetApplistDisplay();
+        }
         return true;
     }
 
@@ -80,8 +126,17 @@ namespace OHOS
         }
         toggleButton->SetPosition(toggleButtonConfig.left, toggleButtonConfig.top, toggleButtonConfig.width, toggleButtonConfig.height);
         toggleButton->SetViewId(toggleButtonConfig.viewId);
-        toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
-        toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200);
+        if (toggleButtonConfig.viewId == DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID)
+        {
+            toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+            toggleButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+            toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200);
+        }
+        else
+        {
+            toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+            toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200);
+        }
         toggleButton->SetImages(toggleButtonConfig.selectImg, toggleButtonConfig.unselectImg);
 
         toggleButton->SetTouchable(toggleButtonConfig.isTouchable);
@@ -92,9 +147,33 @@ namespace OHOS
     bool DropDownCardPage2::InitPage(void)
     {
         int size = sizeof(toggleButton) / sizeof(toggleButton[0]);
+        ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle();
+        int index = 0;
+        if (style == ThemeStyle::APPLIST_STYLE) // 列表
+        {
+            index = 0;
+        }
+        else if (style == ThemeStyle::ARC_SCALE_LIST_STYLE) // 弧形列表
+        {
+            index = 1;
+        }
+        else if (style == ThemeStyle::HEXAGONS_STYLE) // 蜂窝
+        {
+            index = 2;
+        }
+        else if (style == ThemeStyle::CIRCLE_LIST_STYLE) // 拨号盘
+        {
+            index = 3;
+        }
+        else if (style == ThemeStyle::WATERFALL_STYLE) // 瀑布流
+        {
+            index = 4;
+        }
+        
         ToggleButtonConfig toggleButtonConfig[] = {
             {0, 0, 100, 100, DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID, DROPDOWN_FINDPHONE_IMAGE, DROPDOWN_FINDPHONE_IMAGE, true},
             {110, 0, 100, 100, DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID, DROPDOWN_LIGHTING_IMAGE, DROPDOWN_LIGHTING_IMAGE, true},
+            {220, 0, 100, 100, DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID, DROPDOWN_APPLIST_DISPLAY_IMAGE[index], DROPDOWN_APPLIST_DISPLAY_IMAGE[index], true},
         };
 
         for (int i = 0; i < size; i++)
index a400b03..afac791 100644 (file)
@@ -24,7 +24,7 @@
 
 namespace OHOS
 {
-    static constexpr const uint16_t MAX_STYLE = MAX_THEME_STYLE - 2; //直线列表和足球不显示所以删除了两个
+    static constexpr const uint16_t MAX_STYLE = MAX_THEME_STYLE - 1; //直线列表和足球不显示所以删除了两个
     static constexpr char *THEME_STYLE_LIST     = "themestyleList";       // 列表
     static constexpr char *THEME_STYLE_HEXAGONS = "themestyleHexagons";   // 蜂窝
     static constexpr char *THEME_STYLE_FOOTBALL = "themestyleFootball";   // 足球
index 4269506..49a0c07 100644 (file)
@@ -182,7 +182,7 @@ namespace OHOS
         scrollView->Add(titleText);
         /* -------------------------------------------------------------------------- */
         // int16_t textId[] = {STR_LIST_DISPLAY, STR_CELLULAR_DISPLAY, STR_ARC_SCALE_LIST_DISPLAY,STR_DIAL_PLATE};
-        int16_t textId[] = {STR_ARC_SCALE_LIST_DISPLAY, STR_CELLULAR_DISPLAY,STR_DIAL_PLATE,STR_WATERFALL_DISPLAY};
+        int16_t textId[] = {STR_LIST_DISPLAY,STR_ARC_SCALE_LIST_DISPLAY, STR_CELLULAR_DISPLAY,STR_DIAL_PLATE,STR_WATERFALL_DISPLAY};
         LabelConfig labelConfig = {
             .left = 143,
             .top = 153,
@@ -235,7 +235,7 @@ namespace OHOS
         };
 
         // const char *viewId[] = {THEME_STYLE_LIST, THEME_STYLE_HEXAGONS, THEME_STYLE_ARC_LIST,THEME_STYLE_CIRCLE_LIST};
-        const char *viewId[] = {THEME_STYLE_ARC_LIST, THEME_STYLE_HEXAGONS,THEME_STYLE_CIRCLE_LIST,THEME_STYLE_WATERFALL};
+        const char *viewId[] = {THEME_STYLE_LIST,THEME_STYLE_ARC_LIST, THEME_STYLE_HEXAGONS,THEME_STYLE_CIRCLE_LIST,THEME_STYLE_WATERFALL};
         for (int i = 0; i < sizeof(viewId) / sizeof(viewId[0]); i++)
         {
             labelbuttonconfig.top = 120 + 120 * i;
@@ -277,7 +277,7 @@ namespace OHOS
         };
         int y = 150;
         // const char *src[MAX_STYLE] = {THEMESTYLE_LIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH, THEMESTYLE_ARCLIST_IMAGEPATH,THEMESTYLE_CIRCLELIST_IMAGEPATH};
-        const char *src[] = {THEMESTYLE_ARCLIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH,THEMESTYLE_CIRCLELIST_IMAGEPATH,THEMESTYLE_WATERFALL_IMAGEPATH};
+        const char *src[] = {THEMESTYLE_LIST_IMAGEPATH,THEMESTYLE_ARCLIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH,THEMESTYLE_CIRCLELIST_IMAGEPATH,THEMESTYLE_WATERFALL_IMAGEPATH};
         for (int i = 0; i < sizeof(src) / sizeof(src[0]); i++)
         {
             imageconfig.y = y + 120 * i;
@@ -338,9 +338,31 @@ namespace OHOS
     // 更新按钮的选中状态
     void ThemeStyleView::UpdateSelectedStyle(void)
     {
+        ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle();
+        int index = 0;
+        if (style == ThemeStyle::APPLIST_STYLE)
+        {
+            index = 0;
+        }
+        else if (style == ThemeStyle::ARC_SCALE_LIST_STYLE)
+        {
+            index = 1;
+        }
+        else if (style == ThemeStyle::HEXAGONS_STYLE)
+        {
+            index = 2;
+        }
+        else if (style == ThemeStyle::CIRCLE_LIST_STYLE)
+        {
+            index = 3;
+        }
+        else if (style == ThemeStyle::WATERFALL_STYLE)
+        {
+            index = 4;
+        }
         for (int i = 0; i < MAX_STYLE; i++)
         {
-            if (i == presenter_->GetSelectThemeStyleId())
+            if (i == index)
             {
                 ThemeStyleLabelButton[i]->SetImageSrc(PNG_CHECKBOX_ON_IMAGE, PNG_CHECKBOX_ON_IMAGE);
             }
index 8931f30..cdfc8d7 100644 (file)
@@ -867,7 +867,6 @@ namespace OHOS
             }
             else if (AiVoiceModel::AI_RESPONSE_END) // 如果是AI 回应结束
             {
-                return;
                 if (errnote.empty()) // 如果没有回应数据
                 {
                     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::GetErrnote is empty!!");
@@ -884,7 +883,7 @@ namespace OHOS
                     if (!OHOS::AiVoiceModel::GetInstance().GetIsLimitDisplayed()) // 如果ai答案没有显示到极限了,就更新ai答案字符串
                     {
                         aiAnswerStr += str;
-                        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "接受字的符串:%s", aiAnswerStr.c_str());
+                        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "接受字的符串:%s", aiAnswerStr.c_str());
                         SendMsgToUIService(UI_UPDATE_AI_ANSWER_STR, 0, nullptr, 0);
                     }
                 }
index 85a668a..a0a8fd7 100644 (file)
@@ -1,10 +1,10 @@
 /*
- * @Author: luozheng 1732036298@qq.com
- * @Date: 2024-05-07 11:25:58
- * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2025-03-06 16:07:08
- * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp
- */
+* @Author: luozheng 1732036298@qq.com
+* @Date: 2024-05-07 11:25:58
+* @LastEditors: luozheng 1732036298@qq.com
+* @LastEditTime: 2025-03-06 16:07:08
+* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp
+*/
 #include "aivoice/include/AiVoicePresenter.h"
 #include "aivoice/include/AiVoiceView.h"
 #include "aivoice/include/AiVoiceModel.h"
@@ -487,7 +487,7 @@ namespace OHOS
             VolumeProcess->SetKnobStyle(StyleDefault::GetSliderKnobStyle());
             VolumeProcess->RequestFocus();
             VolumeProcess->SetRotateFactor(5.0);
-            // VolumeProcess->SetVisible(false);
+            VolumeProcess->SetVisible(false);
             VolumeProcess->SetOnRotateListener(presenter_);
             AddViewToRootContainer(VolumeProcess);
         }
@@ -498,7 +498,7 @@ namespace OHOS
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CreateAiVoiceView");
         if (!CreateAiVoiceScrollView() || !CreateAiVoiceViewImageView() || !CreateAiVoiceViewPicker() ||
-            !CreateAiVoiceViewLabel() || !CreateAiVoiceViewButton() || !CreateAiVoiceVoiceView())
+            !CreateAiVoiceViewLabel() || !CreateAiVoiceViewButton())
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CreateAiVoiceView fail!");
             return nullptr;
@@ -730,6 +730,13 @@ namespace OHOS
         {
             SendMsgToUIService(UI_UPDATE_USER_QUESTION_STR, 0, nullptr, 0);
         }
+        if(AiVoiceModel::GetInstance().GetSelect4gorbt() == AI_SELECT_4G)
+        {
+            if (VolumeProcess)
+            {
+                VolumeProcess->SetVisible(true);
+            }
+        }
         return true;
     }
 
index 200e5ea..4de93ce 100644 (file)
@@ -288,6 +288,16 @@ char *uapi_ln_get_device_token(void)
         else
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[TOKEN] 刷新 Token 失败");
+            websocket_retry_connect_count++;
+            if (websocket_retry_connect_count >= 100)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[TOKEN] 网络离线,无法刷新 Token,重试次数超过10次,进入休眠");
+                ln_ws_enter_sleep();
+            }
+            else
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[TOKEN] 网络离线,无法刷新 Token,重试次数: %d", websocket_retry_connect_count);
+            }
             return NULL;
         }
     }
index 6bc2d56..fcdf234 100644 (file)
@@ -230,7 +230,7 @@ uint32_t ln_get_device_token_http(const char *device_id,
 {
     if (device_id == NULL || device_iccid == NULL)
     {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ln_get_device_token_http: invalid parameters");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ln_get_device_token_http: invalid parameters,device_id=%s,device_iccid=%s", device_id, device_iccid);
         return ERRCODE_FAIL;
     }
 
index 60418e0..105ea09 100644 (file)
@@ -1595,8 +1595,8 @@ WebSocket连接需要设备Token认证,有以下两种方式传递Token:
     "data": {\r
       "textContent": "你好,我听到了你的话",\r
       "audioUrl": "https://example.com/response_audio.mp3",\r
-      "intention": null,\r
-      "npcEmotion": null\r
+      "intention": "None",\r
+      "npcEmotion": "Winking"\r
     }\r
   }\r
 }\r
@@ -1608,7 +1608,8 @@ WebSocket连接需要设备Token认证,有以下两种方式传递Token:
 |--------|------|------|\r
 | textContent | String | 回复的文本内容 |\r
 | audioUrl | String | 回复音频文件URL |\r
-| intention | String | 用户意图识别结果,如"StartSleepMode"等 |\r
+| audioDuration | Integer | 回复音频时长,单位:毫秒 |\r
+| intention | String | 用户意图识别结果,如"None","StartSleepMode"等 |\r
 | npcEmotion | String | NPC情感状态,如"happy"等 |\r
 \r
 \r