4GAI切换界面优化 2008/target/2 2009/1 2009/head
authorluozheng <1732036298@qq.com>
Thu, 24 Jul 2025 11:01:28 +0000 (19:01 +0800)
committerluozheng <1732036298@qq.com>
Thu, 24 Jul 2025 11:01:28 +0000 (19:01 +0800)
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp

index da611ab..ee4c8c4 100644 (file)
@@ -533,7 +533,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "传入的问题为空");
                 return;
             }
-            userQuestionStr = str;
+            userQuestionStr += str;
             if (!entryTextViewState)
             {
                 SendMsgToUIService(UI_AI_JUMP_TO_RESULT_VIEW, 0, nullptr, 0);
@@ -997,6 +997,7 @@ namespace OHOS
             }
             else if (AiVoiceModel::GetInstance().GetSelect4gorbt() == AI_SELECT_4G)
             {
+                LOS_Msleep(20);
                 startAudioCaptureTask();
             }
 #else
index bbde5aa..7bb3fcf 100644 (file)
@@ -147,7 +147,17 @@ namespace OHOS
         {
             preHeight = 0;
             if (model->GetCurView() == AIVOICE_LISTENING_VIEWID || model->GetCurView() == AIVOICE_THINKING_VIEWID)
-                ChangeViewAndLogicOperator(model->GetCurView(), AIVOICE_RETURN_RESULT_TEXT_VIEWID);
+            {
+                if (view_->GetAiVoiceScrollView(AIVOICE_LISTENING_VIEWID) || view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID))
+                {
+                    ChangeViewAndLogicOperator(model->GetCurView(), AIVOICE_RETURN_RESULT_TEXT_VIEWID);
+                }
+                else
+                {
+                    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::JumpToReturnResultTextView fail");
+                    return false;
+                }
+            }
         }
         else if (model->GetSelect4gorbt() == AI_SELECT_BT)
         {
@@ -557,8 +567,8 @@ namespace OHOS
             if (model->GetSelect4gorbt() == AI_SELECT_4G)
             {
                 uapi_UI_stop_asr();
-                usleep(10000); 
-                if (!model->is_need_to_jump_result_view()) //没有数据就跳转到思考中界面
+                usleep(10000);
+                if (!model->is_need_to_jump_result_view()) // 没有数据就跳转到思考中界面
                 {
                     ChangeViewAndLogicOperator(AIVOICE_LISTENING_VIEWID, AIVOICE_THINKING_VIEWID);
                 }
index c148744..b48036d 100644 (file)
@@ -1121,7 +1121,7 @@ namespace OHOS
 
     void AiVoiceView::ChangeView(int16_t hideView, int16_t showView)
     {
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::ChangeView");
+        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.");