From: xue <2144439972@qq.com> Date: Wed, 24 Dec 2025 09:18:04 +0000 (+0800) Subject: 优化序列帧操作 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=fa56798b975a9d903048da30af6c126ebc6ad6a3;p=mirrors%2FFD230.git 优化序列帧操作 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdBlueView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdBlueView.h index f2f904ab4..71b415796 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdBlueView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdBlueView.h @@ -64,6 +64,7 @@ namespace OHOS UIViewGroup *ThunderBirdBlueViewInit(void); void ClearAll(void); void Show(int16_t showView); + void StopAllAnimations(); // 停止所有动画 void UpdateTaskReminderText(const char* text); void RefreshDeviceList(void); void HandleBluetoothViewOperation(int16_t view); diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdBlueView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdBlueView.cpp index efdee5fca..90a924908 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdBlueView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdBlueView.cpp @@ -232,6 +232,14 @@ namespace OHOS return group; } + void ThunderBirdBlueView::StopAllAnimations() + { + if (searchAnimator) { + searchAnimator->Stop(); + searchAnimator->SetVisible(false); + } + } + void ThunderBirdBlueView::Show(int16_t showView) { if (group == nullptr) { return; } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp index 08cbf06e6..ce49796d1 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp @@ -165,6 +165,18 @@ namespace OHOS return group; } + void ThunderBirdDialogueView::StopAllAnimations() + { + if (speakAnimator) { + speakAnimator->Stop(); + speakAnimator->SetVisible(false); + } + if (listenAnimator) { + listenAnimator->Stop(); + listenAnimator->SetVisible(false); + } + } + void ThunderBirdDialogueView::Show(int16_t showView) { if (group == nullptr) { return; } 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 b781836fe..2bbb579e1 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 @@ -231,7 +231,7 @@ namespace OHOS if (RemindLabel) { RemindLabel->SetVisible(false);} if (RemindIcon) { RemindIcon->SetVisible(false); } if (RemindIcon2) { RemindIcon2->SetVisible(false); } - if (listenAnimator) { listenAnimator->SetVisible(false);listenAnimator->Start(); } + if (listenAnimator) { listenAnimator->SetVisible(false); listenAnimator->Stop(); } switch (showView) { diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp index c091677ba..6e91025b2 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp @@ -1044,6 +1044,44 @@ namespace OHOS { return; } + // 切换界面时,停止所有正在运行的序列帧动画 + // 注意:由于Show函数在开始时都会停止动画,这里只处理public的animator + // private的animator会在Show函数中被停止 + switch (hideView) + { + case THUNDERBIRD_GUIDEVIEW: + if (g_pThunderBirdGuideView && g_pThunderBirdGuideView->bandAnimator) { + g_pThunderBirdGuideView->bandAnimator->Stop(); + g_pThunderBirdGuideView->bandAnimator->SetVisible(false); + } + break; + case THUNDERBIRD_DIALOGUEVIEW: + // speakAnimator和listenAnimator是private的,通过StopAllAnimations()停止 + if (g_pThunderBirdDialogueView) { + g_pThunderBirdDialogueView->StopAllAnimations(); + } + break; + case THUNDERBIRD_ADJUSTVIEW: + // netAnimator是private的,通过StopAllAnimations()停止 + if (g_pThunderBirdAdjustView) { + g_pThunderBirdAdjustView->StopAllAnimations(); + } + break; + case THUNDERBIRD_BLUEVIEW: + // searchAnimator是private的,通过StopAllAnimations()停止 + if (g_pThunderBirdBlueView) { + g_pThunderBirdBlueView->StopAllAnimations(); + } + break; + case THUNDERBIRD_LULLABYVIEW: + if (g_pThunderBirdLullabyView && g_pThunderBirdLullabyView->listenAnimator) { + g_pThunderBirdLullabyView->listenAnimator->Stop(); + g_pThunderBirdLullabyView->listenAnimator->SetVisible(false); + } + break; + default: + break; + } group[hideView]->SetVisible(false); } // 同用遮罩,部分界面在内部自行开启,其余界面关闭 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 9bda2008c..648b62bf2 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 @@ -1125,7 +1125,7 @@ namespace OHOS // 显示后再设置2秒定时器自动隐藏提示 } networkCount++; - if(networkCount > 2) + if(networkCount > 3) { //重新连接网络 do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_CAT1_RESTART, NULL, 0); @@ -1150,7 +1150,7 @@ namespace OHOS reminderView->dialogue_vad_initializing(); } vadAuthCount++; - if(vadAuthCount > 2) + if(vadAuthCount > 3) { //先同步时间 cat1_gettime();