From: xue <2144439972@qq.com> Date: Tue, 2 Dec 2025 06:02:09 +0000 (+0800) Subject: 删除哄睡多余组件 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=f9bc8716bd7d78de8389c155c331554c451d3bca;p=mirrors%2FFD230.git 删除哄睡多余组件 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h index ad243db14..9d021d63f 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h @@ -49,11 +49,9 @@ namespace OHOS private: UIViewGroup *group{nullptr}; UILabelExtWithShadow *TextLabel{nullptr}; - UILabelExt *TextLabel_Y{nullptr}; UILabelExt *RemindLabel{nullptr}; UIImageView *RemindIcon{nullptr}; UIImageView *RemindIcon2{nullptr}; - UIImageView *RemindGround3{nullptr}; // 保存VIEW_4的文本,用于从VIEW_5回退时恢复 std::string savedView4Text; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp index 2abdd733b..1513bbf48 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp @@ -104,10 +104,6 @@ namespace OHOS delete TextLabel; TextLabel = nullptr; } - if (TextLabel_Y != nullptr) { - delete TextLabel_Y; - TextLabel_Y = nullptr; - } if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; @@ -120,10 +116,6 @@ namespace OHOS delete RemindIcon2; RemindIcon2 = nullptr; } - if (RemindGround3 != nullptr) { - delete RemindGround3; - RemindGround3 = nullptr; - } if (listenAnimator != nullptr) { delete listenAnimator; listenAnimator = nullptr; @@ -181,14 +173,6 @@ namespace OHOS group->SetPosition(0, 0, 360, 360); // 公共控件 - TextLabel_Y = new UILabelExt(); - if (TextLabel_Y) - { - TextLabel_Y->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - TextLabel_Y->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - TextLabel_Y->SetVisible(false); - group->Add(TextLabel_Y); - } TextLabel = new UILabelExtWithShadow(); if (TextLabel) { @@ -222,14 +206,6 @@ namespace OHOS RemindIcon2->SetResizeMode(UIImageView::CONTAIN); group->Add(RemindIcon2); } - RemindGround3 = new UIImageView(); - if (RemindGround3) - { - RemindGround3->SetAutoEnable(false); - RemindGround3->SetVisible(false); - RemindGround3->SetResizeMode(UIImageView::CONTAIN); - group->Add(RemindGround3); - } if(!EnsureListenAnimator()) { return nullptr; @@ -252,11 +228,9 @@ namespace OHOS TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); TextLabel->SetShadowOffsetX(0); TextLabel->SetShadowOffsetY(0); } - if (TextLabel_Y) { TextLabel_Y->SetVisible(false); } if (RemindLabel) { RemindLabel->SetVisible(false);} if (RemindIcon) { RemindIcon->SetVisible(false); } if (RemindIcon2) { RemindIcon2->SetVisible(false); } - if (RemindGround3) { RemindGround3->SetVisible(false); } if (listenAnimator) { listenAnimator->SetVisible(false);listenAnimator->Start(); } switch (showView) @@ -310,19 +284,21 @@ namespace OHOS } case THUNDERBIRD_LULLABYVIEW_3: { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "进入故事模式,关闭VAD"); - int vad_ret = ln_ws_disable_vad_server(); - if (vad_ret == 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VAD已成功关闭"); - } else { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "关闭VAD失败: %d", vad_ret); - } listenAnimator->Stop(); // 重置哄睡录音标志位,确保进入界面时状态正确 if (ThunderBirdPresenter::GetInstance()) { ThunderBirdPresenter::GetInstance()->ResetLullabyRecording(); } - // ln_ws_start_audio_chat(LN_AUDIO_CHAT_CHOOSE_STORY_REQUEST); + // 重置询问标志位,确保进入界面时状态正确 + ThunderBirdModel::GetInstance()->m_lullabyView3InquiryStarted = false; + // 开启VAD + int vad_ret = ln_ws_enable_vad_server(); + if (vad_ret == 0) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "进入THUNDERBIRD_LULLABYVIEW_3: VAD已成功启用"); + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "进入THUNDERBIRD_LULLABYVIEW_3: 启用VAD失败: %d", vad_ret); + } + // 启动音频聊天 ThunderBirdMainView::GetInstance()->OpenBackGround(); if (TextLabel) { @@ -332,15 +308,6 @@ namespace OHOS TextLabel->SetRollSpeed(35); TextLabel->SetVisible(true); } - if(TextLabel_Y) - { - TextLabel_Y->SetPosition(90, 184, 180, 42); - TextLabel_Y->SetText("按 聆听"); - TextLabel_Y->SetStyle(STYLE_TEXT_COLOR, 0xffffffff); - TextLabel_Y->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); - TextLabel_Y->SetRollSpeed(35); - TextLabel_Y->SetVisible(true); - } if (listenAnimator) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdLullabyView::Show: 启动聆听动画"); @@ -366,12 +333,6 @@ namespace OHOS RemindIcon2->SetSrc("/user/res/volume_up.bin"); RemindIcon2->SetVisible(true); } - if (RemindGround3) - { - RemindGround3->SetPosition(145, 184, 36, 36); - RemindGround3->SetSrc("/user/res/voice.bin"); - RemindGround3->SetVisible(true); - } break; } case THUNDERBIRD_LULLABYVIEW_4: