From: xue <2144439972@qq.com> Date: Tue, 4 Nov 2025 07:41:36 +0000 (+0800) Subject: 优化哄睡模式 X-Git-Tag: V1.0.9_20251128_194606_LN~116 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=16be1df8cf3c3d9dedacf209a3925c284f169237;p=mirrors%2FFD230.git 优化哄睡模式 --- 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 27ef0c90e..b32f14d08 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 @@ -120,6 +120,10 @@ namespace OHOS delete RemindIcon2; RemindIcon2 = nullptr; } + if (RemindGround3 != nullptr) { + delete RemindGround3; + RemindGround3 = nullptr; + } if (listenAnimator != nullptr) { delete listenAnimator; listenAnimator = nullptr; @@ -219,6 +223,14 @@ 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; @@ -237,10 +249,12 @@ namespace OHOS if (RemindLabel) { RemindLabel->SetVisible(false);} if (RemindIcon) { RemindIcon->SetVisible(false); } if (RemindIcon2) { RemindIcon2->SetVisible(false); } - if (listenAnimator) { listenAnimator->SetVisible(false); listenAnimator->Stop(); } + if (RemindGround3) { RemindGround3->SetVisible(false); } + if (listenAnimator) { listenAnimator->SetVisible(false);listenAnimator->Start(); } switch (showView) { + listenAnimator->Stop(); case THUNDERBIRD_LULLABYVIEW_1: { if (TextLabel) @@ -275,7 +289,7 @@ namespace OHOS if (RemindLabel) { RemindLabel->SetPosition(80, 275, 200, 25); - RemindLabel->SetText("按 退出 按 确认"); + RemindLabel->SetText("按 取消 按 确认"); RemindLabel->SetVisible(true); } if (RemindIcon) @@ -298,14 +312,24 @@ namespace OHOS ThunderBirdMainView::GetInstance()->OpenBackGround(); if (TextLabel) { - TextLabel->SetPosition(82, 148, 240, 42); + TextLabel->SetPosition(82, 124, 240, 42); TextLabel->SetText("告诉我想听的故事"); TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); 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: 启动聆听动画"); + listenAnimator->SetVisible(true); } else { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdLullabyView::Show: listenAnimator is null"); @@ -313,7 +337,7 @@ namespace OHOS if (RemindLabel) { RemindLabel->SetPosition(80, 275, 200, 25); - RemindLabel->SetText("按 退出 按 随机"); + RemindLabel->SetText("按 取消 按 随机"); RemindLabel->SetVisible(true); } if (RemindIcon) @@ -328,7 +352,12 @@ 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: @@ -399,7 +428,7 @@ namespace OHOS if (RemindLabel) { RemindLabel->SetPosition(80, 275, 200, 25); - RemindLabel->SetText("按 退出 按 确认"); + RemindLabel->SetText("按 取消 按 确认"); RemindLabel->SetVisible(true); } if (RemindIcon) @@ -451,18 +480,9 @@ namespace OHOS } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdLullabyView::UpdateLullabyText: 更新故事文字: %s", text ? text : "null"); - - // 先停止滚动,确保同步 - TextLabel->SetAnimState(Animator::STOP); - TextLabel_Y->SetAnimState(Animator::STOP); - // 设置文本 TextLabel->SetText(text); TextLabel_Y->SetText(text); - - // 同时开始滚动,确保同步 - TextLabel->SetAnimState(Animator::START); - TextLabel_Y->SetAnimState(Animator::START); } }