From 8f66651e139c93ca3fa99b2e0dcf80a50e6e30af Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Mon, 28 Jul 2025 10:03:37 +0800 Subject: [PATCH] =?utf8?q?4GAI=E8=81=86=E5=90=AC=E4=B8=AD=E7=95=8C?= =?utf8?q?=E9=9D=A2=E5=88=87=E6=8D=A2=E5=88=B0=E6=80=9D=E8=80=83=E4=B8=AD?= =?utf8?q?=E7=95=8C=E9=9D=A2=E9=87=87=E7=94=A8post?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../aivoice/include/AiVoicePresenter.h | 1 + .../nativeui/aivoice/src/AiVoicePresenter.cpp | 18 +++++++++++++++--- .../aivoice/src/AivoiceListeningView.cpp | 2 +- .../aivoice/src/AivoiceThinkingView.cpp | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h index 2967eb596..3fa293988 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h @@ -58,6 +58,7 @@ namespace OHOS void DragLeftToRightChangeAIModel(void); void DragRightToLetfChangeAIModel(void); void ChangeVolume(UIView &view, const RotateEvent &event); + void JumpThinkingView(void); private: bool OnClick(UIView &view, const ClickEvent &event) override; diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp index be9d5d28e..5dd8f20be 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -25,6 +25,7 @@ #include "bleService.h" #include "player/include/PlayersModel.h" #include "aivoice/include/AiVoiceSelectView.h" +#include "graphic_service.h" #include "cat1_ws.h" #include @@ -371,6 +372,16 @@ namespace OHOS return true; } + void AiVoicePresenter::JumpThinkingView(void) + { + if ((view_->GetAiVoiceScrollView(AIVOICE_LISTENING_VIEWID) != nullptr) && + (view_->GetAiVoiceScrollView(AIVOICE_LISTENING_VIEWID)->IsVisible())) + { + ChangeViewAndLogicOperator(AIVOICE_LISTENING_VIEWID, AIVOICE_THINKING_VIEWID); + } + return; + } + // 处理手点击屏幕切换AI模型 bool AiVoicePresenter::OnClick(UIView &view, const ClickEvent &event) { @@ -568,11 +579,12 @@ namespace OHOS if (model->GetSelect4gorbt() == AI_SELECT_4G) { uapi_UI_stop_asr(); - usleep(10000); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FINISH_SPEAKING_BUTTON_VIEW_ID:(%d,%d)",model->is_need_to_jump_result_view(),model->getentryTextViewState()); + // usleep(10000); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FINISH_SPEAKING_BUTTON_VIEW_ID:(%d,%d)", model->is_need_to_jump_result_view(), model->getentryTextViewState()); if (!model->is_need_to_jump_result_view() && !model->getentryTextViewState()) // 没有数据就跳转到思考中界面 { - ChangeViewAndLogicOperator(AIVOICE_LISTENING_VIEWID, AIVOICE_THINKING_VIEWID); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::AiVoicePresenter::JumpThinkingView, OHOS::AiVoicePresenter::GetInstance())); } } else if (model->GetSelect4gorbt() == AI_SELECT_BT) diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceListeningView.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceListeningView.cpp index f2d288ec9..0e9186d2c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceListeningView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceListeningView.cpp @@ -109,7 +109,7 @@ namespace OHOS button->SetViewId(buttonconfig.ViewId); button->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); button->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff383838, UIButton::PRESSED); + button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED); return button; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceThinkingView.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceThinkingView.cpp index f77f124de..a9c6021c3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceThinkingView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceThinkingView.cpp @@ -104,7 +104,7 @@ namespace OHOS button->SetViewId(buttonconfig.ViewId); button->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); button->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff383838, UIButton::PRESSED); + button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED); return button; } -- 2.17.1