From: luozheng <1732036298@qq.com> Date: Thu, 8 Jan 2026 02:25:59 +0000 (+0800) Subject: 禅道1661:解决手表-手动打开过一次HRV后,列表切换成瀑布流,随便点开一个别的功能icon,打开别的功能之前都会闪现一次HRV页面 bug X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F3047%2Ftarget%2F1;p=mirrors%2FFD230.git 禅道1661:解决手表-手动打开过一次HRV后,列表切换成瀑布流,随便点开一个别的功能icon,打开别的功能之前都会闪现一次HRV页面 bug --- diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/include/HrvView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/include/HrvView.h index 220be303f..5e8467a13 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/include/HrvView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/include/HrvView.h @@ -37,8 +37,8 @@ public: private: bool Label_init(); bool Image_init(); + void ClearAll(); UIViewGroup *group{nullptr}; - UIView:: OnDragListener* dragListener{nullptr}; //7天平均值提示 UILabelExt *hrv_average_reminder_label{nullptr}; //7天平均值 @@ -59,12 +59,6 @@ private: UIImageView *white_point_imageview{nullptr}; //绿点 UIImageView *green_point_imageview{nullptr}; - - UIImageAnimatorView *PullUpAnimatorView{nullptr}; // 上拉动画 - - ImageAnimatorInfo PullUpimageAnimatorInfo[70]{0}; - - const ImageInfo** PullUpimageAnimator_imageInfo{nullptr}; uint32_t current_hrv_value = 0; uint32_t measurement_time = 0; diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/src/HrvPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/src/HrvPresenter.cpp index f8ddf7017..d1005f4a3 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/src/HrvPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/src/HrvPresenter.cpp @@ -23,17 +23,11 @@ static HrvPresenter *g_pMainView = nullptr; HrvPresenter::HrvPresenter() { g_pMainView = this; -#ifdef MEM_CHECK - MemCheck::GetInstance()->EnableLeakCheck(true); -#endif } HrvPresenter::~HrvPresenter() { g_pMainView = nullptr; -#ifdef MEM_CHECK - MemCheck::GetInstance()->EnableLeakCheck(false); -#endif } HrvPresenter *HrvPresenter::GetInstance(void) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/src/HrvView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/src/HrvView.cpp index f34da6189..31c85dc4c 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/src/HrvView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/hrv/src/HrvView.cpp @@ -19,18 +19,16 @@ static HrvView *g_pHrvView = nullptr; HrvView::HrvView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HrvView::HrvView"); g_pHrvView = this; -#ifdef MEM_CHECK - MemCheck::GetInstance()->EnableLeakCheck(true); -#endif + } HrvView::~HrvView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HrvView::~HrvView"); + ClearAll(); g_pHrvView = nullptr; -#ifdef MEM_CHECK - MemCheck::GetInstance()->EnableLeakCheck(false); -#endif } HrvView *HrvView::GetInstance() @@ -38,6 +36,48 @@ HrvView *HrvView::GetInstance() return g_pHrvView; } +void HrvView::ClearAll() +{ + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HrvView::ClearAll"); + if (group != nullptr) + { + group->RemoveAll(); + delete group; + group = nullptr; + + delete hrv_average_reminder_label; + hrv_average_reminder_label = nullptr; + + delete hrv_average_value_label; + hrv_average_value_label = nullptr; + + delete unit_label; + unit_label = nullptr; + + delete result_label; + result_label = nullptr; + + delete baseline_label; + baseline_label = nullptr; + + delete last_average_value_label; + last_average_value_label = nullptr; + + delete last_average_reminder_value_label; + last_average_reminder_value_label = nullptr; + + delete imageview; + imageview = nullptr; + + delete white_point_imageview; + white_point_imageview = nullptr; + + delete green_point_imageview; + green_point_imageview = nullptr; + + } +} + void HrvView::OnStart() { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HrvView::OnStart"); @@ -49,7 +89,7 @@ void HrvView::OnStart() group->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); group->SetStyle(STYLE_BACKGROUND_OPA, 0xD0); group->SetOnDragListener((UIView::OnDragListener *)OHOS::HrvPresenter::GetInstance()); - RootView::GetInstance()->Add(group); + AddViewToRootContainer(group); Label_init(); Image_init();