From: luozheng <1732036298@qq.com> Date: Mon, 28 Jul 2025 02:03:37 +0000 (+0800) Subject: 4GAI聆听中界面切换到思考中界面采用post X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F2012%2F1;p=mirrors%2FFD230.git 4GAI聆听中界面切换到思考中界面采用post --- 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; }