From 38c155a40149a4cdf686d7faf4447bcc52c1ee4c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Tue, 14 Oct 2025 04:46:48 +0000 Subject: [PATCH] Merge #2500 into sdk650pathc0423 from refs/changes/2500/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/2500/head: (4 commits squashed) - ln设备接口文档更新 - Merge branch 'sdk650pathc0423' of codeup.aliyun.com:64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423 - n9解决蓝牙ai不可用问题 - 下拉界面添加切换样式按钮,fd230,272同步修改 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/2500 --- .../nativeui/aivoice/src/AiVoiceModel.cpp | 2 +- .../nativeui/aivoice/src/AiVoicePresenter.cpp | 9 -- .../nativeui/aivoice/src/AiVoiceView.cpp | 13 ++- .../main/include/dropdown/DropDownCardPage2.h | 3 +- .../main/src/dropdown/DropDownCardPage2.cpp | 79 ++++++++++++++-- .../themestyle/src/ThemeStyleView.cpp | 20 ++++- .../main/include/dropdown/DropDownCardPage2.h | 3 +- .../main/src/dropdown/DropDownCardPage2.cpp | 89 +++++++++++++++++-- .../themestyle/include/ThemeStyleView.h | 2 +- .../themestyle/src/ThemeStyleView.cpp | 30 ++++++- .../nativeui/aivoice/src/AiVoiceModel.cpp | 3 +- .../nativeui/aivoice/src/AiVoiceView.cpp | 23 +++-- code/sdk/zhihui/leiniao/imsl_ln/ln_api.c | 10 +++ .../sdk/zhihui/leiniao/imsl_ln/ln_api_token.c | 2 +- ...45\345\217\243\346\226\207\346\241\243.md" | 7 +- 15 files changed, 250 insertions(+), 45 deletions(-) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp index e80c80418..b5e2123b8 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp @@ -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 } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp index c6a9110d2..d0bc2dcd9 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -45,7 +45,6 @@ namespace OHOS #include #include #include - 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::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::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; diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoiceView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoiceView.cpp index 7f5ea7c1a..820f3510e 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoiceView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoiceView.cpp @@ -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."); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h index d67569cf8..a003fc146 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h @@ -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}; }; } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp index c14c51cc4..84d9e6577 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp @@ -11,17 +11,27 @@ #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++) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp index 42695067f..148a98300 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp @@ -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); } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h index d67569cf8..a003fc146 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h @@ -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}; }; } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp index c14c51cc4..c8db8dec5 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp @@ -11,17 +11,28 @@ #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++) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/include/ThemeStyleView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/include/ThemeStyleView.h index a400b0360..afac7918a 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/include/ThemeStyleView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/include/ThemeStyleView.h @@ -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"; // 足球 diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp index 42695067f..49a0c0770 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp @@ -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); } diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp index 8931f3018..cdfc8d787 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp @@ -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); } } diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceView.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceView.cpp index 85a668a05..a0a8fd7b0 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceView.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceView.cpp @@ -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; } diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c index 200e5ea2b..4de93ce6a 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c @@ -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; } } diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_token.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_token.c index 6bc2d56af..fcdf2341a 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_token.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_token.c @@ -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; } diff --git "a/code/sdk/zhihui/leiniao/\350\256\276\345\244\207API\346\216\245\345\217\243\346\226\207\346\241\243.md" "b/code/sdk/zhihui/leiniao/\350\256\276\345\244\207API\346\216\245\345\217\243\346\226\207\346\241\243.md" index 60418e086..105ea0935 100644 --- "a/code/sdk/zhihui/leiniao/\350\256\276\345\244\207API\346\216\245\345\217\243\346\226\207\346\241\243.md" +++ "b/code/sdk/zhihui/leiniao/\350\256\276\345\244\207API\346\216\245\345\217\243\346\226\207\346\241\243.md" @@ -1595,8 +1595,8 @@ WebSocket连接需要设备Token认证,有以下两种方式传递Token: "data": { "textContent": "你好,我听到了你的话", "audioUrl": "https://example.com/response_audio.mp3", - "intention": null, - "npcEmotion": null + "intention": "None", + "npcEmotion": "Winking" } } } @@ -1608,7 +1608,8 @@ WebSocket连接需要设备Token认证,有以下两种方式传递Token: |--------|------|------| | textContent | String | 回复的文本内容 | | audioUrl | String | 回复音频文件URL | -| intention | String | 用户意图识别结果,如"StartSleepMode"等 | +| audioDuration | Integer | 回复音频时长,单位:毫秒 | +| intention | String | 用户意图识别结果,如"None","StartSleepMode"等 | | npcEmotion | String | NPC情感状态,如"happy"等 | -- 2.17.1