From 59c61a7ebbefee87ec7b7178b271a05e46a34e23 Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Tue, 30 Sep 2025 10:22:23 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E6=95=85=E4=BA=8B=E6=96=87?= =?utf8?q?=E6=9C=AC=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../thunderbird/include/ThunderBirdLullabyView.h | 3 ++- .../thunderbird/src/ThunderBirdLullabyView.cpp | 9 +++------ .../nativeui/thunderbird/src/ThunderBirdModel.cpp | 4 +++- .../nativeui/thunderbird/src/ThunderBirdPresenter.cpp | 10 +++++++++- 4 files changed, 17 insertions(+), 9 deletions(-) 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 fba9674f7..98bd2d24a 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 @@ -41,6 +41,7 @@ namespace OHOS UIImageAnimatorView *listenAnimator{nullptr}; ImageAnimatorInfo listenImageInfo[TB_LISTEN_FRAMES]; const char **listenPathsArray{nullptr}; + void UpdateLullabyText(const char *text); private: UIViewGroup *group{nullptr}; @@ -49,7 +50,7 @@ namespace OHOS UILabelExt *RemindLabel{nullptr}; UIImageView *RemindIcon{nullptr}; UIImageView *RemindIcon2{nullptr}; - void UpdateLullabyText(const char *text); + }; } 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 b30a8cf90..fe4d93bd3 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 @@ -4,6 +4,7 @@ #include #include #include "UiConfig.h" +#include "custom_utils.h" namespace OHOS { @@ -356,6 +357,8 @@ namespace OHOS { ThunderBirdModel::GetInstance()->LowFrequence();//减低视频帧率 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdLullabyView::Show: THUNDERBIRD_LULLABYVIEW_4"); + //长亮屏 + ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); //ThunderBirdModel::GetInstance()->StartCountUpTimer(15 * 60); if (TextLabel) { @@ -374,12 +377,6 @@ namespace OHOS TextLabel_Y->SetVisible(true); } ThunderBirdLullabyView::UpdateLullabyText(ThunderBirdModel::GetInstance()->GetTextStr().c_str()); - if(RemindLabel) - { - RemindLabel->SetPosition(115, 114, 131, 28); - RemindLabel->SetText("04:00/15:00"); - RemindLabel->SetVisible(true); - } break; } case THUNDERBIRD_LULLABYVIEW_5: diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index e49d60ad3..75f8808aa 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -719,6 +719,8 @@ } if(ThunderBirdDialogueView::GetInstance()) ThunderBirdDialogueView::GetInstance()->UpdateDialogueText(m_currentTimeStr.c_str()); + if(ThunderBirdLullabyView::GetInstance()) + ThunderBirdLullabyView::GetInstance()->UpdateLullabyText(m_currentTimeStr.c_str()); //清除录音内容 ClearTextStr(); @@ -1654,7 +1656,7 @@ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleSleepModeStart"); if (ThunderBirdMainView::GetInstance()) { int currentView = ThunderBirdMainView::GetInstance()->GetCurrentView(); //获取当前视图 - ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_2); + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4); } else { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView instance is null, cannot start sleep mode"); } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp index 017bdf802..da66b717e 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp @@ -373,6 +373,11 @@ namespace OHOS return; } } + else if(currentView == THUNDERBIRD_LULLABYVIEW && + currentSubView == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4) + { + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_5); + } } /** @@ -503,7 +508,6 @@ namespace OHOS ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_3); break; case ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_3: - //do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_STORY_RANDOM, NULL, 0);//随机故事 ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4); break; case ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4: @@ -521,8 +525,12 @@ namespace OHOS case ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_3: ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4); break; + case ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_5: + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4); + break; } } + return true; } -- 2.17.1